diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-01-08 18:11:52 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-01-08 18:11:52 +0000 |
commit | 23b744807599d01e6652a83d82e29da95695c814 (patch) | |
tree | 5cdceb6b7fdbca4f8475460a446a69d6bde08c83 /lib/sqlalchemy/databases/sqlite.py | |
parent | 4c50fd22ed79425d52f5a05667757c4f83ad5304 (diff) | |
download | sqlalchemy-23b744807599d01e6652a83d82e29da95695c814.tar.gz |
sqlite/postgres reflection will properly add foreign keys
added append_item() method to column to work similarly to table.append_item(), used to
append foreign keys to the column (required in mysql)
appending new foreign keys will properly replace the old one, so explicitly appending
foreign keys to tables will replace those loaded via table reflection (instead of doubling them up)
Diffstat (limited to 'lib/sqlalchemy/databases/sqlite.py')
-rw-r--r-- | lib/sqlalchemy/databases/sqlite.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/databases/sqlite.py b/lib/sqlalchemy/databases/sqlite.py index 3c15d48b5..49630b9ed 100644 --- a/lib/sqlalchemy/databases/sqlite.py +++ b/lib/sqlalchemy/databases/sqlite.py @@ -150,7 +150,7 @@ class SQLiteSQLEngine(ansisql.ANSISQLEngine): (tablename, localcol, remotecol) = (row[2], row[3], row[4]) #print "row! " + repr(row) remotetable = Table(tablename, self, autoload = True) - table.c[localcol].foreign_key = schema.ForeignKey(remotetable.c[remotecol]) + table.c[localcol].append_item(schema.ForeignKey(remotetable.c[remotecol])) # check for UNIQUE indexes c = self.execute("PRAGMA index_list(" + table.name + ")", {}) unique_indexes = [] |