mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
Fix postgres bug when change_column is called with invalid parameters. [#861 state:resolved]
Signed-off-by: Tarmo Tänav <tarmo@itech.ee> Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
This commit is contained in:
committed by
Pratik Naik
parent
49c0e1e594
commit
0d74e72e6d
@@ -761,7 +761,8 @@ module ActiveRecord
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user