DEV Community

Beaver Bridge
Beaver Bridge

Posted on

Postgres에서 enum 만들기

DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'UserRole') THEN
  CREATE TYPE "UserRole" AS ENUM ('USER', 'ADMIN', 'TEMP');
END IF;
END$$;
Enter fullscreen mode Exit fullscreen mode

Top comments (0)