Entity user
pii: direct
Properties
| Property | Value |
|---|---|
| owner | platform |
Subject areas: Auth
Attributes
| # | Name | Type | Null | Default | Key | Terms | Description |
|---|---|---|---|---|---|---|---|
| 1 | id | bigint | no | PK | |||
| 2 | tenant_id | domain tenant_ref (bigint) | yes | UQ, FK | |||
| 3 | emailpii: direct | text(320) | no | UQ | |||
| 4 | display_name | text(200) | yes | ||||
| 5 | password_hash | binary(60) | yes | ||||
| 6 | last_login_at | timestamptz | yes |
Keys
| Kind | Name | Attributes |
|---|---|---|
| primary | pk_user | id |
| unique | uq_user_tenant_email | tenant_id, email |
Relationships
| Name | Role | Other entity | Cardinality | Attributes | Identifying | On delete | On update |
|---|---|---|---|---|---|---|---|
| api_key_created_by | parent | api_key | zero_or_one to many | api_key.created_by -> user.id | no | set_null | no_action |
| membership_user | parent | membership | one to many | membership.user_id -> user.id | yes | cascade | no_action |
| user_tenant | child | tenant | one to many | user.tenant_id -> tenant.id | no | cascade | no_action |
Physical
lite (sqlite): main.user
| # | Name | Type | Null | Default | Identity | Collation | Attribute | Comment |
|---|---|---|---|---|---|---|---|---|
| 1 | id | integer | no | by_default | id | |||
| 2 | tenant_id | integer | no | tenant_id | ||||
| 3 | text | no | ||||||
| 4 | display_name | text | yes | display_name | ||||
| 5 | password_hash | blob | yes | password_hash | ||||
| 6 | last_login_at | text | yes | last_login_at |
- primary key pk_user (id)
- unique uq_user_tenant_email (tenant_id, email)
- foreign key fk_user_tenant (tenant_id) references tenant (id) on delete cascade
pg (postgresql): app.user
| # | Name | Type | Null | Default | Identity | Collation | Attribute | Comment |
|---|---|---|---|---|---|---|---|---|
| 1 | id | bigint | no | always | id | |||
| 2 | tenant_id | bigint | no | tenant_id | ||||
| 3 | varchar(320) | no | ||||||
| 4 | display_name | varchar(200) | yes | display_name | ||||
| 5 | password_hash | bytea | yes | password_hash | ||||
| 6 | last_login_at | timestamp with time zone | yes | last_login_at |
- primary key pk_user (id)
- unique uq_user_tenant_email (tenant_id, email)
- foreign key fk_user_tenant (tenant_id) references tenant (id) on delete cascade