Initial commit

This commit is contained in:
Jose Selesan
2026-04-08 22:53:11 -03:00
commit 9ae270609d
179 changed files with 28096 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
-- AlterTable
ALTER TABLE "court_bookings" ADD COLUMN "booking_code" VARCHAR(8);
-- Backfill existing rows
UPDATE "court_bookings"
SET "booking_code" = UPPER(SUBSTRING(REPLACE("id"::text, '-', '') FROM 1 FOR 8))
WHERE "booking_code" IS NULL;
-- Enforce not-null and uniqueness
ALTER TABLE "court_bookings" ALTER COLUMN "booking_code" SET NOT NULL;
CREATE UNIQUE INDEX "court_bookings_booking_code_key" ON "court_bookings"("booking_code");