From 3dc51829d3c589a08515c3dc31a67b958af59f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uro=C5=A1=20Marolt?= Date: Fri, 2 Oct 2026 10:21:35 +0200 Subject: [PATCH 1/3] feat: add octolensKeywordMappings migration (CM-1833) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Uroš Marolt --- .../V1790929179__octolens-keyword-mappings.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 backend/src/database/migrations/V1790929179__octolens-keyword-mappings.sql diff --git a/backend/src/database/migrations/V1790929179__octolens-keyword-mappings.sql b/backend/src/database/migrations/V1790929179__octolens-keyword-mappings.sql new file mode 100644 index 0000000000..04afd412b6 --- /dev/null +++ b/backend/src/database/migrations/V1790929179__octolens-keyword-mappings.sql @@ -0,0 +1,10 @@ +CREATE TABLE IF NOT EXISTS integration."octolensKeywordMappings" ( + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), + "integrationId" UUID NOT NULL REFERENCES public.integrations(id), + "segmentId" UUID NOT NULL REFERENCES public.segments(id), + "keywordId" INTEGER NOT NULL, + keyword TEXT NOT NULL, + "createdAt" TIMESTAMPTZ NOT NULL DEFAULT now(), + "updatedAt" TIMESTAMPTZ NOT NULL DEFAULT now(), + UNIQUE ("integrationId", "keywordId") +); From b4d335c4648bd1dbcdf4ec6737f39955ddd8f5d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uro=C5=A1=20Marolt?= Date: Fri, 2 Oct 2026 19:53:33 +0200 Subject: [PATCH 2/3] fix: cascade delete octolensKeywordMappings on integration removal (CM-1833) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Uroš Marolt --- .../migrations/V1790929179__octolens-keyword-mappings.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/database/migrations/V1790929179__octolens-keyword-mappings.sql b/backend/src/database/migrations/V1790929179__octolens-keyword-mappings.sql index 04afd412b6..8afbfe7ca1 100644 --- a/backend/src/database/migrations/V1790929179__octolens-keyword-mappings.sql +++ b/backend/src/database/migrations/V1790929179__octolens-keyword-mappings.sql @@ -1,6 +1,6 @@ CREATE TABLE IF NOT EXISTS integration."octolensKeywordMappings" ( id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - "integrationId" UUID NOT NULL REFERENCES public.integrations(id), + "integrationId" UUID NOT NULL REFERENCES public.integrations(id) ON DELETE CASCADE, "segmentId" UUID NOT NULL REFERENCES public.segments(id), "keywordId" INTEGER NOT NULL, keyword TEXT NOT NULL, From 352ceb09d9bab30123739092c4c466b2a5533863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uro=C5=A1=20Marolt?= Date: Fri, 2 Oct 2026 19:58:01 +0200 Subject: [PATCH 3/3] fix: bump octolensKeywordMappings migration to a fresh epoch (CM-1833) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Uroš Marolt --- ...rd-mappings.sql => V1790963849__octolens-keyword-mappings.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename backend/src/database/migrations/{V1790929179__octolens-keyword-mappings.sql => V1790963849__octolens-keyword-mappings.sql} (100%) diff --git a/backend/src/database/migrations/V1790929179__octolens-keyword-mappings.sql b/backend/src/database/migrations/V1790963849__octolens-keyword-mappings.sql similarity index 100% rename from backend/src/database/migrations/V1790929179__octolens-keyword-mappings.sql rename to backend/src/database/migrations/V1790963849__octolens-keyword-mappings.sql