1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #30222 from kamipo/respect_pk_type

Use `references` to respect primary key type in active storage tables
This commit is contained in:
Matthew Draper 2017-08-13 20:15:49 +09:30 committed by GitHub
commit f505f23ca4

View file

@ -13,14 +13,12 @@ class CreateActiveStorageTables < ActiveRecord::Migration[5.1]
end
create_table :active_storage_attachments do |t|
t.string :name, null: false
t.string :record_type, null: false
t.integer :record_id, null: false
t.integer :blob_id, null: false
t.string :name, null: false
t.references :record, null: false, polymorphic: true, index: false
t.references :blob, null: false
t.datetime :created_at, null: false
t.index :blob_id
t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true
end
end