Ticket #27826: columns-ordering.patch

File columns-ordering.patch, 1.1 KB (added by Michal Čihař, 8 years ago)

workaround patch

  • django/db/backends/base/schema.py

    diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py
    index b00853b74d..022952a7d4 100644
    a b class BaseDatabaseSchemaEditor(object):  
    971971        Returns all constraint names matching the columns and conditions
    972972        """
    973973        if column_names is not None:
    974             column_names = [
     974            column_names = set([
    975975                self.connection.introspection.column_name_converter(name)
    976976                for name in column_names
    977             ]
     977            ])
    978978        with self.connection.cursor() as cursor:
    979979            constraints = self.connection.introspection.get_constraints(cursor, model._meta.db_table)
    980980        result = []
    981981        for name, infodict in constraints.items():
    982             if column_names is None or column_names == infodict['columns']:
     982            if column_names is None or column_names == set(infodict['columns']):
    983983                if unique is not None and infodict['unique'] != unique:
    984984                    continue
    985985                if primary_key is not None and infodict['primary_key'] != primary_key:
Back to Top