Files
amcs/migrations/_old/013_family_calendar.sql
Hein 927a118338
Some checks failed
CI / build-and-test (push) Failing after -31m53s
feat(ui): add maintenance page for task management
* Implement maintenance page with task and log display
* Add backfill and metadata retry functionality
* Integrate grid component for project display in thoughts page
* Update types for maintenance tasks and logs
* Enhance sidebar and shell for new maintenance navigation
2026-04-26 23:13:41 +02:00

43 lines
1.6 KiB
SQL

-- Extension 3: Family Calendar
-- Multi-person family scheduling (single-user, no RLS)
CREATE TABLE IF NOT EXISTS family_members (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name TEXT NOT NULL,
relationship TEXT,
birth_date DATE,
notes TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE TABLE IF NOT EXISTS activities (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
family_member_id UUID REFERENCES family_members(id) ON DELETE SET NULL,
title TEXT NOT NULL,
activity_type TEXT,
day_of_week TEXT,
start_time TIME,
end_time TIME,
start_date DATE,
end_date DATE,
location TEXT,
notes TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE TABLE IF NOT EXISTS important_dates (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
family_member_id UUID REFERENCES family_members(id) ON DELETE SET NULL,
title TEXT NOT NULL,
date_value DATE NOT NULL,
recurring_yearly BOOLEAN NOT NULL DEFAULT false,
reminder_days_before INTEGER NOT NULL DEFAULT 7,
notes TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_activities_dow ON activities(day_of_week);
CREATE INDEX IF NOT EXISTS idx_activities_member ON activities(family_member_id);
CREATE INDEX IF NOT EXISTS idx_activities_dates ON activities(start_date, end_date);
CREATE INDEX IF NOT EXISTS idx_important_dates_date ON important_dates(date_value);