

UPDATE ugc.task SET status = 'done' where status in ('cancelled', 'submitted');

CREATE TYPE ugc.task_status_t AS ENUM (
    'draft',
    'new',
    'acquired',
    'done'
);

ALTER TABLE ugc.task
    ALTER COLUMN status TYPE ugc.task_status_t USING status::text::ugc.task_status_t;

DROP TYPE ugc.task_status;

UPDATE ugc.assignment SET status = 'abandoned' WHERE status in ('expired', 'rejected');


CREATE TYPE ugc.assignment_status_t AS ENUM (
    'active',
    'abandoned',
    'completed',
    'accepted',
    'revoked'
);

ALTER TABLE ugc.assignment
    ALTER COLUMN status TYPE ugc.assignment_status_t USING status::text::ugc.assignment_status_t;

DROP TYPE ugc.assignment_status;

