Browse Source

chore: create migration to add is_visible_on_guest_dahsboard field on app table

Nicolas Meienberger 1 year ago
parent
commit
9b9541cee7
1 changed files with 15 additions and 0 deletions
  1. 15 0
      packages/cli/assets/migrations/00009-add-guest-dashboard.sql

+ 15 - 0
packages/cli/assets/migrations/00009-add-guest-dashboard.sql

@@ -0,0 +1,15 @@
+-- Update app table to add "is_visible_on_guest_dashboard" column
+ALTER TABLE "app"
+    ADD COLUMN IF NOT EXISTS "is_visible_on_guest_dashboard" boolean DEFAULT FALSE;
+
+-- Set default value to false
+UPDATE
+    "app"
+SET
+    "is_visible_on_guest_dashboard" = FALSE
+WHERE
+    "is_visible_on_guest_dashboard" IS NULL;
+
+-- Set is_visible_on_guest_dashboard column to not null constraint
+ALTER TABLE "app"
+    ALTER COLUMN "is_visible_on_guest_dashboard" SET NOT NULL;