added migrations folder to git-project to sync resolved migrations

This commit is contained in:
PxlLoewe
2025-06-27 18:44:18 -07:00
parent e3988c24e3
commit 8071f4b764
57 changed files with 1012 additions and 1 deletions

View File

@@ -0,0 +1,55 @@
/*
Warnings:
- You are about to drop the `ConnectedDispatch` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `ReportMessage` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "ConnectedDispatch" DROP CONSTRAINT "ConnectedDispatch_userId_fkey";
-- DropForeignKey
ALTER TABLE "ReportMessage" DROP CONSTRAINT "ReportMessage_reportedId_fkey";
-- DropForeignKey
ALTER TABLE "ReportMessage" DROP CONSTRAINT "ReportMessage_senderId_fkey";
-- DropTable
DROP TABLE "ConnectedDispatch";
-- DropTable
DROP TABLE "ReportMessage";
-- CreateTable
CREATE TABLE "ConnectedDispatcher" (
"id" SERIAL NOT NULL,
"userId" TEXT NOT NULL,
"publicUser" JSONB NOT NULL,
"lastHeartbeat" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"loginTime" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"esimatedLogoutTime" TIMESTAMP(3),
"logoutTime" TIMESTAMP(3),
CONSTRAINT "ConnectedDispatcher_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Report" (
"id" SERIAL NOT NULL,
"text" TEXT NOT NULL,
"senderId" TEXT NOT NULL,
"reportedId" TEXT NOT NULL,
"timestamp" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"reviewed" BOOLEAN NOT NULL DEFAULT false,
CONSTRAINT "Report_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "ConnectedDispatcher" ADD CONSTRAINT "ConnectedDispatcher_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Report" ADD CONSTRAINT "Report_senderId_fkey" FOREIGN KEY ("senderId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Report" ADD CONSTRAINT "Report_reportedId_fkey" FOREIGN KEY ("reportedId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;