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

Make rebase-migration handle chains of migrations #27

Open
adamchainz opened this issue Dec 17, 2020 · 2 comments · May be fixed by #343
Open

Make rebase-migration handle chains of migrations #27

adamchainz opened this issue Dec 17, 2020 · 2 comments · May be fixed by #343

Comments

@adamchainz
Copy link
Owner

From @tolomea again: If a feature branch has 2+ migrations in the same app, rebase-migration can't help with rebasing the migration. It should be possible to rebase an arbitrary linear chain of migrations by converting the existing code into higher-level abstractions.

@tolomea
Copy link

tolomea commented Jul 6, 2021

Additionally, currently when it encounters this situation it makes incorrect modifications, it would be preferable if it at least errored

@adamchainz
Copy link
Owner Author

PR's welcome

roanster007 added a commit to roanster007/django-linear-migrations that referenced this issue Aug 2, 2024
Previously, the rebase_migration command was not able to rebase
chains of migrations in a single app.

This commit introduces a new flag -- "new" which basically is used
for the first migration you create, and it wipes out your migration
history in max_migration.txt, and writes up that first migration in
the first line. Any further migrations added without the flag are
simply added under each other in the max_migration.txt.

This would allow the rebase_migration command to access the
chain of migrations that need to be rebased in a commit, and
will rebase them accordingly.

Fixes adamchainz#27
roanster007 added a commit to roanster007/django-linear-migrations that referenced this issue Aug 5, 2024
Previously, the rebase_migration command was not able to rebase
chains of migrations in a single app.

This commit introduces a new flag -- "new" which basically is used
for the first migration you create, and it wipes out your migration
history in max_migration.txt, and writes up that first migration in
the first line. Any further migrations added without the flag are
simply added under each other in the max_migration.txt.

This would allow the rebase_migration command to access the
chain of migrations that need to be rebased in a commit, and
will rebase them accordingly.

Fixes adamchainz#27
roanster007 added a commit to roanster007/django-linear-migrations that referenced this issue Aug 9, 2024
Previously, the rebase_migration command was not able to rebase
chains of migrations in a single app.

This commit introduces a new flag -- "new" which basically is used
for the first migration you create, and it wipes out your migration
history in max_migration.txt, and writes up that first migration in
the first line. Any further migrations added without the flag are
simply added under each other in the max_migration.txt.

This would allow the rebase_migration command to access the
chain of migrations that need to be rebased in a commit, and
will rebase them accordingly.

Fixes adamchainz#27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants