diff options
author | Robert Leftwich <rtl@pobox.com> | 2006-03-01 09:37:45 +0000 |
---|---|---|
committer | Robert Leftwich <rtl@pobox.com> | 2006-03-01 09:37:45 +0000 |
commit | 371a6ca0de39b0affc25852b782898f2497eaeb0 (patch) | |
tree | d79e941f2c9d493fbd1b252905869aea783c8bf0 /lib/sqlalchemy/databases/mysql.py | |
parent | e8d8fa14b63a994ac1e0953bbe494a7c6ade9572 (diff) | |
download | sqlalchemy-371a6ca0de39b0affc25852b782898f2497eaeb0.tar.gz |
Modified mysql to not add AUTOINCREMENT to the first integer primary key if it is also a foreign key.
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 d660db7bd..bcd7f5095 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -261,7 +261,7 @@ class MySQLSchemaGenerator(ansisql.ANSISchemaGenerator): if column.primary_key: if not override_pk: colspec += " PRIMARY KEY" - if first_pk and isinstance(column.type, types.Integer): + if not column.foreign_key and first_pk and isinstance(column.type, types.Integer): colspec += " AUTO_INCREMENT" if column.foreign_key: colspec += ", FOREIGN KEY (%s) REFERENCES %s(%s)" % (column.name, column.foreign_key.column.table.name, column.foreign_key.column.name) |