class CreateTargetFiles < ActiveRecord::Migration[5.1]
  def change
    create_table :target_files do |t|
      t.string   :sti_type
      t.string   :state
      t.integer  :size
      t.integer  :number_of_records
      t.datetime :start_time
      t.datetime :end_time
      t.string   :original_file # carrierwave
      # paperclip
      t.string   :original_file_file_name
      t.string   :original_file_content_type
      t.integer  :original_file_file_size
      t.datetime :original_file_updated_at

      t.timestamps null: false
    end
    add_index :target_files, :sti_type

    create_table :dunlop_target_file_downloads do |t|
      t.integer :user_id
      t.integer :target_file_id

      t.timestamps null: false
    end
  end
end
