diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-10-08 02:46:40 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-10-08 02:46:40 +0000 |
commit | 51f16d14980c4a061ea3e224c52acf91008f0b20 (patch) | |
tree | 5e713ade593621eefe9234b47945595248d39414 /lib/sqlalchemy/databases/mysql.py | |
parent | 758828ed544966cd78524f450f877be5b789fee4 (diff) | |
download | sqlalchemy-51f16d14980c4a061ea3e224c52acf91008f0b20.tar.gz |
- the "foreign_key" attribute on Column and ColumnElement in general
is deprecated, in favor of the "foreign_keys" list/set-based attribute,
which takes into account multiple foreign keys on one column.
"foreign_key" will return the first element in the "foreign_keys" list/set
or None if the list is empty.
- added a user test to the relationships test, testing various new things this
change allows
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r-- | lib/sqlalchemy/databases/mysql.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 2c29bbe2a..88efcb755 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -444,7 +444,7 @@ class MySQLSchemaGenerator(ansisql.ANSISchemaGenerator): if not column.nullable: colspec += " NOT NULL" if column.primary_key: - if not column.foreign_key and first_pk and column.autoincrement and isinstance(column.type, sqltypes.Integer): + if len(column.foreign_keys)==0 and first_pk and column.autoincrement and isinstance(column.type, sqltypes.Integer): colspec += " AUTO_INCREMENT" return colspec |