Giao diện
identity / privacy
Trang sinh tự động
Sinh từ ad83b0aea — chạy 820 migration lên PostgreSQL 17 rồi đọc pg_catalog. Mô tả bảng và cột lấy từ COMMENT ON. Không sửa tay: lần chạy docgen sau sẽ ghi đè.
4 bảng. Quay lại identity.
privacy_requests
P1-14. Data export / deletion requests of a subject; one open request per kind; review by another person.
public.privacy_requests · 17 cột · 12 check · 1 unique · 4 index · 2 policy · 7 trigger · RLS bật
| Cột | Kiểu | Khoá | Mô tả | |
|---|---|---|---|---|
id | uuid | NOT NULL | PK | |
account_id | uuid | NOT NULL | FK → accounts | |
kind | text | NOT NULL | ||
status | text | NOT NULL | ||
app | app_code | NOT NULL | ||
request_id | text | NOT NULL | ||
correlation_id | correlation_ref | NOT NULL | ||
reviewed_by | uuid | FK → accounts | ||
reviewed_at | timestamptz | |||
review_reason | text | |||
completed_at | timestamptz | |||
change_source | text | NOT NULL | ||
change_actor | uuid | FK → accounts | ||
change_ref | text | NOT NULL | ||
created_at | timestamptz | NOT NULL | ||
updated_at | timestamptz | NOT NULL | ||
version | integer | NOT NULL |
Khoá chính: id
Trỏ ra (3):
account_id→accounts·ON DELETE RESTRICTchange_actor→accounts·ON DELETE RESTRICTreviewed_by→accounts·ON DELETE RESTRICT
Được trỏ tới (3): privacy_exports, privacy_purge_records, privacy_request_events
privacy_exports
P1-14. Export package of one approved EXPORT request: private object + expiry; OWN download only.
public.privacy_exports · 17 cột · 8 check · 1 unique · 3 index · 1 policy · 5 trigger · RLS bật
| Cột | Kiểu | Khoá | Mô tả | |
|---|---|---|---|---|
id | uuid | NOT NULL | PK | |
request_id | uuid | NOT NULL | FK → privacy_requests | |
account_id | uuid | NOT NULL | FK → accounts | |
status | text | NOT NULL | ||
bucket | text | NOT NULL | ||
storage_path | text | |||
file_name | text | NOT NULL | ||
size_bytes | integer | NOT NULL | ||
sha256 | text | NOT NULL | ||
row_counts | jsonb | NOT NULL | ||
policy_id | uuid | NOT NULL | FK → retention_policies | |
run_id | uuid | NOT NULL | ||
expires_at | timestamptz | NOT NULL | ||
purged_at | timestamptz | |||
created_at | timestamptz | NOT NULL | ||
updated_at | timestamptz | NOT NULL | ||
version | integer | NOT NULL |
Khoá chính: id
Trỏ ra (3):
account_id→accounts·ON DELETE RESTRICTpolicy_id→retention_policies·ON DELETE RESTRICTrequest_id→privacy_requests·ON DELETE RESTRICT
Được trỏ tới: không có
privacy_purge_records
P1-14. Append-only evidence of every erasure/purge decision per category (outcome, count, policy row).
public.privacy_purge_records · 9 cột · 2 check · 0 unique · 2 index · 0 policy · 2 trigger · RLS bật
| Cột | Kiểu | Khoá | Mô tả | |
|---|---|---|---|---|
id | bigint | NOT NULL | PK | |
run_id | uuid | NOT NULL | ||
request_id | uuid | FK → privacy_requests | ||
account_id | uuid | NOT NULL | FK → accounts | |
category | text | NOT NULL | ||
policy_id | uuid | FK → retention_policies | ||
outcome | text | NOT NULL | ||
affected_rows | integer | NOT NULL | ||
recorded_at | timestamptz | NOT NULL |
Khoá chính: id
Trỏ ra (3):
account_id→accounts·ON DELETE RESTRICTpolicy_id→retention_policies·ON DELETE RESTRICTrequest_id→privacy_requests·ON DELETE RESTRICT
Được trỏ tới: không có
privacy_request_events
P1-14. Append-only history of every privacy_requests version (who/what/why), written by trigger only.
public.privacy_request_events · 10 cột · 0 check · 1 unique · 2 index · 0 policy · 2 trigger · RLS bật
| Cột | Kiểu | Khoá | Mô tả | |
|---|---|---|---|---|
id | bigint | NOT NULL | PK | |
request_id | uuid | NOT NULL | FK → privacy_requests | |
version | integer | NOT NULL | ||
from_status | text | |||
to_status | text | NOT NULL | ||
source | text | NOT NULL | ||
actor_account_id | uuid | |||
ref | text | NOT NULL | ||
reason | text | |||
recorded_at | timestamptz | NOT NULL |
Khoá chính: id
Trỏ ra (1):
request_id→privacy_requests·ON DELETE RESTRICT
Được trỏ tới: không có