gitlabhq/db/migrate/20121009205010_postgres_cre...

16 lines
328 B
Ruby

class PostgresCreateIntegerCast < ActiveRecord::Migration
def up
execute <<-SQL
CREATE CAST (integer AS text) WITH INOUT AS IMPLICIT;
SQL
rescue ActiveRecord::StatementInvalid
end
def down
execute <<-SQL
DROP CAST (integer AS text);
SQL
rescue ActiveRecord::StatementInvalid
end
end