I have column "scopes" which is jsonb type and contains array of strings ["admin","agent"]. I want to transform it to enum array type. I am using postresql.
This is my migration.
CREATE TYPE enum_scopes AS ENUM ( 'owner', 'admin', 'agent', 'user' );
ALTER TABLE public.users ALTER COLUMN scopes TYPE enum_scopes[] USING scopes::text::enum_scopes[];
After i run migration i get this: MigrationError: malformed array literal: "["admin"]"