Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ LANGUAGE plpgsql;
-- Add the new column
ALTER TABLE "bookings" ADD COLUMN IF NOT EXISTS induction_new public.booking_induction_type DEFAULT 'TENTATIVE'::public.booking_induction_type;

-- Migrate data
UPDATE bookings
SET induction_new = CASE
WHEN induction = true THEN 'ACCEPTED'::public.booking_induction_type
ELSE 'TENTATIVE'::public.booking_induction_type
END;
-- Migrate data (disabled retrospectively due to migration issues)
-- UPDATE bookings
-- SET induction_new = CASE
-- WHEN induction = true THEN 'ACCEPTED'::public.booking_induction_type
-- ELSE 'TENTATIVE'::public.booking_induction_type
-- END;

-- Drop the old column and rename the new column
ALTER TABLE bookings DROP COLUMN induction;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- +micrate Up
-- SQL in section 'Up' is executed when this migration is applied

ALTER TABLE "sys" ADD COLUMN IF NOT EXISTS "timetable_url" TEXT NULL;
ALTER TABLE "sys" ADD COLUMN IF NOT EXISTS "camera_url" TEXT NULL;
ALTER TABLE "sys" ADD COLUMN IF NOT EXISTS "camera_snapshot_url" TEXT NULL;
ALTER TABLE "sys" ADD COLUMN IF NOT EXISTS "room_booking_url" TEXT NULL;

-- +micrate Down
-- SQL section 'Down' is executed when this migration is rolled back

ALTER TABLE "sys" DROP COLUMN IF EXISTS "timetable_url";
ALTER TABLE "sys" DROP COLUMN IF EXISTS "camera_url";
ALTER TABLE "sys" DROP COLUMN IF EXISTS "camera_snapshot_url";
ALTER TABLE "sys" DROP COLUMN IF EXISTS "room_booking_url";
8 changes: 7 additions & 1 deletion src/placeos-models/control_system.cr
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@ module PlaceOS::Model

attribute timezone : Time::Location?, converter: Time::Location::Converter, es_type: "text"

# Provide a field for simplifying support
# Provide fields for simplifying support
attribute support_url : String = ""
attribute timetable_url : String?
attribute camera_snapshot_url : String?
attribute camera_url : String?

# if not bookable via google / O365 calendaring systems
attribute room_booking_url : String?

attribute version : Int32 = 0

Expand Down