From d15ac397deff2b5761c968a759090bb985e2b5b2 Mon Sep 17 00:00:00 2001 From: alf-cactus Date: Wed, 27 Nov 2024 14:07:50 +0100 Subject: [PATCH] 8.5.2 update with stm_color --- roles/database/files/upgrade/8.5.2.sql | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/roles/database/files/upgrade/8.5.2.sql b/roles/database/files/upgrade/8.5.2.sql index 43fb3a28d..66a482e53 100644 --- a/roles/database/files/upgrade/8.5.2.sql +++ b/roles/database/files/upgrade/8.5.2.sql @@ -1,4 +1,14 @@ -insert into stm_color (color_name, color_rgb) VALUES ('crete blue', '485cd4') ON CONFLICT DO NOTHING; -insert into stm_color (color_name, color_rgb) VALUES ('state blue', 'a186ed') ON CONFLICT DO NOTHING; -insert into stm_color (color_name, color_rgb) VALUES ('olive', '617d28') ON CONFLICT DO NOTHING; -insert into stm_color (color_name, color_rgb) VALUES ('dark gold', 'cdad00') ON CONFLICT DO NOTHING; +DO $do$ BEGIN + IF EXISTS (SELECT color_name FROM stm_color WHERE color_name='crete blue') THEN + INSERT INTO stm_color (color_name, color_rgb) VALUES ('crete blue', '485cd4') + END IF; + IF EXISTS (SELECT color_name FROM stm_color WHERE color_name='state blue') THEN + INSERT INTO stm_color (color_name, color_rgb) VALUES ('state blue', 'a186ed') + END IF; + IF EXISTS (SELECT color_name FROM stm_color WHERE color_name='olive') THEN + INSERT INTO stm_color (color_name, color_rgb) VALUES ('olive', '617d28') + END IF; + IF EXISTS (SELECT color_name FROM stm_color WHERE color_name='dark gold') THEN + INSERT INTO stm_color (color_name, color_rgb) VALUES ('dark gold', 'cdad00') + END IF; +END $do$; \ No newline at end of file