2017-07-06 15:53:51 -04:00
|
|
|
class ActiveStorageCreateTables < ActiveRecord::Migration[5.1]
|
2017-06-30 13:12:58 -04:00
|
|
|
def change
|
2017-07-06 05:33:29 -04:00
|
|
|
create_table :active_storage_blobs do |t|
|
2017-07-05 09:18:50 -04:00
|
|
|
t.string :key
|
|
|
|
t.string :filename
|
|
|
|
t.string :content_type
|
|
|
|
t.text :metadata
|
2017-06-30 13:12:58 -04:00
|
|
|
t.integer :byte_size
|
2017-07-05 09:18:50 -04:00
|
|
|
t.string :checksum
|
|
|
|
t.time :created_at
|
2017-06-30 13:12:58 -04:00
|
|
|
|
2017-07-03 11:07:17 -04:00
|
|
|
t.index [ :key ], unique: true
|
2017-06-30 13:12:58 -04:00
|
|
|
end
|
2017-07-05 09:18:50 -04:00
|
|
|
|
2017-07-06 05:33:29 -04:00
|
|
|
create_table :active_storage_attachments do |t|
|
2017-07-05 09:18:50 -04:00
|
|
|
t.string :name
|
|
|
|
t.string :record_gid
|
|
|
|
t.integer :blob_id
|
|
|
|
|
|
|
|
t.time :created_at
|
|
|
|
|
|
|
|
t.index :record_gid
|
|
|
|
t.index :blob_id
|
|
|
|
t.index [ :record_gid, :name ]
|
|
|
|
t.index [ :record_gid, :blob_id ], unique: true
|
|
|
|
end
|
2017-06-30 13:12:58 -04:00
|
|
|
end
|
|
|
|
end
|