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:
commit
f505f23ca4
1 changed files with 3 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue