Testing things out

This commit is contained in:
nmcnew
2024-09-24 23:52:40 -06:00
parent 7a1700ca71
commit 187b3413b8
17 changed files with 1006 additions and 772 deletions

View File

@@ -0,0 +1,24 @@
-- CreateTable
CREATE TABLE "UserAuth" (
"id" SERIAL NOT NULL,
"userId" TEXT NOT NULL,
"providerId" INTEGER NOT NULL,
"value" TEXT NOT NULL,
CONSTRAINT "UserAuth_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "AuthProvider" (
"id" SERIAL NOT NULL,
"name" TEXT NOT NULL,
"providerValue" TEXT NOT NULL,
CONSTRAINT "AuthProvider_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "UserAuth" ADD CONSTRAINT "UserAuth_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "UserAuth" ADD CONSTRAINT "UserAuth_providerId_fkey" FOREIGN KEY ("providerId") REFERENCES "AuthProvider"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@@ -0,0 +1,8 @@
/*
Warnings:
- Added the required column `email` to the `User` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "User" ADD COLUMN "email" TEXT NOT NULL;

View File

@@ -0,0 +1,8 @@
/*
Warnings:
- A unique constraint covering the columns `[providerId,value]` on the table `UserAuth` will be added. If there are existing duplicate values, this will fail.
*/
-- CreateIndex
CREATE UNIQUE INDEX "UserAuth_providerId_value_key" ON "UserAuth"("providerId", "value");

View File

@@ -0,0 +1,8 @@
/*
Warnings:
- A unique constraint covering the columns `[providerValue]` on the table `AuthProvider` will be added. If there are existing duplicate values, this will fail.
*/
-- CreateIndex
CREATE UNIQUE INDEX "AuthProvider_providerValue_key" ON "AuthProvider"("providerValue");