#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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019ce727bced-4a59b824-ebc1-485e-b534-bb6366c18d38-000000%40eu-central-1.amazonses.com.

Reply via email to