]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
column.foreign_key -> foreign_keys in MSSQL
authorPaul Johnston <paj@pajhome.org.uk>
Sun, 25 Nov 2007 17:32:06 +0000 (17:32 +0000)
committerPaul Johnston <paj@pajhome.org.uk>
Sun, 25 Nov 2007 17:32:06 +0000 (17:32 +0000)
lib/sqlalchemy/databases/mssql.py

index 469355083bebe0736fa1cfbb14b5593076bcbf6e..ba6bb7f0fd6606aaed9a10fd75d7f6adf44c23fb 100644 (file)
@@ -279,7 +279,7 @@ class MSSQLExecutionContext(default.DefaultExecutionContext):
 
     def _has_implicit_sequence(self, column):
         if column.primary_key and column.autoincrement:
-            if isinstance(column.type, sqltypes.Integer) and not column.foreign_key:
+            if isinstance(column.type, sqltypes.Integer) and not column.foreign_keys:
                 if column.default is None or (isinstance(column.default, schema.Sequence) and \
                                               column.default.optional):
                     return True
@@ -943,7 +943,7 @@ class MSSQLSchemaGenerator(compiler.SchemaGenerator):
         
         # install a IDENTITY Sequence if we have an implicit IDENTITY column
         if (not getattr(column.table, 'has_sequence', False)) and column.primary_key and \
-                column.autoincrement and isinstance(column.type, sqltypes.Integer) and not column.foreign_key:
+                column.autoincrement and isinstance(column.type, sqltypes.Integer) and not column.foreign_keys:
             if column.default is None or (isinstance(column.default, schema.Sequence) and column.default.optional):
                 column.sequence = schema.Sequence(column.name + '_seq')