aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-10-27 22:53:17 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-10-27 22:57:16 +0900
commit7fae9ba0544c092ecca7fac0856766a3c8100bcc (patch)
tree5e3646189fdc549069e01afa12113671b107ca24 /activerecord/test/schema
parent6c98dad59d29bc26b4957d2b7547b16bc9919526 (diff)
downloadrails-7fae9ba0544c092ecca7fac0856766a3c8100bcc.tar.gz
rails-7fae9ba0544c092ecca7fac0856766a3c8100bcc.tar.bz2
rails-7fae9ba0544c092ecca7fac0856766a3c8100bcc.zip
`create_table` with `:primary_key` option has no effect if `id: false` is given
Use column definition with `primary_key: true` instead.
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r--activerecord/test/schema/schema.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb
index 56ff81af29..a3989cc66d 100644
--- a/activerecord/test/schema/schema.rb
+++ b/activerecord/test/schema/schema.rb
@@ -983,14 +983,16 @@ ActiveRecord::Schema.define do
t.references :wheelable, polymorphic: true
end
- create_table :countries, force: true, id: false, primary_key: "country_id" do |t|
- t.string :country_id
+ create_table :countries, force: true, id: false do |t|
+ t.string :country_id, primary_key: true
t.string :name
end
- create_table :treaties, force: true, id: false, primary_key: "treaty_id" do |t|
- t.string :treaty_id
+
+ create_table :treaties, force: true, id: false do |t|
+ t.string :treaty_id, primary_key: true
t.string :name
end
+
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