-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 🎉 feat: unit qualifications * 🎉 feat: add types * fix: add id to type * 🔨 chore: add more types * 🎉 feat: able to create cad values * 🔨 chore: import correct func. * 🎉 feat: able to view qualifications * 🎉 feat: able to add qualifications to units * 🔨 chore: update state * 🔨 chore: fix tests * 🎉 feat: able to delete qualifications * 🎉 feat: able to suspend qualifications * 🔨 chore: `department` -> `departments` * 🔨 chore: more improvements * 🎉 add assignedAt to table * 🎉 feat: add image support * 🔨 chore: bug fixes * 🔨 chore: remove unused code * 🔨 chore: remove todo comment * 1 migration
- Loading branch information
Showing
33 changed files
with
809 additions
and
35 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
packages/api/prisma/migrations/20220425183208_/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,55 @@ | ||
-- AlterEnum | ||
ALTER TYPE "ValueType" ADD VALUE 'QUALIFICATION'; | ||
|
||
-- CreateTable | ||
CREATE TABLE "UnitQualification" ( | ||
"id" TEXT NOT NULL, | ||
"qualificationId" TEXT NOT NULL, | ||
"suspendedAt" TIMESTAMP(3), | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"officerId" TEXT, | ||
"emsFdDeputyId" TEXT, | ||
|
||
CONSTRAINT "UnitQualification_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "QualificationValue" ( | ||
"id" TEXT NOT NULL, | ||
"imageId" TEXT, | ||
"valueId" TEXT NOT NULL, | ||
"departmentId" TEXT, | ||
|
||
CONSTRAINT "QualificationValue_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "_DepartmentValueToQualificationValue" ( | ||
"A" TEXT NOT NULL, | ||
"B" TEXT NOT NULL | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "_DepartmentValueToQualificationValue_AB_unique" ON "_DepartmentValueToQualificationValue"("A", "B"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "_DepartmentValueToQualificationValue_B_index" ON "_DepartmentValueToQualificationValue"("B"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "UnitQualification" ADD CONSTRAINT "UnitQualification_officerId_fkey" FOREIGN KEY ("officerId") REFERENCES "Officer"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "UnitQualification" ADD CONSTRAINT "UnitQualification_qualificationId_fkey" FOREIGN KEY ("qualificationId") REFERENCES "QualificationValue"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "UnitQualification" ADD CONSTRAINT "UnitQualification_emsFdDeputyId_fkey" FOREIGN KEY ("emsFdDeputyId") REFERENCES "EmsFdDeputy"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "QualificationValue" ADD CONSTRAINT "QualificationValue_valueId_fkey" FOREIGN KEY ("valueId") REFERENCES "Value"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_DepartmentValueToQualificationValue" ADD FOREIGN KEY ("A") REFERENCES "DepartmentValue"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_DepartmentValueToQualificationValue" ADD FOREIGN KEY ("B") REFERENCES "QualificationValue"("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
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
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.