From 481ae2f9c017a25aa6c2029c1c130fe7d1a0b407 Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Tue, 12 Sep 2023 16:19:15 +0200 Subject: [PATCH] fix not-null constraint removal in migration 24 --- internal/db/migrations.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/db/migrations.go b/internal/db/migrations.go index f675ee2b5..1859adfb1 100644 --- a/internal/db/migrations.go +++ b/internal/db/migrations.go @@ -168,6 +168,8 @@ var sqlMigrations = map[string]string{ DROP COLUMN scraped_at; ALTER TABLE cluster_resources ALTER COLUMN capacitor_id DROP DEFAULT; + ALTER TABLE cluster_resources + ALTER COLUMN capacitor_id SET NOT NULL; `, "024_move_capacity_scrape_timestamps.down.sql": ` ALTER TABLE cluster_capacitors @@ -176,6 +178,8 @@ var sqlMigrations = map[string]string{ ADD COLUMN scraped_at TIMESTAMP NOT NULL DEFAULT NOW(); ALTER TABLE cluster_resources ALTER COLUMN capacitor_id DROP NOT NULL; + ALTER TABLE cluster_resources + ALTER COLUMN capacitor_id SET DEFAULT NULL; `, "025_capacity_scan_rework.up.sql": ` ALTER TABLE cluster_capacitors