aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema/schema.rb
diff options
context:
space:
mode:
authorRoderick van Domburg <roderick@vandomburg.net>2013-08-25 11:22:36 +0200
committerRoderick van Domburg <roderick@vandomburg.net>2014-01-07 19:05:50 +0100
commit933063188870347b59b35d4f96df21864d0f8f0b (patch)
tree6e6b53d094cccc603ee97dae3117544faf9e6c84 /activerecord/test/schema/schema.rb
parent032ab5064b7b436c3ec71373d5faadceb273477e (diff)
downloadrails-933063188870347b59b35d4f96df21864d0f8f0b.tar.gz
rails-933063188870347b59b35d4f96df21864d0f8f0b.tar.bz2
rails-933063188870347b59b35d4f96df21864d0f8f0b.zip
Auto-generate stable fixture UUIDs on PostgreSQL.
Fixes: #11524
Diffstat (limited to 'activerecord/test/schema/schema.rb')
-rw-r--r--activerecord/test/schema/schema.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb
index ddfc1ac0d6..0fb2c6269f 100644
--- a/activerecord/test/schema/schema.rb
+++ b/activerecord/test/schema/schema.rb
@@ -17,6 +17,15 @@ ActiveRecord::Schema.define do
ActiveRecord::Base.connection.create_table(*args, &block)
ActiveRecord::Base.connection.execute "SET GENERATOR #{args.first}_seq TO 10000"
end
+ when "PostgreSQL"
+ enable_uuid_ossp!(ActiveRecord::Base.connection)
+ create_table :uuid_parents, id: :uuid, force: true do |t|
+ t.string :name
+ end
+ create_table :uuid_children, id: :uuid, force: true do |t|
+ t.string :name
+ t.uuid :uuid_parent_id
+ end
end