Fixed primary key reflection for SA 0.5.
This commit is contained in:
parent
617c28e8c7
commit
c2ba733f0d
1 changed files with 5 additions and 2 deletions
|
@ -61,6 +61,9 @@ class SQLBase7Dialect_SA05(SQLBase7Dialect):
|
|||
cursor.close()
|
||||
|
||||
cursor = connection.connection.cursor()
|
||||
for row in cursor.execute("SELECT COLNAME FROM %s.SYSPKCONSTRAINTS WHERE NAME = '%s' ORDER BY PKCOLSEQNUM" % (table.schema, table.name)):
|
||||
table.append_constraint(PrimaryKeyConstraint(row.COLNAME))
|
||||
key_columns = [row.COLNAME for row in cursor.execute(
|
||||
"SELECT COLNAME FROM %s.SYSPKCONSTRAINTS WHERE NAME = '%s' ORDER BY PKCOLSEQNUM" % (table.schema, table.name)
|
||||
)]
|
||||
if key_columns:
|
||||
table.append_constraint(PrimaryKeyConstraint(*key_columns))
|
||||
cursor.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue