-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add fake migrations running and reverting #8976
feat: add fake migrations running and reverting #8976
Conversation
1026ffa
to
6667b1e
Compare
Added a cli option to fake-run or fake-revert a migration, adding to the executed migrations table, but not actually running it. This feature is useful for when migrations are added after the fact or for interoperability between applications which are desired to each keep a consistent migration history Closes: typeorm#6195
6667b1e
to
e0b9651
Compare
@@ -23,6 +23,7 @@ export class MigrationExecutor { | |||
* each: each migration is run in a separate transaction | |||
*/ | |||
transaction: "all" | "none" | "each" = "all" | |||
fake: boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please add a description about this feature here as well?
before(async () => { | ||
dataSources = await createTestingConnections({ | ||
entities: [__dirname + "/entity/*{.js,.ts}"], | ||
enabledDrivers: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you explicitly specified all the drivers? it's not scalable, if you want to ignore only one or two drivers - better to add checks in the tests like if (dataSource.options.type === "mongodb") return
Thank you for contribution! Can you please address the given comments and resolve the conflicts before I can merge it? Thank you. |
thank you for contribution! |
* feat: add fake migrations running and reverting Added a cli option to fake-run or fake-revert a migration, adding to the executed migrations table, but not actually running it. This feature is useful for when migrations are added after the fact or for interoperability between applications which are desired to each keep a consistent migration history Closes: typeorm#6195 * changed enabled drivers in test * added docs to the property * fixed lint issue Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
Added a cli option to fake-run or fake-revert a migration, adding to the
executed migrations table, but not actually running it. This feature is
useful for when migrations are added after the fact or for
interoperability between applications which are desired to each keep
a consistent migration history
Closes: #6195
Description of change
Extended cli
migration:run
andmigration:revert
to have a--fake
(alias-f
) option, to fake run migrations, for migrations added after the fact (similar to Django'spython manage.py migrate --fake
). Detailed description in linked issue.Pull-Request Checklist
master
branchnpm run format
to apply prettier formattingnpm run test
passes with this change ---> SAP skipped as tests threw errors that blocked all tests from being run. Some tests where also failing before the update as well (schema builder > create table), these ones do still fail (at least on my end).Fixes #0000