removed migrations + env

This commit is contained in:
PxlLoewe
2025-02-23 21:22:31 +01:00
parent 30af30bd1d
commit 66bddf5d17
22 changed files with 13 additions and 378 deletions

3
.gitignore vendored
View File

@@ -5,8 +5,9 @@ node_modules
.pnp
.pnp.js
migrations
# Local env files
.env
.env.local
.env.development.local
.env.test.local

15
package-lock.json generated
View File

@@ -1160,19 +1160,24 @@
}
},
"node_modules/@prisma/client": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.2.1.tgz",
"integrity": "sha512-msKY2iRLISN8t5X0Tj7hU0UWet1u0KuxSPHWuf3IRkB4J95mCvGpyQBfQ6ufcmvKNOMQSq90O2iUmJEN2e5fiA==",
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.4.0.tgz",
"integrity": "sha512-48tLb+VL7iuuqJXjD4Xbqa622fuh8UtqmjTf39AKrQjlTUdNaMc9sC/c49eXQkcnrAdh9FoS1qVupmZSYiZ9TQ==",
"hasInstallScript": true,
"license": "Apache-2.0",
"engines": {
"node": ">=18.18"
},
"peerDependencies": {
"prisma": "*"
"prisma": "*",
"typescript": ">=5.1.0"
},
"peerDependenciesMeta": {
"prisma": {
"optional": true
},
"typescript": {
"optional": true
}
}
},
@@ -9417,7 +9422,7 @@
"version": "0.0.0",
"license": "ISC",
"dependencies": {
"@prisma/client": "^6.2.1",
"@prisma/client": "^6.4.0",
"zod-prisma-types": "^3.2.4"
}
},

View File

@@ -1 +0,0 @@
DATABASE_URL=postgresql://persistant-data:persistant-data-pw@localhost:5432/var

View File

@@ -16,7 +16,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@prisma/client": "^6.2.1",
"@prisma/client": "^6.4.0",
"zod-prisma-types": "^3.2.4"
}
}

View File

