mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-25 04:26:08 +10:00
add support use string FK with integer PK
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
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
|
||||
Reference in New Issue
Block a user