#36985: Reversing CreateExtension throws error on non-postgresql database
-----------------------+--------------------------------------------
Reporter: tahme | Type: Bug
Status: new | Component: contrib.postgres
Version: 6.0 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------+--------------------------------------------
When run on sqlite, a migration using postgres CreateExtension will skip
creating the extension. Trying to reverse the migration throws an error:
{{{
django.db.utils.OperationalError: no such table: pg_extension
}}}
I assume this is because CreateExtension.database_forwards checks
schema_editor.connection.vendor != "postgresql" but
CreateExtension.database_backwards does not.
Minimal migration example:
{{{
from django.db import migrations
from django.contrib.postgres.operations import CreateExtension
class Migration(migrations.Migration):
dependencies = []
operations = [
CreateExtension("pg_trgm")
]
}}}
--
Ticket URL: <
https://code.djangoproject.com/ticket/36985>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.