@@ -1,78 +0,0 @@
-- CreateTable
CREATE TABLE "accounts" (
"id" SERIAL NOT NULL,
"compound_id" TEXT NOT NULL,
"user_id" INTEGER NOT NULL,
"provider_type" TEXT NOT NULL,
"provider_id" TEXT NOT NULL,
"provider_account_id" TEXT NOT NULL,
"refresh_token" TEXT,
"access_token" TEXT,
"access_token_expires" TIMESTAMP(3),
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "accounts_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "sessions" (
"id" SERIAL NOT NULL,
"user_id" INTEGER NOT NULL,
"expires" TIMESTAMP(3) NOT NULL,
"session_token" TEXT NOT NULL,
"access_token" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "sessions_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "users" (
"id" SERIAL NOT NULL,
"name" TEXT,
"email" TEXT,
"email_verified" TIMESTAMP(3),
"image" TEXT,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "users_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "verification_requests" (
"id" SERIAL NOT NULL,
"identifier" TEXT NOT NULL,
"token" TEXT NOT NULL,
"expires" TIMESTAMP(3) NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "verification_requests_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "accounts_compound_id_key" ON "accounts"("compound_id");
-- CreateIndex
CREATE INDEX "providerAccountId" ON "accounts"("provider_account_id");
-- CreateIndex
CREATE INDEX "providerId" ON "accounts"("provider_id");
-- CreateIndex
CREATE INDEX "userId" ON "accounts"("user_id");
-- CreateIndex
CREATE UNIQUE INDEX "sessions_session_token_key" ON "sessions"("session_token");
-- CreateIndex
CREATE UNIQUE INDEX "sessions_access_token_key" ON "sessions"("access_token");
-- CreateIndex
CREATE UNIQUE INDEX "users_email_key" ON "users"("email");
-- CreateIndex
CREATE UNIQUE INDEX "verification_requests_token_key" ON "verification_requests"("token");

View File

@@ -1,20 +0,0 @@
/*
Warnings:
- You are about to drop the `accounts` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `sessions` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `users` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `verification_requests` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
DROP TABLE "accounts";
-- DropTable
DROP TABLE "sessions";
-- DropTable
DROP TABLE "users";
-- DropTable
DROP TABLE "verification_requests";

View File

@@ -1,80 +0,0 @@
-- CreateTable
CREATE TABLE "sessions" (
"id" SERIAL NOT NULL,
"user_id" INTEGER NOT NULL,
"expires" TIMESTAMP(3) NOT NULL,
"session_token" TEXT NOT NULL,
"access_token" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "sessions_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "users" (
"id" TEXT NOT NULL,
"firstname" TEXT NOT NULL,
"lastname" TEXT NOT NULL,
"email" TEXT NOT NULL,
"password" TEXT NOT NULL,
"email_verified" TIMESTAMP(3),
"image" TEXT,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "users_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "verification_requests" (
"id" SERIAL NOT NULL,
"identifier" TEXT NOT NULL,
"token" TEXT NOT NULL,
"expires" TIMESTAMP(3) NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "verification_requests_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "accounts" (
"id" SERIAL NOT NULL,
"compound_id" TEXT NOT NULL,
"user_id" INTEGER NOT NULL,
"provider_type" TEXT NOT NULL,
"provider_id" TEXT NOT NULL,
"provider_account_id" TEXT NOT NULL,
"refresh_token" TEXT,
"access_token" TEXT,
"access_token_expires" TIMESTAMP(3),
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "accounts_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "sessions_session_token_key" ON "sessions"("session_token");
-- CreateIndex
CREATE UNIQUE INDEX "sessions_access_token_key" ON "sessions"("access_token");
-- CreateIndex
CREATE UNIQUE INDEX "users_email_key" ON "users"("email");
-- CreateIndex
CREATE UNIQUE INDEX "verification_requests_token_key" ON "verification_requests"("token");
-- CreateIndex
CREATE UNIQUE INDEX "accounts_compound_id_key" ON "accounts"("compound_id");
-- CreateIndex
CREATE INDEX "providerAccountId" ON "accounts"("provider_account_id");
-- CreateIndex
CREATE INDEX "providerId" ON "accounts"("provider_id");
-- CreateIndex
CREATE INDEX "userId" ON "accounts"("user_id");

View File

@@ -1,14 +0,0 @@
-- CreateTable
CREATE TABLE "oauth_tokens" (
"id" SERIAL NOT NULL,
"user_id" INTEGER NOT NULL,
"client_id" TEXT NOT NULL,
"access_token" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "oauth_tokens_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "oauth_tokens_access_token_key" ON "oauth_tokens"("access_token");

View File

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

View File

@@ -1,2 +0,0 @@
-- AddForeignKey
ALTER TABLE "oauth_tokens" ADD CONSTRAINT "oauth_tokens_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@@ -1,19 +0,0 @@
-- 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

@@ -1,13 +0,0 @@
/*
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

@@ -1,14 +0,0 @@
/*
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

@@ -1,8 +0,0 @@
/*
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

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

View File

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

View File

@@ -1,9 +0,0 @@
/*
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;

View File

@@ -1,12 +0,0 @@
/*
Warnings:
- A unique constraint covering the columns `[publicId]` on the table `users` will be added. If there are existing duplicate values, this will fail.
- Added the required column `publicId` to the `users` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "users" ADD COLUMN "publicId" TEXT NOT NULL;
-- CreateIndex
CREATE UNIQUE INDEX "users_publicId_key" ON "users"("publicId");

View File

@@ -1,32 +0,0 @@
-- CreateEnum
CREATE TYPE "BosUse" AS ENUM ('PRIMARY', 'SECONDARY', 'DUAL_USE');
-- CreateEnum
CREATE TYPE "Country" AS ENUM ('DE', 'AT', 'CH');
-- CreateTable
CREATE TABLE "Station" (
"id" SERIAL NOT NULL,
"bosUse" "BosUse" NOT NULL,
"bosCallsign" TEXT NOT NULL,
"bosCallsignShort" TEXT NOT NULL,
"bosRadioArea" TEXT NOT NULL,
"country" "Country" NOT NULL,
"operator" TEXT NOT NULL,
"aircraft" TEXT NOT NULL,
"aircraftRegistration" TEXT NOT NULL,
"aircraftSpeed" INTEGER NOT NULL,
"hasWinch" BOOLEAN NOT NULL,
"is24h" BOOLEAN NOT NULL,
"hasNvg" BOOLEAN NOT NULL,
"locationState" TEXT NOT NULL,
"locationStateShort" TEXT NOT NULL,
"hasRope" BOOLEAN NOT NULL,
"fir" TEXT NOT NULL,
"latitude" DOUBLE PRECISION NOT NULL,
"longitude" DOUBLE PRECISION NOT NULL,
"atcCallsign" TEXT NOT NULL,
"hideRangeRings" BOOLEAN NOT NULL,
CONSTRAINT "Station_pkey" PRIMARY KEY ("id")
);

View File

@@ -1,46 +0,0 @@
-- CreateEnum
CREATE TYPE "PARTICIPANT_STATUS" AS ENUM ('WAITING_FOR_ENTRY_TEST', 'ENTRY_TEST_FAILED', 'READY_FOR_EVENT', 'PARTICIPATED', 'WAITING_FOR_EXIT_TEST', 'EXIT_TEST_FAILED', 'WAITING_FOR_PERMISISONS', 'FINISHED', 'WAVED');
-- CreateTable
CREATE TABLE "Participant" (
"id" SERIAL NOT NULL,
"user_id" TEXT NOT NULL,
"status" "PARTICIPANT_STATUS" NOT NULL,
"selectedForParticipatioon" BOOLEAN NOT NULL DEFAULT false,
"statusLog" JSONB[],
"eventId" INTEGER,
CONSTRAINT "Participant_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Event" (
"id" SERIAL NOT NULL,
"name" TEXT NOT NULL,
"description" TEXT,
"discordRoleId" TEXT,
"hasPresenceEvents" BOOLEAN NOT NULL DEFAULT false,
"maxParticipants" INTEGER NOT NULL,
"starterMoodleCourseId" INTEGER,
"finisherMoodleCourseId" INTEGER,
"finished" BOOLEAN NOT NULL DEFAULT false,
"finishedBadges" TEXT[],
"requiredBadges" TEXT[],
"finishedPermissions" TEXT[],
"hidden" BOOLEAN NOT NULL DEFAULT true,
CONSTRAINT "Event_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "File" (
"id" SERIAL NOT NULL,
CONSTRAINT "File_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "Participant" ADD CONSTRAINT "Participant_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Participant" ADD CONSTRAINT "Participant_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES "Event"("id") ON DELETE SET NULL ON UPDATE CASCADE;

View File

@@ -1,14 +0,0 @@
/*
Warnings:
- You are about to drop the column `finished` on the `Event` table. All the data in the column will be lost.
- Made the column `description` on table `Event` required. This step will fail if there are existing NULL values in that column.
*/
-- AlterTable
ALTER TABLE "Event" DROP COLUMN "finished",
ALTER COLUMN "description" SET NOT NULL,
ALTER COLUMN "maxParticipants" DROP NOT NULL,
ALTER COLUMN "finishedBadges" SET DEFAULT ARRAY[]::TEXT[],
ALTER COLUMN "requiredBadges" SET DEFAULT ARRAY[]::TEXT[],
ALTER COLUMN "finishedPermissions" SET DEFAULT ARRAY[]::TEXT[];

View File

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