feat(tools): add maintenance and meal planning tools with CRUD operations
- Implement maintenance tool for adding, logging, and retrieving tasks - Create meals tool for managing recipes, meal plans, and shopping lists - Introduce reparse metadata tool for updating thought metadata - Add household knowledge, home maintenance, family calendar, meal planning, and professional CRM database migrations - Grant necessary permissions for new database tables
This commit is contained in:
42
migrations/013_family_calendar.sql
Normal file
42
migrations/013_family_calendar.sql
Normal file
@@ -0,0 +1,42 @@
|
||||
-- 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);
|
||||
Reference in New Issue
Block a user