Changes between Version 8 and Version 9 of Ticket #35902, comment 1
- Timestamp:
- Nov 10, 2024, 12:41:00 PM (11 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #35902, comment 1
v8 v9 3 3 The existence of extensions, which is tracked by database migration operations, is not different from other Postgres feature that the schema might require to create indices and fields such as collations and custom types. 4 4 5 The ''problem'' here is that `migrate --run-syncdb`, which is relied upon by [https://github.com/django/django/blob/40bfd7b09aa0907b143e96f0b055538f476e544e/django/db/backends/base/creation.py#L68-L84 test database creation], has absolutely no knowledge of database migration operations that don't relate directly to models. All it does is [https://github.com/django/django/blob/40bfd7b09aa0907b143e96f0b055538f476e544e/django/core/management/commands/migrate.py#L434-L489 create models] by design .5 The ''problem'' here is that `migrate --run-syncdb`, which is relied upon by [https://github.com/django/django/blob/40bfd7b09aa0907b143e96f0b055538f476e544e/django/db/backends/base/creation.py#L68-L84 test database creation], has absolutely no knowledge of database migration operations that don't relate directly to models. All it does is [https://github.com/django/django/blob/40bfd7b09aa0907b143e96f0b055538f476e544e/django/core/management/commands/migrate.py#L434-L489 create models] by design so operations that are not tied to a specific model such as `CreateExtension` (and friends), `CreateCollation`, and `RunSQL` are not going to get picked up. 6 6 7 7 To confirm the issue is not specific to `TEST_MIGRATE=False` yourself, try settings `MIGRATION_MODULES` entries to `None` for each of your `INSTALLED_APPS` and running `migrate --run-syncdb` against a fresh database, you should see the exact same failure.