Files
portal/prisma/migrations/20260113142808_add_user_roles/migration.sql
T
NeilClack ef855ae9a9 Init Project
This is a pretty far-developed starting point. Authentication has been intialized with Better-Auth, a database has been setup with Prisma, and Google + email logins have been enabled, as well as Google + Email registration.
2026-01-13 16:21:12 -06:00

14 lines
374 B
SQL

-- AlterTable
ALTER TABLE "user" ADD COLUMN "roleId" INTEGER;
-- CreateTable
CREATE TABLE "UserRole" (
"id" SERIAL NOT NULL,
"name" TEXT NOT NULL,
CONSTRAINT "UserRole_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "user" ADD CONSTRAINT "user_roleId_fkey" FOREIGN KEY ("roleId") REFERENCES "UserRole"("id") ON DELETE SET NULL ON UPDATE CASCADE;