aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2016-02-19 15:31:56 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2016-02-19 15:31:56 -0800
commit2df891dccdcfbdfb176c55297589712ac379f87d (patch)
tree0d2505faeaa910c2ef84ebcd70f45ab5d62bed99 /activerecord/test/schema
parente0c6156c693efffd8009a116a96f7ff631e4db47 (diff)
downloadrails-2df891dccdcfbdfb176c55297589712ac379f87d.tar.gz
rails-2df891dccdcfbdfb176c55297589712ac379f87d.tar.bz2
rails-2df891dccdcfbdfb176c55297589712ac379f87d.zip
eliminate warnings about multiple primary keys on habtm join tables
habtm join tables commonly have two id columns and it's OK to make those two id columns a primary key. This commit eliminates the warnings for join tables that have this setup. ManageIQ/manageiq#6713
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r--activerecord/test/schema/schema.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb
index b9e0706d60..2a8996f35c 100644
--- a/activerecord/test/schema/schema.rb
+++ b/activerecord/test/schema/schema.rb
@@ -929,7 +929,7 @@ ActiveRecord::Schema.define do
t.string :treaty_id
t.string :name
end
- create_table :countries_treaties, force: true, id: false do |t|
+ create_table :countries_treaties, force: true, primary_key: [:country_id, :treaty_id] do |t|
t.string :country_id, null: false
t.string :treaty_id, null: false
end