NobGit
public imalexnord read

Slot

Calendar-first scheduling powered by Cloudflare Workers and Google Calendar.

Languages

Repository composition by tracked source files.

TypeScript
TypeScript 79% CSS 19% SQL 2% HTML 0%
Create file Wiki Documentation
Clone
https://nobgit.com/user/imalexnord/slot.git
ssh://[email protected]:2222/user/imalexnord/slot.git
0006_public_booking_cancellation.sql
ALTER TABLE bookings ADD COLUMN public_booking_id TEXT;

-- Give existing bookings a stable public reference without exposing the full
-- internal UUID. Existing UUIDs are random, so the first 20 hexadecimal
-- characters still provide a high-entropy reference for migrated rows.
UPDATE bookings
SET public_booking_id =
  'SLT-' || upper(substr(replace(id, '-', ''), 1, 4)) || '-' ||
  upper(substr(replace(id, '-', ''), 5, 4)) || '-' ||
  upper(substr(replace(id, '-', ''), 9, 4)) || '-' ||
  upper(substr(replace(id, '-', ''), 13, 4)) || '-' ||
  upper(substr(replace(id, '-', ''), 17, 4))
WHERE public_booking_id IS NULL;

CREATE UNIQUE INDEX IF NOT EXISTS idx_bookings_public_booking_id
  ON bookings(public_booking_id)
  WHERE public_booking_id IS NOT NULL;