Settings & Audit Logs¶
settings¶
Table: public.settings
| Column | Type | Default | Description |
|---|---|---|---|
id |
uuid |
PK | UUID |
key |
text |
NOT NULL | Setting key |
value |
jsonb |
NOT NULL | Arbitrary value |
description |
text |
nullable | |
updated_by |
uuid |
FK → profiles(id) nullable |
Last editor |
created_at |
timestamptz |
now() |
|
updated_at |
timestamptz |
now() |
Unique constraint on key.
audit_logs¶
Table: public.audit_logs
| Column | Type | Default | Description |
|---|---|---|---|
id |
bigint |
PK auto-increment | |
user_id |
uuid |
FK → profiles(id) nullable |
|
action |
text |
NOT NULL | INSERT, UPDATE, DELETE |
entity_type |
text |
NOT NULL | Table name |
entity_id |
text |
NOT NULL | Row UUID |
old_values |
jsonb |
nullable | Before state |
new_values |
jsonb |
nullable | After state |
ip_address |
text |
nullable | |
created_at |
timestamptz |
now() |
Indexes¶
- Unique on
settings(key) idx_audit_logs_entityonaudit_logs(entity_type, entity_id)idx_audit_logs_useronaudit_logs(user_id)idx_audit_logs_createdonaudit_logs(created_at)
Related¶
- Admin: Settings — Admin settings UI
- Mobile: Settings — User preferences