initial commit

This commit is contained in:
DecDuck
2024-09-28 19:12:11 +10:00
commit e1a789fa36
28 changed files with 5669 additions and 0 deletions

View File

@ -0,0 +1,25 @@
-- CreateEnum
CREATE TYPE "AuthMec" AS ENUM ('Simple');
-- CreateTable
CREATE TABLE "User" (
"id" TEXT NOT NULL,
"username" TEXT NOT NULL,
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "LinkedAuthMec" (
"userId" TEXT NOT NULL,
"mec" "AuthMec" NOT NULL,
"credentials" TEXT[],
CONSTRAINT "LinkedAuthMec_pkey" PRIMARY KEY ("userId","mec")
);
-- CreateIndex
CREATE UNIQUE INDEX "User_username_key" ON "User"("username");
-- AddForeignKey
ALTER TABLE "LinkedAuthMec" ADD CONSTRAINT "LinkedAuthMec_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@ -0,0 +1,9 @@
/*
Warnings:
- Changed the type of `credentials` on the `LinkedAuthMec` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
*/
-- AlterTable
ALTER TABLE "LinkedAuthMec" DROP COLUMN "credentials",
ADD COLUMN "credentials" JSONB NOT NULL;

View File

@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "postgresql"