From: Mike Bayer Date: Thu, 4 Apr 2013 19:39:34 +0000 (-0400) Subject: transactional_ddl flag for SQLite, MySQL dialects X-Git-Tag: rel_0_5_0~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d1ed96698e0dee8f6fa82bd68616a5d324a0d9e;p=thirdparty%2Fsqlalchemy%2Falembic.git transactional_ddl flag for SQLite, MySQL dialects set to False. MySQL doesn't support it, SQLite does but current pysqlite driver does not. #112 --- diff --git a/alembic/ddl/mysql.py b/alembic/ddl/mysql.py index 1f04f2a5..04d8473d 100644 --- a/alembic/ddl/mysql.py +++ b/alembic/ddl/mysql.py @@ -10,6 +10,8 @@ from sqlalchemy import schema class MySQLImpl(DefaultImpl): __dialect__ = 'mysql' + transactional_ddl = False + def alter_column(self, table_name, column_name, nullable=None, server_default=False, diff --git a/alembic/ddl/sqlite.py b/alembic/ddl/sqlite.py index df92d960..b08e60f1 100644 --- a/alembic/ddl/sqlite.py +++ b/alembic/ddl/sqlite.py @@ -7,7 +7,11 @@ from alembic import util class SQLiteImpl(DefaultImpl): __dialect__ = 'sqlite' - transactional_ddl = True + + transactional_ddl = False + """SQLite supports transactional DDL, but pysqlite does not: + see: http://bugs.python.org/issue10740 + """ def add_constraint(self, const): # attempt to distinguish between an diff --git a/docs/build/changelog.rst b/docs/build/changelog.rst index eabb2212..f87deed3 100644 --- a/docs/build/changelog.rst +++ b/docs/build/changelog.rst @@ -6,6 +6,14 @@ Changelog .. changelog:: :version: 0.5.0 + .. change:: + :tags: bug + :tickets: 112 + + transactional_ddl flag for SQLite, MySQL dialects + set to False. MySQL doesn't support it, + SQLite does but current pysqlite driver does not. + .. change:: :tags: feature :pullreq: 30