From 02b0af4f7ce2e9c8135c7983c13b3a7844b69740 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 24 Jun 2014 12:25:07 -0400 Subject: - write some really complete docs on MSSQL autoincrement, fixes #3094 --- lib/sqlalchemy/sql/schema.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index 13461f3f3..121f6da77 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -840,10 +840,17 @@ class Column(SchemaItem, ColumnClause): * Part of the primary key - * Are not referenced by any foreign keys, unless - the value is specified as ``'ignore_fk'`` + * Not refering to another column via :class:`.ForeignKey`, unless + the value is specified as ``'ignore_fk'``:: - .. versionadded:: 0.7.4 + # turn on autoincrement for this column despite + # the ForeignKey() + Column('id', ForeignKey('other.id'), + primary_key=True, autoincrement='ignore_fk') + + It is typically not desirable to have "autoincrement" enabled + on such a column as its value intends to mirror that of a + primary key column elsewhere. * have no server side or client side defaults (with the exception of Postgresql SERIAL). -- cgit v1.2.1