New controllers and services; Auth
This commit is contained in:
parent
2fc0f9c404
commit
d17f37749d
35 changed files with 1040 additions and 164 deletions
50
prisma/migrations/20251224125500_relations/migration.sql
Normal file
50
prisma/migrations/20251224125500_relations/migration.sql
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `communityId` on the `User` table. All the data in the column will be lost.
|
||||
- Added the required column `ownerId` to the `Community` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `creatorId` to the `Invite` table without a default value. This is not possible if the table is not empty.
|
||||
- Made the column `communityId` on table `Invite` required. This step will fail if there are existing NULL values in that column.
|
||||
|
||||
*/
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "Invite" DROP CONSTRAINT "Invite_communityId_fkey";
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "User" DROP CONSTRAINT "User_communityId_fkey";
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Community" ADD COLUMN "ownerId" TEXT NOT NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Invite" ADD COLUMN "creatorId" TEXT NOT NULL,
|
||||
ALTER COLUMN "communityId" SET NOT NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "User" DROP COLUMN "communityId";
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "_MembersCommunitiesToUsers" (
|
||||
"A" TEXT NOT NULL,
|
||||
"B" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "_MembersCommunitiesToUsers_AB_pkey" PRIMARY KEY ("A","B")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "_MembersCommunitiesToUsers_B_index" ON "_MembersCommunitiesToUsers"("B");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Community" ADD CONSTRAINT "Community_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Invite" ADD CONSTRAINT "Invite_communityId_fkey" FOREIGN KEY ("communityId") REFERENCES "Community"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Invite" ADD CONSTRAINT "Invite_creatorId_fkey" FOREIGN KEY ("creatorId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "_MembersCommunitiesToUsers" ADD CONSTRAINT "_MembersCommunitiesToUsers_A_fkey" FOREIGN KEY ("A") REFERENCES "Community"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "_MembersCommunitiesToUsers" ADD CONSTRAINT "_MembersCommunitiesToUsers_B_fkey" FOREIGN KEY ("B") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
Loading…
Add table
Add a link
Reference in a new issue