Consolidate functionality for building column definition schemas.

Review Request #12224 — Created April 5, 2022 and submitted — Latest diff uploaded

Information

Django Evolution
release-2.x

Reviewers

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 a UNIQUE
for a PRIMARY KEY, which wasn't at all necessary. The new logic avoids
that.

Unit tests pass for all versions of Django and all databases.

Commits

Files