Changes between Initial Version and Version 3 of Ticket #30023
- Timestamp:
- Dec 8, 2018, 11:42:35 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #30023
- Property Has patch set
- Property Summary SQLite schema editor can cause table corruption if unsed within a transaction since Django 2.0 → SQLite schema editor can cause table corruption if used within a transaction since Django 2.0
-
Ticket #30023 – Description
initial v3 1 1 2 2 3 From Django 2.0+ SQLite schema editor requires foreign key constraint checking to be disabled before performing any operationsto make sure foreign keys are not left pointing at `__old` tables when performing operations requiring table rebuilds.3 From Django 2.0+ SQLite schema editor requires foreign key constraint checking to be disabled to make sure foreign keys are not left pointing at `__old` tables when performing operations requiring table rebuilds. 4 4 5 5 Since [https://sqlite.org/foreignkeys.html#fk_enable SQLite prevents foreign key constraint checking from being disabled within a transaction] `SchemaEditor(atomic=True).__enter__()` has no choice but to disable foreign key constraints **before** opening the transaction meant to ensure atomic DDL operations.