Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | uuid | 2147483647 | public.gen_random_uuid() |
|
|
|||||||||||||||
| shortId | bpchar | 8 | null |
|
|
Shortened order id for users to uniquely identify their orders. |
||||||||||||||
| CustomerId | uuid | 2147483647 | √ | null |
|
|
Foreign Key to Users Table, relating to Customer. |
|||||||||||||
| status | enum_Order_status | 2147483647 | 'PENDING'::"enum_Order_status" |
|
|
Status of the order. |
||||||||||||||
| updatedAt | timestamptz | 35,6 | now() |
|
|
|||||||||||||||
| createdAt | timestamptz | 35,6 | now() |
|
|
|||||||||||||||
| PromotionCodeId | uuid | 2147483647 | √ | null |
|
|
||||||||||||||
| gaCid | varchar | 255 | √ | null |
|
|
google analytics customer id, for offline tracking purpose |
|||||||||||||
| platformCreatedOn | enum_ExpertClass_PlatformOption | 2147483647 | null |
|
|
Denotes the platform on which the order was created. Please note that this column is NOT meant to be used for any business logic and is purely for data monitoring purposes for the business team. Also, there is a column in the ‘OrderPayment’ table named ‘paymentProvider’ which denotes the payment provider for the paid order. This column and ‘paymentProvider’ column are not exactly coupled. There is a possibility of this column having value ‘web’ and ‘paymentProvider’ column having value GOOGLE_PLAY, in which case the data would be invalid. There is no database constraint to this for now and application is responsible for setting the right values in the right columns. |
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| Orders_pkey | Primary key | Asc | id |
| Orders_CustomerId_idx | Performance | Asc | CustomerId |
| Orders_PromotionCodeId_idx | Performance | Asc | PromotionCodeId |
| Orders_shortId_key | Must be unique | Asc | shortId |
| Orders_status_idx | Performance | Asc | status |

