1855b374b5
Phase 2 extraction: groombook/api from groombook/app monorepo. Changes: - Move packages/db content to apps/api/src/db/ - Move packages/types content to apps/api/src/types/ - Inline database schema and migrations into api package - Update Dockerfile to build single package - Update CI workflow for single-package structure - Fix vitest.config.ts aliases 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")
|
|
);
|