Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | uuid | 2147483647 | public.gen_random_uuid() |
|
|
||||||||||||||||||||||||||||||||||||
| UserId | uuid | 2147483647 | √ | null |
|
|
Foreign key, referencing public.Users |
||||||||||||||||||||||||||||||||||
| method | enum_Share_method | 2147483647 | √ | null |
|
|
method of sharing the post, but mobile is unable to know which method user is sharing, so this value is nullable for mobile |
||||||||||||||||||||||||||||||||||
| type | enum_Share_type | 2147483647 | null |
|
|
type of post shared |
|||||||||||||||||||||||||||||||||||
| createdAt | timestamptz | 35,6 | now() |
|
|
||||||||||||||||||||||||||||||||||||
| postId | uuid | 2147483647 | null |
|
|
postId, since this refers to different tables, we are not able to use foreign key constraint on this column, but we still need this for unique constraint |
|||||||||||||||||||||||||||||||||||
| platform | enum_Share_platform | 2147483647 | 'WEB'::"enum_Share_platform" |
|
|
which platform the user share from |
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| Shares_pkey | Primary key | Asc | id |
| Shares_method_idx | Performance | Asc | method |
| Shares_type_idx | Performance | Asc | type |
| Shares_UserId_idx | Performance | Asc | UserId |
| unique_UserId_method_type_postId_platform | Must be unique | Asc/Asc/Asc/Asc/Asc | UserId + method + type + postId + platform |

