diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-08-14 16:00:25 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-08-14 17:27:54 +0900 |
commit | a516dfd4b4adf904d41983044e2ccad0fbaf7a28 (patch) | |
tree | 7f55671cf1ebcdcae80f73b5c238980e040ea468 /activerecord/test/schema | |
parent | 691af789000446cedbe9faf532a991a87c7e254c (diff) | |
download | rails-a516dfd4b4adf904d41983044e2ccad0fbaf7a28.tar.gz rails-a516dfd4b4adf904d41983044e2ccad0fbaf7a28.tar.bz2 rails-a516dfd4b4adf904d41983044e2ccad0fbaf7a28.zip |
Fix CI failure due to reference type mismatch
`Firm.id` is a bigint if mysql2 adapter is used, but `firm_id` is an
integer. It will cause an out of range error.
https://travis-ci.org/rails/rails/jobs/264112814#L776
https://travis-ci.org/rails/rails/jobs/264112835#L919
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r-- | activerecord/test/schema/schema.rb | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb index 47749c07d2..8f872c38ba 100644 --- a/activerecord/test/schema/schema.rb +++ b/activerecord/test/schema/schema.rb @@ -9,7 +9,7 @@ ActiveRecord::Schema.define do # ------------------------------------------------------------------- # create_table :accounts, force: true do |t| - t.integer :firm_id + t.references :firm, index: false t.string :firm_name t.integer :credit_limit end @@ -197,11 +197,11 @@ ActiveRecord::Schema.define do create_table :companies, force: true do |t| t.string :type - t.integer :firm_id + t.references :firm, index: false t.string :firm_name t.string :name - t.integer :client_of - t.integer :rating, default: 1 + t.bigint :client_of + t.bigint :rating, default: 1 t.integer :account_id t.string :description, default: "" t.index [:firm_id, :type, :rating], name: "company_index", length: { type: 10 }, order: { rating: :desc } @@ -236,8 +236,8 @@ ActiveRecord::Schema.define do end create_table :contracts, force: true do |t| - t.integer :developer_id - t.integer :company_id + t.references :developer, index: false + t.references :company, index: false end create_table :customers, force: true do |t| @@ -263,7 +263,7 @@ ActiveRecord::Schema.define do t.string :name t.string :first_name t.integer :salary, default: 70000 - t.integer :firm_id + t.references :firm, index: false t.integer :mentor_id if subsecond_precision_supported? t.datetime :created_at, precision: 6 @@ -720,7 +720,7 @@ ActiveRecord::Schema.define do create_table :projects, force: true do |t| t.string :name t.string :type - t.integer :firm_id + t.references :firm, index: false t.integer :mentor_id end @@ -809,8 +809,7 @@ ActiveRecord::Schema.define do create_table :sponsors, force: true do |t| t.integer :club_id - t.integer :sponsorable_id - t.string :sponsorable_type + t.references :sponsorable, polymorphic: true, index: false end create_table :string_key_objects, id: false, force: true do |t| |