diff options
Diffstat (limited to 'activestorage/db')
-rw-r--r-- | activestorage/db/migrate/20170806125915_create_active_storage_tables.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/activestorage/db/migrate/20170806125915_create_active_storage_tables.rb b/activestorage/db/migrate/20170806125915_create_active_storage_tables.rb index 76a155f8b6..d333b6bf9c 100644 --- a/activestorage/db/migrate/20170806125915_create_active_storage_tables.rb +++ b/activestorage/db/migrate/20170806125915_create_active_storage_tables.rb @@ -15,14 +15,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 |