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

      t.string :title, null: false, limit: 128
      t.text :description
      t.integer :sequence, null: false

      t.timestamps

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