提交 0d74e72e 编写于 作者: M Miles Georgi 提交者: Pratik Naik

Fix postgres bug when change_column is called with invalid parameters. [#861 state:resolved]

Signed-off-by: NTarmo Tänav <tarmo@itech.ee>
Signed-off-by: NPratik Naik <pratiknaik@gmail.com>
上级 49c0e1e5
......@@ -761,7 +761,8 @@ def change_column(table_name, column_name, type, options = {})
begin
execute "ALTER TABLE #{quoted_table_name} ALTER COLUMN #{quote_column_name(column_name)} TYPE #{type_to_sql(type, options[:limit], options[:precision], options[:scale])}"
rescue ActiveRecord::StatementInvalid
rescue ActiveRecord::StatementInvalid => e
raise e if postgresql_version > 80000
# This is PostgreSQL 7.x, so we have to use a more arcane way of doing it.
begin
begin_db_transaction
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册