feat: add DBML schema files and relspecgo migration generation

- Add schema/*.dbml covering all existing tables (001-019)
- Wire relspecgo via make generate-migrations target
- Add make check-schema-drift for CI drift detection
- Add schema/README.md documenting the DBML-first workflow

Closes #19
This commit is contained in:
2026-04-04 14:53:33 +02:00
parent f0e242293f
commit 59c43188e5
12 changed files with 4402 additions and 1 deletions

44
schema/calendar.dbml Normal file
View File

@@ -0,0 +1,44 @@
Table family_members {
id uuid [pk, default: `gen_random_uuid()`]
name text [not null]
relationship text
birth_date date
notes text
created_at timestamptz [not null, default: `now()`]
}
Table activities {
id uuid [pk, default: `gen_random_uuid()`]
family_member_id uuid [ref: > family_members.id]
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()`]
indexes {
day_of_week
family_member_id
(start_date, end_date)
}
}
Table important_dates {
id uuid [pk, default: `gen_random_uuid()`]
family_member_id uuid [ref: > family_members.id]
title text [not null]
date_value date [not null]
recurring_yearly boolean [not null, default: false]
reminder_days_before int [not null, default: 7]
notes text
created_at timestamptz [not null, default: `now()`]
indexes {
date_value
}
}