class CreateModuleConfig < ActiveRecord::Migration[6.0]
  def change
    create_table :module_configs do |t|
      t.references :school, type: :integer, null: false, index: false,
        foreign_key: { to_table: :Schools, primary_key: :SchoolID }

      t.string :type, null: false
      t.boolean :accounting, null: false, default: false
      t.boolean :covid, null: false, default: false

      t.timestamps

      t.index [:school_id, :type]
    end
  end
end
