51f95e0fd6
Part of GRO-802 monorepo breakdown. Changes: - Extract apps/api/ as the main API service - Inline packages/db/ (database schema, migrations, utilities) - Inline packages/types/ (shared TypeScript types) - Add CI workflow for lint, typecheck, test, build, docker - Port Dockerfile with 4 stages: runner, migrate, seed, reset Co-Authored-By: Paperclip <noreply@paperclip.ing>
13 lines
620 B
SQL
13 lines
620 B
SQL
-- Appointment groups: link multiple appointments from the same client visit.
|
|
-- Each appointment in a group is for a different pet and may have a different groomer.
|
|
CREATE TABLE appointment_groups (
|
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
client_id UUID NOT NULL REFERENCES clients(id) ON DELETE RESTRICT,
|
|
notes TEXT,
|
|
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
|
updated_at TIMESTAMP NOT NULL DEFAULT NOW()
|
|
);
|
|
|
|
-- Link appointments to a group (nullable — non-grouped appointments are unaffected)
|
|
ALTER TABLE appointments ADD COLUMN group_id UUID REFERENCES appointment_groups(id) ON DELETE SET NULL;
|