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

Refs #27236 -- Clarified that "historical migrations" means "already applied". #15858

Closed
wants to merge 1 commit into from

Conversation

felixxm
Copy link
Member

@felixxm felixxm commented Jul 19, 2022

No description provided.

@carltongibson
Copy link
Member

Yes, I think it clarifies the meaning somewhat. 👍

@collinanderson do you think this assists some?

@collinanderson
Copy link
Contributor

collinanderson commented Jul 19, 2022

Hmm... I'm not sure I like defining "historical migrations" as "already applied". What if I need to take an old database backup and apply migrations to it? Now those "historical migrations" aren't applied. Can I apply these historical migrations to an old database backup after 5.1? It's unclear to me what the behavior would be after after 5.1, if there's any change at all. (Does it work the same way? Is it now a no-op?)

@collinanderson
Copy link
Contributor

Isn't the main point that deprecated migrations operations are never auto-generated by Django any more, and generally shouldn't be used in new migrations, but the migration operations won't actually be removed?

(If they are being removed, then it should say what replacement operation I should be using instead so I can go into my historic migrations and edit them to remain compatible.)

@felixxm
Copy link
Member Author

felixxm commented Jul 19, 2022

What if I need to take an old database backup and apply migrations to it? Now those "historical migrations" aren't applied.

I'd argue 😉 history is something that has already happened 🏰. When migrations are not applied to an old database backup then they are not historical in this db.

Can I apply these historical migrations to an old database backup after 5.1? It's unclear to me what the behavior would be after after 5.1, if there's any change at all. (Does it work the same way? Is it now a no-op?)

No you cannot, when deprecation ends the current warning will be changed to an error (it's exactly the same behavior that we used in the past when deprecating model fields). That's why in the subsequent PRs I would like add descriptive release notes, implement reducing AlterIndexTogether with RenameIndex, and add a hint to the migrations.W001 that refers to extensive notes.

@felixxm
Copy link
Member Author

felixxm commented Jul 19, 2022

@felixxm
Copy link
Member Author

felixxm commented Jul 26, 2022

Closing in favor of #15861.

@felixxm felixxm closed this Jul 26, 2022
@felixxm felixxm deleted the historical branch July 26, 2022 09:44
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.

3 participants