Opened 19 months ago

Last modified 19 months ago

#34510 closed Uncategorized

sqlmigrate does not follows replaces in squashed migrations — at Version 1

Reported by: NeodymiumFerBore Owned by: nobody
Component: Core (Management commands) Version: 4.2
Severity: Normal Keywords: squashed migration replaces sqlmigrate command core management
Cc: NeodymiumFerBore, David Sanders Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by NeodymiumFerBore)

Hello!

The sqlmigrate command does not follow replaces in squashed migration, with original (squashed) migration files deleted. This ticket is roughly the same than #32205, #33583 and #31318. In #31318, the issue is marked as solved with commit d883657. Since then, MigrationLoader accepts the argument replace_migrations. However, the loader instance here has this option to False. I don't see a command option to set it to True.

I tried to set it to True manually in 4.1.7, and it successfully showed SQL queries involved in the migration I wanted to inspect. sqlmigrate.py has not changed between 4.1.7 and 4.2, so I guess it also affects it.

Link: MigrationLoader instance in 4.1.7 L46
Link: MigrationLoader instance in 4.2 L46
Link: MigrationLoader instance in main L46

I see that it always has been like this since commit d883657. Now maybe I don't understand why it works like so. Could you explain why it is set to False with no option to set it to True? Is it unreliable?

Thank you.

Change History (1)

comment:1 by NeodymiumFerBore, 19 months ago

Cc: NeodymiumFerBore added
Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top