From 5f13494e9c4b9767268def858e9d939f34ae6dc0 Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Thu, 4 Jul 2024 17:27:00 +0100 Subject: [PATCH] build: add IF EXISTS to DROP COLUMN in migration --- src/backend/migrations/005-drop-unnecessary-tables.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/migrations/005-drop-unnecessary-tables.sql b/src/backend/migrations/005-drop-unnecessary-tables.sql index 74d70d3109..4920ddfd66 100644 --- a/src/backend/migrations/005-drop-unnecessary-tables.sql +++ b/src/backend/migrations/005-drop-unnecessary-tables.sql @@ -23,7 +23,7 @@ DROP TABLE IF EXISTS public.task_invalidation_history; DROP SEQUENCE IF EXISTS public.task_invalidation_history_id_seq; ALTER TABLE public.projects -DROP COLUMN license_id; +DROP COLUMN IF EXISTS license_id; DROP TABLE IF EXISTS public.user_licenses; DROP TABLE IF EXISTS public.licenses; @@ -40,8 +40,8 @@ DROP TABLE IF EXISTS public.teams; DROP SEQUENCE IF EXISTS public.teams_id_seq; ALTER TABLE public.projects -DROP COLUMN mapping_permission, -DROP COLUMN validation_permission; +DROP COLUMN IF EXISTS mapping_permission, +DROP COLUMN IF EXISTS validation_permission; DROP TYPE IF EXISTS public.validationpermission; DROP TYPE IF EXISTS public.mappingpermission; DROP TYPE IF EXISTS public.teamvisibility;