START TRANSACTION;

ALTER TYPE resource_type
    RENAME TO _resource_type;

CREATE TYPE resource_type AS ENUM ('ENUMERABLE', 'MEMORY', 'MONEY', 'POWER', 'STORAGE', 'TRAFFIC', 'BINARY_TRAFFIC', 'PROCESSOR', 'RUBLE_BUDGET', 'MESSAGE_TRAFFIC', 'STORAGE_BASE', 'MEMORY_BASE');

ALTER TABLE resource
    ALTER COLUMN resource_type TYPE resource_type USING resource_type :: text :: resource_type;

ALTER TABLE base_resource_type
    ALTER COLUMN resource_type TYPE resource_type USING resource_type :: text :: resource_type;

DROP TYPE _resource_type;

COMMIT;
