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>
11 lines
457 B
SQL
11 lines
457 B
SQL
-- Add recurring_series table to store recurrence patterns
|
|
CREATE TABLE "recurring_series" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
"frequency_weeks" integer NOT NULL,
|
|
"created_at" timestamp DEFAULT now() NOT NULL
|
|
);
|
|
|
|
-- Extend appointments with series tracking
|
|
ALTER TABLE "appointments" ADD COLUMN "series_id" uuid REFERENCES "recurring_series"("id") ON DELETE SET NULL;
|
|
ALTER TABLE "appointments" ADD COLUMN "series_index" integer;
|