Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| id | serial | 10 | √ | nextval('configs_id_seq'::regclass) |
|
|
|||||
| prop_id | int4 | 10 | √ | null |
|
|
|||||
| config_name | citext | 2147483647 | √ | null |
|
|
|||||
| config_value | text | 2147483647 | √ | null |
|
|
|||||
| value_type | int2 | 5 | √ | 0 |
|
|
0 = plain text 1 = Boolean 2 = Int 3 = Floating point 4 = Lookup value 5 = timestamp 6 = date 7 = time 8 = flag (single character) 9 = Custom (JSON) |
||||
| default_value | text | 2147483647 | √ | null |
|
|
|||||
| description | text | 2147483647 | √ | null |
|
|
|||||
| category | citext | 2147483647 | √ | 'DEFAULT'::citext |
|
|
|||||
| flag | bpchar | 1 | √ | null |
|
|
|||||
| config_label | text | 2147483647 | √ | null |
|
|
|||||
| allow_edit | bool | 1 | true |
|
|
Can edit in Admin app |
|||||
| allow_override | bool | 1 | true |
|
|
Allow override on each property |
|||||
| seq | int4 | 10 | √ | null |
|
|
|||||
| client_visible | bool | 1 | false |
|
|
true = ให้ rpc.system_config_get คืนค่านี้ให้ client app ได้ ตั้งจาก migration เท่านั้น ไม่ใช่ field ที่หน้า System Config แก้ (admin_save_system_config ไม่ได้เขียนคอลัมน์นี้) default false เพื่อให้ config/secret ที่มีอยู่เดิมไม่รั่วออกไปโดยอัตโนมัติ rpc.system_config_get เช็คคอลัมน์นี้ที่ “แถว default (prop_id IS NULL)” เท่านั้น เพราะแถว override ราย property ที่ admin_save_system_config สร้างจะได้ค่า default false ถ้าไปเช็คที่แถวที่ชนะการ merge ค่าจะหายจาก output ทันทีที่มีคน ตั้ง override = พังตอนที่มีคนเปิดใช้จริง |
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| configs_pkey | Primary key | Asc | id |
| idx_config_key | Must be unique | Asc/Asc | prop_id + config_name |
| unq_configs_not_null | Must be unique | Asc/Asc | prop_id + config_name |
| unq_configs_null | Must be unique | Asc | config_name |

