HUB - Admin und Einstellungen Seiten hinzugefügt, Prisma Client Integration und Migrationen aktualisiert

This commit is contained in:
PxlLoewe
2025-02-16 01:09:33 +01:00
parent a4bdc94aa1
commit 62ae71d6b6
28 changed files with 862 additions and 234 deletions

View File

@@ -0,0 +1,19 @@
-- CreateTable
CREATE TABLE "discord_accounts" (
"id" SERIAL NOT NULL,
"user_id" TEXT NOT NULL,
"discord_id" TEXT NOT NULL,
"access_token" TEXT NOT NULL,
"refresh_token" TEXT NOT NULL,
"token_type" TEXT NOT NULL,
"scope" TEXT NOT NULL,
"guild_id" TEXT NOT NULL,
"guild_name" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "discord_accounts_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "discord_accounts" ADD CONSTRAINT "discord_accounts_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@@ -0,0 +1,13 @@
/*
Warnings:
- You are about to drop the column `guild_id` on the `discord_accounts` table. All the data in the column will be lost.
- You are about to drop the column `guild_name` on the `discord_accounts` table. All the data in the column will be lost.
- You are about to drop the column `scope` on the `discord_accounts` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "discord_accounts" DROP COLUMN "guild_id",
DROP COLUMN "guild_name",
DROP COLUMN "scope",
ADD COLUMN "email" TEXT;

View File

@@ -0,0 +1,14 @@
/*
Warnings:
- Added the required column `global_name` to the `discord_accounts` table without a default value. This is not possible if the table is not empty.
- Added the required column `username` to the `discord_accounts` table without a default value. This is not possible if the table is not empty.
- Made the column `email` on table `discord_accounts` required. This step will fail if there are existing NULL values in that column.
*/
-- AlterTable
ALTER TABLE "discord_accounts" ADD COLUMN "avatar" TEXT,
ADD COLUMN "global_name" TEXT NOT NULL,
ADD COLUMN "username" TEXT NOT NULL,
ADD COLUMN "verified" BOOLEAN NOT NULL DEFAULT false,
ALTER COLUMN "email" SET NOT NULL;

View File

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

View File

@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "users" ADD COLUMN "vatsim_cid" INTEGER;

View File

@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "users" ALTER COLUMN "vatsim_cid" SET DATA TYPE TEXT;

View File

@@ -0,0 +1,9 @@
/*
Warnings:
- The `vatsim_cid` column on the `users` table would be dropped and recreated. This will lead to data loss if there is data in the column.
*/
-- AlterTable
ALTER TABLE "users" DROP COLUMN "vatsim_cid",
ADD COLUMN "vatsim_cid" INTEGER;