Skip to content

Commit

Permalink
database syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
alf-cactus committed Nov 27, 2024
1 parent 68e0f58 commit 7ac2b8e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions roles/database/files/upgrade/8.5.2.sql
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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')
IF NOT 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')
IF NOT 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')
IF NOT 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')
IF NOT 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$;
END $do$;

0 comments on commit 7ac2b8e

Please sign in to comment.