class CreateBoardProposals < ActiveRecord::Migration[8.1]
  def change
    create_table :board_proposals do |t|
      t.integer :board_id, null: false
      t.integer :proposer_participant_id, null: false
      t.text :body, null: false
      t.string :status, null: false, default: 'pending'

      t.timestamps
    end

    add_index :board_proposals, :board_id
    add_index :board_proposals, :proposer_participant_id
    add_foreign_key :board_proposals, :boards
    add_foreign_key :board_proposals, :participants, column: :proposer_participant_id
  end
end
