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.
14 lines
374 B
SQL
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;
|