class CreateCommunicationBatchEmails < ActiveRecord::Migration[6.0]
  def change
    create_table :communication_batch_emails do |t|
      t.references :school, type: :integer, null: false,
        foreign_key: { to_table: :Schools, primary_key: :SchoolID }
      t.references :author, type: :integer, null: false,
        foreign_key: { to_table: :Users, primary_key: :UserID }

      t.integer :status, default: 0, null: false
      t.string :subject, limit: 64, null: false
      t.string :description, limit: 255

      t.timestamps
    end
  end
end
