diff options
Diffstat (limited to 'lib/active_storage/migration.rb')
-rw-r--r-- | lib/active_storage/migration.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/active_storage/migration.rb b/lib/active_storage/migration.rb index c56e7a1786..99d8b8554b 100644 --- a/lib/active_storage/migration.rb +++ b/lib/active_storage/migration.rb @@ -14,15 +14,16 @@ class ActiveStorageCreateTables < ActiveRecord::Migration[5.1] # :nodoc: create_table :active_storage_attachments do |t| t.string :name - t.string :record_gid + t.string :record_type + t.integer :record_id t.integer :blob_id t.datetime :created_at - t.index :record_gid t.index :blob_id - t.index [ :record_gid, :name ] - t.index [ :record_gid, :blob_id ], unique: true + t.index [ :record_type, :record_id ] + t.index [ :record_type, :record_id, :name ], name: "index_active_storage_attachments_record_and_name" + t.index [ :record_type, :record_id, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true end end end |