scinote-web/db/migrate/20200604210943_add_archive_to_repository_row.rb

14 lines
453 B
Ruby
Raw Normal View History

2020-06-05 05:29:37 +08:00
# frozen_string_literal: true
class AddArchiveToRepositoryRow < ActiveRecord::Migration[6.0]
def change
change_table :repository_rows, bulk: true do |t|
t.boolean :archived, default: false, null: false
t.datetime :archived_on
2020-06-10 00:43:22 +08:00
t.datetime :restored_on
2020-06-05 05:29:37 +08:00
t.references :archived_by, index: true, foreign_key: { to_table: :users }
2020-06-10 00:43:22 +08:00
t.references :restored_by, index: true, foreign_key: { to_table: :users }
2020-06-05 05:29:37 +08:00
end
end
end