mirror of
https://github.com/mosh-hamedani/helpdesk.git
synced 2026-05-21 11:58:19 +02:00
8 lines
272 B
SQL
8 lines
272 B
SQL
-- CreateEnum
|
|
CREATE TYPE "Role" AS ENUM ('admin', 'agent');
|
|
|
|
-- AlterTable (cast existing text values to the new enum)
|
|
ALTER TABLE "user" ALTER COLUMN "role" DROP DEFAULT,
|
|
ALTER COLUMN "role" TYPE "Role" USING "role"::"Role",
|
|
ALTER COLUMN "role" SET DEFAULT 'agent';
|