1 # This migration comes from active_storage (originally 20170806125915)
 
   2 class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
 
   4     create_table :active_storage_blobs do |t|
 
   5       t.string   :key,        :null => false
 
   6       t.string   :filename,   :null => false
 
   9       t.bigint   :byte_size,  :null => false
 
  10       t.string   :checksum,   :null => false
 
  11       t.datetime :created_at, :null => false
 
  13       t.index [:key], :unique => true
 
  16     create_table :active_storage_attachments do |t|
 
  17       t.string     :name,     :null => false
 
  18       t.references :record,   :null => false, :polymorphic => true, :index => false
 
  19       t.references :blob,     :null => false
 
  21       t.datetime :created_at, :null => false
 
  23       t.index [:record_type, :record_id, :name, :blob_id], :name => "index_active_storage_attachments_uniqueness", :unique => true
 
  24       t.foreign_key :active_storage_blobs, :column => :blob_id