From 51f16d14980c4a061ea3e224c52acf91008f0b20 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 8 Oct 2006 02:46:40 +0000 Subject: - 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 --- lib/sqlalchemy/databases/mysql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/databases/mysql.py') 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 -- cgit v1.2.1