Please sign in to comment.
Fixed #3214 -- Stopped parsing SQL with regex.
Avoided introducing a new regex-based SQL splitter in the migrations framework, before we're bound by backwards compatibility. Adapted this change to the legacy "initial SQL data" feature, even though it's already deprecated, in order to facilitate the transition to migrations. sqlparse becomes mandatory for RunSQL on some databases (all but PostgreSQL). There's no API to provide a single statement and tell Django not to attempt splitting. Since we have a more robust splitting implementation, that seems like a good tradeoff. It's easier to add a new keyword argument later if necessary than to remove one. Many people contributed to both tickets, thank you all, and especially Claude for the review. Refs #22401.
- Loading branch information...
Showing with 77 additions and 38 deletions.
- +2 −3 django/core/management/sql.py
- +34 −0 django/db/backends/__init__.py
- +1 −0 django/db/backends/postgresql_psycopg2/base.py
- +3 −0 django/db/backends/postgresql_psycopg2/operations.py
- +4 −24 django/db/migrations/operations/special.py
- +2 −0 docs/internals/contributing/writing-code/unit-tests.txt
- +8 −9 docs/ref/migration-operations.txt
- +8 −0 docs/releases/1.7.txt
- +0 −1 tests/initial_sql_regress/tests.py
- +14 −1 tests/migrations/test_operations.py
- +1 −0 tests/requirements/base.txt