Skip to content
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

Allow old pending migration to be applied #755

Merged
merged 1 commit into from
Jun 30, 2022

Conversation

billy1624
Copy link
Member

@billy1624 billy1624 commented May 20, 2022

PR Info

Breaking Changes

  • SeaORM migrator will search and apply all pending migration, without enforcing pending migrations must be in front of migrations that has been applied. See below for the in depth explanation

For example...

In the database, there are 2 migrations already been applied:

  • m20220120_000001_create_post_table
  • m20220520_000001_create_order_table

On the other hand, we have 3 migration files:

  • m20220120_000001_create_post_table.rs [Applied]
  • m20220519_000001_alter_post_table.rs [Pending]
  • m20220520_000001_create_order_table.rs [Applied]

So, we have a old (pending) migration, m20220519_000001_alter_post_table, waiting to be applied. And I have relaxed the constraint, now migrator will only search for pending migrations instead of enforcing all pending migrations to be in front of migrations that has been applied.

Copy link
Contributor

@Sytten Sytten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic looks good!

@billy1624 billy1624 requested a review from tyt2y3 May 20, 2022 10:34
@billy1624 billy1624 marked this pull request as ready for review May 20, 2022 10:34
@tyt2y3 tyt2y3 merged commit 50f9f5a into master Jun 30, 2022
@tyt2y3 tyt2y3 deleted the apply-old-pending-migration branch June 30, 2022 18:40
@tyt2y3
Copy link
Member

tyt2y3 commented Jun 30, 2022

Thank you all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

sea-orm-migrations relaxed file ordering
3 participants