-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Estimate): change relation between
Goal
and Estimate
fix(GoalEstimate): `connectOrCreate` instead of `create` new record of `estimate` fix(EstimateComboBox): correct localized value feat(GoalHistory): recording changes of estimate
- Loading branch information
Showing
10 changed files
with
276 additions
and
67 deletions.
There are no files selected for viewing
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,34 @@ | ||
-- DropForeignKey | ||
ALTER TABLE "Estimate" DROP CONSTRAINT "Estimate_goalId_fkey"; | ||
|
||
-- DropIndex | ||
DROP INDEX "Estimate_goalId_idx"; | ||
|
||
-- CreateTable | ||
CREATE TABLE "EstimateToGoal" ( | ||
"id" SERIAL NOT NULL, | ||
"goalId" TEXT NOT NULL, | ||
"estimateId" INTEGER NOT NULL, | ||
"createadAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "EstimateToGoal_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "EstimateToGoal_goalId_idx" ON "EstimateToGoal"("goalId"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "EstimateToGoal_estimateId_idx" ON "EstimateToGoal"("estimateId"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "Estimate_date_idx" ON "Estimate"("date"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "EstimateToGoal" ADD CONSTRAINT "EstimateToGoal_goalId_fkey" FOREIGN KEY ("goalId") REFERENCES "Goal"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "EstimateToGoal" ADD CONSTRAINT "EstimateToGoal_estimateId_fkey" FOREIGN KEY ("estimateId") REFERENCES "Estimate"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- Fill join table | ||
INSERT INTO "EstimateToGoal" ("goalId", "estimateId", "createdAt") | ||
SELECT "goalId", "id", "createdAt" from "Estimate" |
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
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.