public
imalexnord
read
Slot
Calendar-first scheduling powered by Cloudflare Workers and Google Calendar.
Languages
Repository composition by tracked source files.
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
Trace
migrations/0006_public_booking_cancellation.sql
Trace helps you understand code history line by line. See who changed each line, when it changed, and which commit introduced it.
Author
Date
Commit
Line
Code
1
ALTER TABLE bookings ADD COLUMN public_booking_id TEXT;
3
-- Give existing bookings a stable public reference without exposing the full
4
-- internal UUID. Existing UUIDs are random, so the first 20 hexadecimal
5
-- characters still provide a high-entropy reference for migrated rows.
6
UPDATE bookings
7
SET public_booking_id =
8
'SLT-' || upper(substr(replace(id, '-', ''), 1, 4)) || '-' ||
9
upper(substr(replace(id, '-', ''), 5, 4)) || '-' ||
10
upper(substr(replace(id, '-', ''), 9, 4)) || '-' ||
11
upper(substr(replace(id, '-', ''), 13, 4)) || '-' ||
12
upper(substr(replace(id, '-', ''), 17, 4))
13
WHERE public_booking_id IS NULL;
15
CREATE UNIQUE INDEX IF NOT EXISTS idx_bookings_public_booking_id
16
ON bookings(public_booking_id)
17
WHERE public_booking_id IS NOT NULL;