Merge branch 'wip/schema-aware-introspection' into eo-master
Conflicts: tenant_schemas/postgresql_backend/introspection.py
This commit is contained in:
commit
8bd62ee84f
|
@ -91,7 +91,7 @@ class DatabaseSchemaIntrospection(DatabaseIntrospection):
|
||||||
AND idx.indexrelid = c2.oid
|
AND idx.indexrelid = c2.oid
|
||||||
AND c.relname = %s
|
AND c.relname = %s
|
||||||
AND c.relnamespace = n.oid
|
AND c.relnamespace = n.oid
|
||||||
AND n.name = %s
|
AND n.nspname = %s
|
||||||
""", [table_name, self.connection.schema_name])
|
""", [table_name, self.connection.schema_name])
|
||||||
for index, columns, unique, primary in cursor.fetchall():
|
for index, columns, unique, primary in cursor.fetchall():
|
||||||
if index not in constraints:
|
if index not in constraints:
|
||||||
|
@ -131,7 +131,7 @@ class DatabaseSchemaIntrospection(DatabaseIntrospection):
|
||||||
AND c1.relnamespace = n.oid
|
AND c1.relnamespace = n.oid
|
||||||
AND c2.relnamespace = n.oid
|
AND c2.relnamespace = n.oid
|
||||||
AND con.relnamespace = n.oid
|
AND con.relnamespace = n.oid
|
||||||
AND n.name = '%s'
|
AND n.nspname = '%s'
|
||||||
AND c1.relname = %s
|
AND c1.relname = %s
|
||||||
AND con.contype = 'f'""", [self.connection.schema_name, table_name])
|
AND con.contype = 'f'""", [self.connection.schema_name, table_name])
|
||||||
relations = {}
|
relations = {}
|
||||||
|
@ -169,7 +169,7 @@ class DatabaseSchemaIntrospection(DatabaseIntrospection):
|
||||||
AND attr.attrelid = c.oid
|
AND attr.attrelid = c.oid
|
||||||
AND attr.attnum = idx.indkey[0]
|
AND attr.attnum = idx.indkey[0]
|
||||||
AND c.relnamespace = n.oid
|
AND c.relnamespace = n.oid
|
||||||
AND n.name = %s
|
AND n.nspname = %s
|
||||||
AND c.relname = %s""", [self.connection.schema_name, table_name])
|
AND c.relname = %s""", [self.connection.schema_name, table_name])
|
||||||
indexes = {}
|
indexes = {}
|
||||||
for row in cursor.fetchall():
|
for row in cursor.fetchall():
|
||||||
|
|
Loading…
Reference in New Issue