]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
Merged in moriyoshi/alembic/bugfix/autoincrement_for_mysql_alter_column (pull request...
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 23 Aug 2012 01:14:46 +0000 (21:14 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 23 Aug 2012 01:14:46 +0000 (21:14 -0400)
1  2 
alembic/ddl/impl.py
alembic/ddl/mssql.py
alembic/ddl/mysql.py
alembic/operations.py

index 8bfdf5551a30896c5bb0065e06d2b7eea38fe5cd,32e15e66ec569531f298000f24ecc0f0c0b28448..220fbef03c5309fd681241c54244f86990b45ab5
@@@ -83,13 -83,16 +83,16 @@@ class DefaultImpl(object)
                          name=None,
                          type_=None,
                          schema=None,
+                         autoincrement=None,
                          existing_type=None,
                          existing_server_default=None,
-                         existing_nullable=None
+                         existing_nullable=None,
+                         existing_autoincrement=None
                      ):
+         if autoincrement is not None or existing_autoincrement is not None:
+             util.warn("nautoincrement and existing_autoincrement only make sense for MySQL")
          if nullable is not None:
 -            self._exec(base.ColumnNullable(table_name, column_name, 
 +            self._exec(base.ColumnNullable(table_name, column_name,
                                  nullable, schema=schema,
                                  existing_type=existing_type,
                                  existing_server_default=existing_server_default,
Simple merge
Simple merge
index d1f7835afb2c26615323943babd09e8e4b168b15,beb0f9fbc137c37d67408d810a42f366fb232de6..f69976896c67846520037650ee4b0a81451dfa9e
@@@ -223,18 -220,10 +225,19 @@@ class Operations(object)
          :param existing_nullable: Optional; the existing nullability
           of the column.  Required on MySQL if the existing nullability
           is not being changed; else MySQL sets this to NULL.
+         :param existing_autoincrement: Optional; the 
          """
  
 -        if existing_type:
 +        compiler = self.impl.dialect.statement_compiler(
 +                            self.impl.dialect,
 +                            None
 +                        )
 +        def _count_constraint(constraint):
 +            return not isinstance(constraint, schema.PrimaryKeyConstraint) and \
 +                (not constraint._create_rule or
 +                    constraint._create_rule(compiler))
 +
 +        if existing_type and type_:
              t = self._table(table_name,
                          schema.Column(column_name, existing_type)
                      )