diff options
author | Andrey Kumanyaev <me@zzet.org> | 2012-10-10 03:31:51 +0400 |
---|---|---|
committer | Andrey Kumanyaev <me@zzet.org> | 2012-10-10 03:58:34 +0400 |
commit | 4eb7d82ae7b085049a889b8f4e7d421f05b39d07 (patch) | |
tree | 6addc144188fe8393442a48ded3c4902cc3b474f /db | |
parent | 3e1d52f4b7accb100d8a312236f8fc8005b78a69 (diff) | |
download | gitlab-ce-4eb7d82ae7b085049a889b8f4e7d421f05b39d07.tar.gz |
add support use string FK with integer PK
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20121009205010_postgres_create_integer_cast.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20121009205010_postgres_create_integer_cast.rb b/db/migrate/20121009205010_postgres_create_integer_cast.rb new file mode 100644 index 00000000000..b9a971387d1 --- /dev/null +++ b/db/migrate/20121009205010_postgres_create_integer_cast.rb @@ -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 |