Modified mysql to not add AUTOINCREMENT to the first integer primary key if it is also a foreign key.

This commit is contained in:
Robert Leftwich
2006-03-01 09:37:45 +00:00
parent e8d8fa14b6
commit 371a6ca0de
+1 -1
View File
@@ -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)