-- +goose Up
ALTER TABLE air_rescuer_profiles
  ADD COLUMN IF NOT EXISTS responsible_flight_rescuer TINYINT(1) NOT NULL DEFAULT 0 AFTER is_chief_physician_in_charge;

UPDATE air_rescuer_profiles arp
JOIN pilot_profiles pp ON pp.user_id = arp.user_id
SET arp.responsible_flight_rescuer = pp.responsible_flight_rescuer;

ALTER TABLE pilot_profiles
  DROP COLUMN IF EXISTS responsible_flight_rescuer;

-- +goose Down
ALTER TABLE pilot_profiles
  ADD COLUMN IF NOT EXISTS responsible_flight_rescuer TINYINT(1) NOT NULL DEFAULT 0 AFTER is_dul;

UPDATE pilot_profiles pp
JOIN air_rescuer_profiles arp ON arp.user_id = pp.user_id
SET pp.responsible_flight_rescuer = arp.responsible_flight_rescuer;

ALTER TABLE air_rescuer_profiles
  DROP COLUMN IF EXISTS responsible_flight_rescuer;
