From 8ff811ed28a55e68f993602971872f59e2324a09 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 24 Apr 2022 17:27:00 +0200 Subject: [PATCH] Release/1.141.1 (#863) --- CHANGELOG.md | 10 +++++++ package.json | 2 +- .../migration.sql | 28 +++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 prisma/migrations/20220424152051_added_tags_to_order/migration.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index aa685b4f7..494fb2233 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 1.141.1 - 24.04.2022 + +### Added + +- Added the database migration + +### Todo + +- Apply data migration (`yarn database:migrate`) + ## 1.141.0 - 24.04.2022 ### Added diff --git a/package.json b/package.json index 7b6b45c13..2b7fba001 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ghostfolio", - "version": "1.141.0", + "version": "1.141.1", "homepage": "https://ghostfol.io", "license": "AGPL-3.0", "scripts": { diff --git a/prisma/migrations/20220424152051_added_tags_to_order/migration.sql b/prisma/migrations/20220424152051_added_tags_to_order/migration.sql new file mode 100644 index 000000000..2df084652 --- /dev/null +++ b/prisma/migrations/20220424152051_added_tags_to_order/migration.sql @@ -0,0 +1,28 @@ +-- CreateTable +CREATE TABLE "Tag" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + + CONSTRAINT "Tag_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "_OrderToTag" ( + "A" TEXT NOT NULL, + "B" TEXT NOT NULL +); + +-- CreateIndex +CREATE UNIQUE INDEX "Tag_name_key" ON "Tag"("name"); + +-- CreateIndex +CREATE UNIQUE INDEX "_OrderToTag_AB_unique" ON "_OrderToTag"("A", "B"); + +-- CreateIndex +CREATE INDEX "_OrderToTag_B_index" ON "_OrderToTag"("B"); + +-- AddForeignKey +ALTER TABLE "_OrderToTag" ADD FOREIGN KEY ("A") REFERENCES "Order"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "_OrderToTag" ADD FOREIGN KEY ("B") REFERENCES "Tag"("id") ON DELETE CASCADE ON UPDATE CASCADE;