Consolidate functionality for building column definition schemas.
Review Request #12224 — Created April 5, 2022 and submitted
This introduces
BaseEvolutionOperations.build_column_schema()
, which
will compute pieces of SQL needed in order to create or re-create a
column.This sort of operation has been implemented in a few different spots in
the codebase, in a few different ways. This consolidates all these,
simplifying the code paths, easing maintainability, and setting things
up for an upcoming change for field type changes.There is one change to the generation that impacts the SQLite3 tests,
but not any actual operation. The old logic would generate aUNIQUE
for aPRIMARY KEY
, which wasn't at all necessary. The new logic avoids
that.
Unit tests pass for all versions of Django and all databases.
Summary | ID |
---|---|
3143193ab76c3b4e07badfc95320c1dcf18252ea |
Description | From | Last Updated |
---|---|---|
F841 local variable 'sql_result' is assigned to but never used |
reviewbot | |
F841 local variable 'table_name' is assigned to but never used |
reviewbot | |
F821 undefined name 'new_field' |
reviewbot | |
F821 undefined name 'new_field' |
reviewbot | |
F841 local variable 'remote_field' is assigned to but never used |
reviewbot |