Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| id | int4 | 10 | √ | null |
|
|
|||||
| booking_id | int4 | 10 | √ | null |
|
|
|||||
| register_id | int4 | 10 | √ | null |
|
|
|||||
| file_id | uuid | 2147483647 | √ | null |
|
|
|||||
| file_name | text | 2147483647 | √ | null |
|
|
|||||
| create_time | timestamptz | 35,6 | √ | CURRENT_TIMESTAMP |
|
|
|||||
| create_user | text | 2147483647 | √ | null |
|
|
|||||
| modify_time | timestamptz | 35,6 | √ | null |
|
|
|||||
| modify_user | text | 2147483647 | √ | null |
|
|
|||||
| file_path | text | 2147483647 | √ | null |
|
|
|||||
| file_size | int8 | 19 | √ | null |
|
|
|||||
| content_type | text | 2147483647 | √ | null |
|
|
|||||
| attach_type | text | 2147483647 | √ | CASE WHEN (booking_id IS NOT NULL) THEN 'booking'::text ELSE 'registration'::text END |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| pk_attachment | Primary key | Asc | id |
| idx_attachment_booking_id | Performance | Asc | booking_id |
| idx_attachment_file_id | Performance | Asc | file_id |
| idx_attachment_register_id | Performance | Asc | register_id |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| ck_attachment_one_ref | (num_nonnulls(booking_id, register_id) = 1) |
| ck_attachment_file_size | ((file_size IS NULL) OR (file_size > 0)) |



