Skip to content

Conversation

n2ygk
Copy link
Contributor

@n2ygk n2ygk commented Nov 20, 2018

@jleclanche I needed to do this anyway for overriding migrations due to django-pyodbc-azure/SQL Server deficiencies (#663, #583) so thought I might as well submit it. Merge or Close at your pleasure.

@n2ygk n2ygk requested a review from jleclanche November 20, 2018 14:56
@coveralls
Copy link

coveralls commented Nov 20, 2018

Pull Request Test Coverage Report for Build 1059

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.88%

Totals Coverage Status
Change from base Build 1058: 0.0%
Covered Lines: 1161
Relevant Lines: 1250

💛 - Coveralls

@n2ygk n2ygk changed the title squash migrations squash migrations 0001-0006 Nov 20, 2018
@n2ygk
Copy link
Contributor Author

n2ygk commented Nov 28, 2018

FWIW michiya/django-pyodbc-azure#189 fixes the django-pyodbc-azure limitation that lead to this need to squash.

@auvipy auvipy merged commit 32bba99 into django-oauth:master Feb 21, 2019
@rhenter rhenter mentioned this pull request Feb 28, 2020
6 tasks
@jnm
Copy link

jnm commented Aug 3, 2021

@n2ygk, @auvipy, thank you for your work on this project. I do want to mention, for future reference and in light of issues like #809, that this method of squashing migrations does not follow the long-standing instructions in the Django documentation:

You should commit this migration but leave the old ones in place; the new migration will be used for new installs. Once you are sure all instances of the codebase have applied the migrations you squashed, you can delete them.

I'd humbly request that if future squashes are needed:

  1. The creation of the new, squashed migration and the deletion of the old migrations do not happen in the same release;
  2. The squashed migration name indicates that it is a squash (as shown in the Django documentation's example, 0001_squashed_0004_undo_somthing.py) instead of reusing an existing migration name, which will already be logged as complete in existing installations' django_migrations table. That should make any problems due to missed intermediate migration steps or overlooked release notes more obvious.

Thanks for your consideration and thanks again for your work on this project.

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

Successfully merging this pull request may close these issues.

4 participants