-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: modified schema to support contributing teams
- maintaining team
- Loading branch information
1 parent
2feb310
commit 1d50379
Showing
18 changed files
with
607 additions
and
528 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
apps/web-api/prisma/migrations/20231102113053_member_experience/migration.sql
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
...eb-api/prisma/migrations/20231103093835_member_experience_end_date_optional/migration.sql
This file was deleted.
Oops, something went wrong.
62 changes: 62 additions & 0 deletions
62
apps/web-api/prisma/migrations/20231106095859_project_contributions/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
Warnings: | ||
- Added the required column `type` to the `Faq` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `maintainingTeamUid` to the `Project` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "Project" DROP CONSTRAINT "Project_teamUid_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Faq" ADD COLUMN "type" TEXT NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Project" DROP COLUMN "teamUid", | ||
ADD COLUMN "isDeleted" BOOLEAN NOT NULL DEFAULT false, | ||
ADD COLUMN "maintainingTeamUid" TEXT NOT NULL; | ||
|
||
-- CreateTable | ||
CREATE TABLE "ProjectContribution" ( | ||
"id" SERIAL NOT NULL, | ||
"uid" TEXT NOT NULL, | ||
"role" TEXT, | ||
"description" TEXT, | ||
"currentProject" BOOLEAN NOT NULL DEFAULT false, | ||
"startDate" TIMESTAMP(3) NOT NULL, | ||
"endDate" TIMESTAMP(3), | ||
"memberUid" TEXT NOT NULL, | ||
"projectUid" TEXT NOT NULL, | ||
|
||
CONSTRAINT "ProjectContribution_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "_contributingTeams" ( | ||
"A" INTEGER NOT NULL, | ||
"B" INTEGER NOT NULL | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "ProjectContribution_uid_key" ON "ProjectContribution"("uid"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "_contributingTeams_AB_unique" ON "_contributingTeams"("A", "B"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "_contributingTeams_B_index" ON "_contributingTeams"("B"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "ProjectContribution" ADD CONSTRAINT "ProjectContribution_memberUid_fkey" FOREIGN KEY ("memberUid") REFERENCES "Member"("uid") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "ProjectContribution" ADD CONSTRAINT "ProjectContribution_projectUid_fkey" FOREIGN KEY ("projectUid") REFERENCES "Project"("uid") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Project" ADD CONSTRAINT "Project_maintainingTeamUid_fkey" FOREIGN KEY ("maintainingTeamUid") REFERENCES "Team"("uid") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_contributingTeams" ADD CONSTRAINT "_contributingTeams_A_fkey" FOREIGN KEY ("A") REFERENCES "Project"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_contributingTeams" ADD CONSTRAINT "_contributingTeams_B_fkey" FOREIGN KEY ("B") REFERENCES "Team"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.