Replies: 2 comments
-
I think the starting point will be https://github.com/mikro-orm/mikro-orm/blob/master/packages/migrations/src/MigrationRunner.ts#L20C3-L20C64 as we are getting all the queries here. Output can be similar to |
Beta Was this translation helpful? Give feedback.
0 replies
-
Would really like this feature as well. We're currently migrating up and down on a diff of our migrations from our staging branch to main branch. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
This simply prints out all the SQL statements that would be run, but does not actually touch the database.
This can be a very useful check prior to running a migration on a database with real data. It also can be a bit of a sanity checker, unlike normal database queries, migrations are difficult to write tests for. So this would also allow developers to actually verify that their migration file runs, without running it.
Describe the solution you'd like
A flag like
--dry-run
that would stdout the sql queryAdditional context
https://www.doctrine-project.org/projects/doctrine-migrations/en/3.5/reference/managing-migrations.html#dry-run
typeorm/typeorm#7275
https://docs.djangoproject.com/en/4.2/ref/django-admin/#cmdoption-createcachetable-dry-run
Beta Was this translation helpful? Give feedback.
All reactions