-- https://blog.yo1.dog/updating-enum-values-in-postgresql-the-safe-and-easy-way/

ALTER TYPE jobs_statuses RENAME TO jobs_statuses_old;
CREATE TYPE jobs_statuses AS ENUM('CREATED', 'FAILED', 'INITIATED', 'PREPARING', 'RUNNING', 'FINISHING', 'FINISHED', 'POST_PROCESS', 'STOPPING', 'STOPPED', 'NOT_FOUND');
ALTER TABLE jobs ALTER COLUMN status TYPE jobs_statuses USING status::text::jobs_statuses;
DROP TYPE jobs_statuses_old;
