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>
12 lines
467 B
SQL
12 lines
467 B
SQL
-- Add email opt-out flag to clients
|
|
ALTER TABLE "clients" ADD COLUMN "email_opt_out" boolean NOT NULL DEFAULT false;
|
|
|
|
-- Track sent reminders to prevent duplicate sends
|
|
CREATE TABLE "reminder_logs" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
"appointment_id" uuid NOT NULL REFERENCES "appointments"("id") ON DELETE CASCADE,
|
|
"reminder_type" text NOT NULL,
|
|
"sent_at" timestamp DEFAULT now() NOT NULL,
|
|
UNIQUE ("appointment_id", "reminder_type")
|
|
);
|