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

ALTER TYPE resources_enum RENAME TO resources_enum_old;
CREATE TYPE resources_enum AS ENUM('TANK', 'JOB');
ALTER TABLE operations ALTER COLUMN target_resource_type TYPE resources_enum USING target_resource_type::text::resources_enum;
DROP TYPE resources_enum_old;
