提交 abfa46e3 编写于 作者: M Mike Gunderloy 提交者: Yehuda Katz

Add transaction check to SQLite2 adapter to fix...

Add transaction check to SQLite2 adapter to fix test_sqlite_add_column_in_transaction_raises_statement_invalid [#1669 state:resolved]
Signed-off-by: NPratik Naik <pratiknaik@gmail.com>
上级 ab7c25d5
......@@ -402,6 +402,10 @@ def rename_table(name, new_name)
end
def add_column(table_name, column_name, type, options = {}) #:nodoc:
if @connection.respond_to?(:transaction_active?) && @connection.transaction_active?
raise StatementInvalid, 'Cannot add columns to a SQLite database while inside a transaction'
end
alter_table(table_name) do |definition|
definition.column(column_name, type, options)
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册