Opened 6 years ago
Last modified 6 years ago
#30189 closed Bug
sqlmigrate wraps it's outpout in BEGIN/COMMIT even if the database doesn't support transactional DDL — at Initial Version
Reported by: | Simon Charette | Owned by: | nobody |
---|---|---|---|
Component: | Migrations | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | yes |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
The migration executor only adds the outer BEGIN
/COMMIT
if the migration is atomic and the schema editor can rollback DDL but the current sqlmigrate
logic only takes migration.atomic
into consideration.
The issue change be addressed by
- Changing
sqlmigrate
assignment ofself.output_transaction
to considerconnection.features.can_rollback_ddl
as well. - Adding a test in
tests/migrations/test_commands.py
based on an existing test for non-atomic migrations that mocksconnection.features.can_rollback_ddl
toFalse
instead of overdiddingMIGRATION_MODULES
to point to a non-atomic migration.
I marked the ticket as easy picking because I included the above guidelines but feel free to uncheck it if you deem it inappropriate.
Note:
See TracTickets
for help on using tickets.