class CreateEmployeePostions < ActiveRecord::Migration[6.0]
  def change
    create_table :employee_positions do |t|
      t.references :employee, null: false, type: :integer,
        foreign_key: { to_table: :Users, primary_key: :UserID }
      t.references :position, null: false, type: :integer,
        foreign_key: { to_table: :UserPositions, primary_key: :UPID }
      t.references :employment_descriptor, type: :integer,
        foreign_key: { to_table: :EdFi_Descriptors, primary_key: :DescriptorID }

      t.date :start_date, null: false
      t.date :end_date, null: true

      t.timestamps
    end
  end
end
