20230330135507_create_bulk_imports.rb 799 B

12345678910111213141516171819202122
  1. # frozen_string_literal: true
  2. class CreateBulkImports < ActiveRecord::Migration[6.1]
  3. def change
  4. create_table :bulk_imports do |t|
  5. t.integer :type, null: false
  6. t.integer :state, null: false
  7. t.integer :total_items, null: false, default: 0
  8. t.integer :imported_items, null: false, default: 0
  9. t.integer :processed_items, null: false, default: 0
  10. t.datetime :finished_at
  11. t.boolean :overwrite, null: false, default: false
  12. t.boolean :likely_mismatched, null: false, default: false
  13. t.string :original_filename, null: false, default: ''
  14. t.references :account, null: false, foreign_key: { on_delete: :cascade }
  15. t.timestamps
  16. end
  17. add_index :bulk_imports, [:id], name: :index_bulk_imports_unconfirmed, where: 'state = 0'
  18. end
  19. end