1
0
mirror of https://github.com/funamitech/mastodon synced 2024-12-15 15:18:30 +09:00
YuruToot/db/migrate/20230330135507_create_bulk_imports.rb

23 lines
799 B
Ruby
Raw Normal View History

2023-05-02 19:08:48 +09:00
# frozen_string_literal: true
class CreateBulkImports < ActiveRecord::Migration[6.1]
def change
create_table :bulk_imports do |t|
t.integer :type, null: false
t.integer :state, null: false
t.integer :total_items, null: false, default: 0
t.integer :imported_items, null: false, default: 0
t.integer :processed_items, null: false, default: 0
t.datetime :finished_at
t.boolean :overwrite, null: false, default: false
t.boolean :likely_mismatched, null: false, default: false
t.string :original_filename, null: false, default: ''
t.references :account, null: false, foreign_key: { on_delete: :cascade }
t.timestamps
end
add_index :bulk_imports, [:id], name: :index_bulk_imports_unconfirmed, where: 'state = 0'
end
end