Files
amcs/schema/crm.dbml
SGC 59c43188e5 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
2026-04-04 14:53:33 +02:00

54 lines
1.3 KiB
Plaintext

Table professional_contacts {
id uuid [pk, default: `gen_random_uuid()`]
name text [not null]
company text
title text
email text
phone text
linkedin_url text
how_we_met text
tags "text[]" [not null, default: `'{}'`]
notes text
last_contacted timestamptz
follow_up_date date
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz [not null, default: `now()`]
indexes {
last_contacted
follow_up_date
}
}
Table contact_interactions {
id uuid [pk, default: `gen_random_uuid()`]
contact_id uuid [not null, ref: > professional_contacts.id]
interaction_type text [not null]
occurred_at timestamptz [not null, default: `now()`]
summary text [not null]
follow_up_needed boolean [not null, default: false]
follow_up_notes text
created_at timestamptz [not null, default: `now()`]
indexes {
(contact_id, occurred_at)
}
}
Table opportunities {
id uuid [pk, default: `gen_random_uuid()`]
contact_id uuid [ref: > professional_contacts.id]
title text [not null]
description text
stage text [not null, default: 'identified']
value "decimal(12,2)"
expected_close_date date
notes text
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz [not null, default: `now()`]
indexes {
stage
}
}