Migrate database schema does not work on empty database #5548
Replies: 1 comment 2 replies
-
This is executed automatically when you do
You first create the schema and then call this method. What the method does is that it creates the migration based on metadata, sees you actually have the schema already in place, and logs the migration as executed because of that. Also if you drop the database, you need to remove the migrations snapshot file, that could cause the latter issue - I guess that's something we should do automatically.
No idea what
That method returns boolean, not array.
Why not latest?
You are not supposed to modify the file anyhow, why are you asking? |
Beta Was this translation helpful? Give feedback.
-
Why are the migrations not executed/found when I execute them programmatically?
I run the following commands (note that the
config
is always the same apart from the username and its password):Then, I drop the database and run the following commands:
If needed, I can create a repo with reproduction.
Note that while IWhy are the migrations not executed/found when I execute them programmatically?
I run the following commands (note that the
config
is always the same apart from the username and its password):Then, I drop the database and run the following commands:
If needed, I can create a repo with reproduction.
Note that while I use Nest.js, I run this particular script outside it (before boostrapping the app).
Thanks in advance! 🙏
OT: When can I find the JSON schema or TS types for snapshot files? 🤔
Versions:
@mikro-orm/core@6.1.11
;@mikro-orm/migrations@6.1.11
;@mikro-orm/nestjs@5.2.3
;@mikro-orm/postgresql@6.1.11
;@mikro-orm/reflection@6.1.11
;@mikro-orm/seeder@6.1.11
;@mikro-orm/sql-highlighter@1.0.1
.Beta Was this translation helpful? Give feedback.
All reactions