ALTER TABLE hotel
    DROP CONSTRAINT fk_hotel_on_employee;

CREATE TABLE per_diem_mileage_dates
(
    per_diem_id      BIGINT NOT NULL,
    mileage_dates_id BIGINT NOT NULL
);

ALTER TABLE per_diem_mileage_dates
    ADD CONSTRAINT uc_per_diem_mileage_dates_mileagedates UNIQUE (mileage_dates_id);

ALTER TABLE per_diem_mileage_dates
    ADD CONSTRAINT fk_perdiemildat_on_mileage_date FOREIGN KEY (mileage_dates_id) REFERENCES mileage_date (id);

ALTER TABLE per_diem_mileage_dates
    ADD CONSTRAINT fk_perdiemildat_on_per_diem FOREIGN KEY (per_diem_id) REFERENCES per_diem (id);

ALTER TABLE hotel
    DROP COLUMN employee_id;

DROP SEQUENCE null_seq CASCADE;

ALTER SEQUENCE employee_seq INCREMENT BY 1;

ALTER TABLE time_adjustment
    ALTER COLUMN employee_sig TYPE text USING (employee_sig::text);

ALTER TABLE time_adjustment
    ALTER COLUMN manager_sig TYPE text USING (manager_sig::text);

ALTER TABLE back_pay
    ALTER COLUMN sig TYPE text USING (sig::text);

ALTER TABLE bonus
    ALTER COLUMN sig TYPE text USING (sig::text);

ALTER TABLE pto
    ALTER COLUMN sig TYPE text USING (sig::text);