Schema: people (part 3)
Part of the generated database reference.
people_departments
- Domain:
people Β· Feature gate: #[cfg(feature = "people")] Β· Migration: 6.5.23-branch-scope-cleanup
- Rust source:
botschema/src/people.rs
| Column |
SQL type |
Null |
Default |
Key |
References |
| id |
UUID |
no |
gen_random_uuid() |
PK |
β |
| org_id |
UUID |
no |
β |
FK |
organizations.org_id |
| bot_id |
UUID |
no |
β |
β |
β |
| name |
VARCHAR(255) |
no |
β |
β |
β |
| description |
TEXT |
yes |
β |
β |
β |
| code |
VARCHAR(255) |
yes |
β |
β |
β |
| parent_id |
UUID |
yes |
β |
FK |
people_departments.id |
| head_id |
UUID |
yes |
β |
FK |
people.id |
| cost_center |
VARCHAR(255) |
yes |
β |
β |
β |
| is_active |
BOOLEAN |
no |
TRUE |
β |
β |
| created_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| updated_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| branch_id |
UUID |
yes |
β |
FK |
branches.id |
people_org_chart
- Domain:
people Β· Feature gate: #[cfg(feature = "people")] Β· Migration: 6.5.23-branch-scope-cleanup
- Rust source:
botschema/src/people.rs
| Column |
SQL type |
Null |
Default |
Key |
References |
| id |
UUID |
no |
gen_random_uuid() |
PK |
β |
| org_id |
UUID |
no |
β |
FK |
organizations.org_id |
| bot_id |
UUID |
no |
β |
β |
β |
| person_id |
UUID |
no |
β |
FK |
people.id |
| reports_to_id |
UUID |
yes |
β |
FK |
people.id |
| position_title |
VARCHAR(255) |
yes |
β |
β |
β |
| position_level |
INTEGER |
no |
0 |
β |
β |
| position_order |
INTEGER |
no |
0 |
β |
β |
| effective_from |
VARCHAR(255) |
yes |
β |
β |
β |
| effective_until |
VARCHAR(255) |
yes |
β |
β |
β |
| is_active |
BOOLEAN |
no |
TRUE |
β |
β |
| created_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| branch_id |
UUID |
yes |
β |
FK |
branches.id |
people_person_skills
- Domain:
people Β· Feature gate: #[cfg(feature = "people")] Β· Migration: 6.5.15.1-consolidated
- Rust source:
botschema/src/people/people_skills_tables.rs
| Column |
SQL type |
Null |
Default |
Key |
References |
| id |
UUID |
no |
gen_random_uuid() |
PK |
β |
| person_id |
UUID |
no |
β |
FK |
people.id |
| skill_id |
UUID |
no |
β |
FK |
people_skills.id |
| proficiency_level |
INTEGER |
no |
1 |
β |
β |
| years_experience |
NUMERIC |
yes |
β |
β |
β |
| verified_by |
UUID |
yes |
β |
FK |
people.id |
| verified_at |
TIMESTAMPTZ |
yes |
β |
β |
β |
| created_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
people_skills
- Domain:
people Β· Feature gate: #[cfg(feature = "people")] Β· Migration: 6.5.23-branch-scope-cleanup
- Rust source:
botschema/src/people/people_skills_tables.rs
| Column |
SQL type |
Null |
Default |
Key |
References |
| id |
UUID |
no |
gen_random_uuid() |
PK |
β |
| org_id |
UUID |
no |
β |
FK |
organizations.org_id |
| bot_id |
UUID |
no |
β |
β |
β |
| name |
VARCHAR(255) |
no |
β |
β |
β |
| category |
VARCHAR(255) |
yes |
β |
β |
β |
| description |
TEXT |
yes |
β |
β |
β |
| is_active |
BOOLEAN |
no |
TRUE |
β |
β |
| created_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| branch_id |
UUID |
yes |
β |
FK |
branches.id |
people_team_members
- Domain:
people Β· Feature gate: #[cfg(feature = "people")] Β· Migration: 6.5.15.1-consolidated
- Rust source:
botschema/src/people.rs
| Column |
SQL type |
Null |
Default |
Key |
References |
| id |
UUID |
no |
gen_random_uuid() |
PK |
β |
| team_id |
UUID |
no |
β |
FK |
people_teams.id |
| person_id |
UUID |
no |
β |
FK |
people.id |
| role |
VARCHAR(255) |
yes |
β |
β |
β |
| is_primary |
BOOLEAN |
no |
FALSE |
β |
β |
| joined_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
people_teams
- Domain:
people Β· Feature gate: #[cfg(feature = "people")] Β· Migration: 6.5.23-branch-scope-cleanup
- Rust source:
botschema/src/people.rs
| Column |
SQL type |
Null |
Default |
Key |
References |
| id |
UUID |
no |
gen_random_uuid() |
PK |
β |
| org_id |
UUID |
no |
β |
FK |
organizations.org_id |
| bot_id |
UUID |
no |
β |
β |
β |
| name |
VARCHAR(255) |
no |
β |
β |
β |
| description |
TEXT |
yes |
β |
β |
β |
| leader_id |
UUID |
yes |
β |
FK |
people.id |
| parent_team_id |
UUID |
yes |
β |
FK |
people_teams.id |
| color |
VARCHAR(255) |
yes |
β |
β |
β |
| icon |
VARCHAR(255) |
yes |
β |
β |
β |
| is_active |
BOOLEAN |
no |
TRUE |
β |
β |
| created_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| updated_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| branch_id |
UUID |
yes |
β |
FK |
branches.id |
people_time_off
- Domain:
people Β· Feature gate: #[cfg(feature = "people")] Β· Migration: 6.5.23-branch-scope-cleanup
- Rust source:
botschema/src/people/people_skills_tables.rs
| Column |
SQL type |
Null |
Default |
Key |
References |
| id |
UUID |
no |
gen_random_uuid() |
PK |
β |
| org_id |
UUID |
no |
β |
FK |
organizations.org_id |
| bot_id |
UUID |
no |
β |
β |
β |
| person_id |
UUID |
no |
β |
FK |
people.id |
| time_off_type |
VARCHAR(255) |
no |
β |
β |
β |
| status |
VARCHAR(255) |
no |
'pending' |
β |
β |
| start_date |
VARCHAR(255) |
no |
β |
β |
β |
| end_date |
VARCHAR(255) |
no |
β |
β |
β |
| hours_requested |
NUMERIC |
yes |
β |
β |
β |
| reason |
TEXT |
yes |
β |
β |
β |
| approved_by |
UUID |
yes |
β |
FK |
people.id |
| approved_at |
TIMESTAMPTZ |
yes |
β |
β |
β |
| notes |
TEXT |
yes |
β |
β |
β |
| created_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| updated_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| branch_id |
UUID |
yes |
β |
FK |
branches.id |
warmup_schedules
- Domain:
people Β· Feature gate: #[cfg(feature = "people")] Β· Migration: 6.7.12-missing-feature-tables
- Rust source:
botschema/src/people/marketing_campaign_events_tables.rs
| Column |
SQL type |
Null |
Default |
Key |
References |
| id |
UUID |
no |
gen_random_uuid() |
PK |
β |
| branch_id |
UUID |
no |
β |
β |
β |
| org_id |
UUID |
no |
β |
β |
β |
| email |
VARCHAR(255) |
no |
β |
β |
β |
| ip |
VARCHAR(64) |
no |
β |
β |
β |
| daily_limit |
INTEGER |
yes |
β |
β |
β |
| current_count |
INTEGER |
yes |
β |
β |
β |
| current_day |
INTEGER |
yes |
β |
β |
β |
| started_at |
TIMESTAMPTZ |
yes |
β |
β |
β |
| status |
VARCHAR(50) |
yes |
β |
β |
β |
| paused_reason |
TEXT |
yes |
β |
β |
β |
| is_active |
BOOLEAN |
yes |
β |
β |
β |
| created_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| updated_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
whatsapp_business
- Domain:
people Β· Feature gate: #[cfg(feature = "people")] Β· Migration: 6.5.15.1-consolidated
- Rust source:
botschema/src/people/people_skills_tables.rs
| Column |
SQL type |
Null |
Default |
Key |
References |
| id |
UUID |
no |
gen_random_uuid() |
PK |
β |
| bot_id |
uuid |
no |
β |
UQ |
β |
| phone_number_id |
VARCHAR(255) |
yes |
β |
β |
β |
| business_account_id |
VARCHAR(255) |
yes |
β |
β |
β |
| access_token |
TEXT |
yes |
β |
β |
β |
| webhooks_verified |
BOOLEAN |
yes |
false |
β |
β |
| created_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| updated_at |
TIMESTAMPTZ |
yes |
NOW() |
β |
β |