Ticket #26542: 26542.diff

File 26542.diff, 1.6 KB (added by Conrad Kramer, 8 years ago)
  • django/contrib/postgres/operations.py

    diff --git a/django/contrib/postgres/operations.py b/django/contrib/postgres/operations.py
    index 3bb81dc..8db9a2a 100644
    a b class CreateExtension(Operation):  
    1414    def database_forwards(self, app_label, schema_editor, from_state, to_state):
    1515        if schema_editor.connection.vendor != 'postgresql':
    1616            return
    17         schema_editor.execute("CREATE EXTENSION IF NOT EXISTS %s" % self.name)
     17        schema_editor.execute("CREATE EXTENSION IF NOT EXISTS \"%s\"" % self.name)
    1818
    1919    def database_backwards(self, app_label, schema_editor, from_state, to_state):
    20         schema_editor.execute("DROP EXTENSION %s" % self.name)
     20        schema_editor.execute("DROP EXTENSION \"%s\"" % self.name)
    2121
    2222    def describe(self):
    2323        return "Creates extension %s" % self.name
  • tests/postgres_tests/migrations/0001_setup_extensions.py

    diff --git a/tests/postgres_tests/migrations/0001_setup_extensions.py b/tests/postgres_tests/migrations/0001_setup_extensions.py
    index ad5d1c7..3ecdb68 100644
    a b from django.db import migrations  
    55
    66try:
    77    from django.contrib.postgres.operations import (
    8         HStoreExtension, UnaccentExtension,
     8        CreateExtension, HStoreExtension, UnaccentExtension,
    99    )
    1010except ImportError:
    1111    from django.test import mock
    class Migration(migrations.Migration):  
    1919    ]
    2020
    2121    operations = [
     22        CreateExtension('uuid-ossp'),
    2223        HStoreExtension(),
    2324        UnaccentExtension(),
    2425    ]
Back to Top