class CreateMasterDataStatuses < ActiveRecord::Migration<%= migration_version %> def self.up create_table :master_data_statuses do |t| t.string :spec_name, limit: 255, null: false, default: '', comment: 'spec name' t.string :name, limit: 255, null: false, comment: 'テーブル名' t.string :version, limit: 255, null: false, comment: 'ハッシュ値' t.datetime :created_at, null: false, comment: '作成日時' t.datetime :updated_at, null: false, comment: '更新日時' end add_index :master_data_statuses, %i[spec_name name], name: 'idx_master_data_statuses_1', unique: true add_index :master_data_statuses, %i[spec_name name version], name: 'idx_master_data_statuses_2' end def self.down drop_table :master_data_statuses end end