everything works!

This commit is contained in:
dimitar committed 2024-11-02 09:26:40 +01:00
1 parent 01017bb36e
commit a32992b17b
19 files changed
+1554 -727

No files matched your search

@@ -0,0 +1,44 @@
/*
Warnings:
- You are about to drop the column `content` on the `Document` table. All the data in the column will be lost.
- You are about to drop the column `sharedWithId` on the `Document` table. All the data in the column will be lost.
- Added the required column `uploadedById` to the `Document` table without a default value. This is not possible if the table is not empty.
- Added the required column `documentId` to the `Notification` table without a default value. This is not possible if the table is not empty.
*/
-- DropForeignKey
ALTER TABLE "Document" DROP CONSTRAINT "Document_sharedWithId_fkey";
-- AlterTable
ALTER TABLE "Document" DROP COLUMN "content",
DROP COLUMN "sharedWithId",
ADD COLUMN "uploadedById" INTEGER NOT NULL,
ALTER COLUMN "status" DROP DEFAULT;
-- AlterTable
ALTER TABLE "Notification" ADD COLUMN "documentId" INTEGER NOT NULL;
-- CreateTable
CREATE TABLE "_SharedDocuments" (
"A" INTEGER NOT NULL,
"B" INTEGER NOT NULL
);
-- CreateIndex
CREATE UNIQUE INDEX "_SharedDocuments_AB_unique" ON "_SharedDocuments"("A", "B");
-- CreateIndex
CREATE INDEX "_SharedDocuments_B_index" ON "_SharedDocuments"("B");
-- AddForeignKey
ALTER TABLE "Document" ADD CONSTRAINT "Document_uploadedById_fkey" FOREIGN KEY ("uploadedById") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Notification" ADD CONSTRAINT "Notification_documentId_fkey" FOREIGN KEY ("documentId") REFERENCES "Document"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "_SharedDocuments" ADD CONSTRAINT "_SharedDocuments_A_fkey" FOREIGN KEY ("A") REFERENCES "Document"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "_SharedDocuments" ADD CONSTRAINT "_SharedDocuments_B_fkey" FOREIGN KEY ("B") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;