ALTER TABLE availabillity
    ADD COLUMN startTimestamp        TIMESTAMP WITH TIME ZONE,
    ADD COLUMN endTimestamp          TIMESTAMP WITH TIME ZONE;

UPDATE availabillity SET
    startTimestamp=date::timestamp + COALESCE(startTime, time '0:00'),
    endTimestamp=date::timestamp + COALESCE(endTime, time '0:00');

ALTER TABLE availabillity
    ALTER COLUMN startTimestamp SET NOT NULL,
    ALTER COLUMN endTimestamp SET NOT NULL,
    DROP COLUMN date,
    DROP COLUMN startTime,
    DROP COLUMN endTime;

ALTER TABLE event
    ADD COLUMN startTimestamp        TIMESTAMP WITH TIME ZONE,
    ADD COLUMN endTimestamp          TIMESTAMP WITH TIME ZONE;

UPDATE event SET
    startTimestamp=date::timestamp + startTime,
    endTimestamp=date::timestamp + endTime;

ALTER TABLE event
    ALTER COLUMN startTimestamp SET NOT NULL,
    ALTER COLUMN endTimestamp SET NOT NULL,
    DROP COLUMN date,
    DROP COLUMN startTime,
    DROP COLUMN endTime;

ALTER TABLE assignment
    ADD COLUMN startTimestamp        TIMESTAMP WITH TIME ZONE,
    ADD COLUMN endTimestamp          TIMESTAMP WITH TIME ZONE;

UPDATE assignment SET (startTimestamp, endTimestamp) =
    (SELECT startTimestamp, endTimestamp FROM event
     WHERE event.id = assignment.eventId);

ALTER TABLE assignment
    ALTER COLUMN startTimestamp SET NOT NULL,
    ALTER COLUMN endTimestamp SET NOT NULL,
    DROP COLUMN startTime,
    DROP COLUMN endTime;
