Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | uuid | 2147483647 | gen_random_uuid() |
|
|
||||||||||||||||||
| companyId | uuid | 2147483647 | √ | null |
|
|
|||||||||||||||||
| type | varchar | 2147483647 | null |
|
|
||||||||||||||||||
| amount | int4 | 10 | null |
|
|
Represents the credit amount added/used |
|||||||||||||||||
| finalBalance | int4 | 10 | null |
|
|
Represents the balance after the operation is done |
|||||||||||||||||
| expiryDateTime | timestamptz | 35,6 | √ | null |
|
|
Represents the expiry date of a credit balance being set during this event |
||||||||||||||||
| createdAt | timestamptz | 35,6 | now() |
|
|
||||||||||||||||||
| updatedAt | timestamptz | 35,6 | now() |
|
|
||||||||||||||||||
| productId | uuid | 2147483647 | √ | null |
|
|
|||||||||||||||||
| userId | uuid | 2147483647 | √ | null |
|
|
|||||||||||||||||
| companyCreditInventoryBreakdownId | uuid | 2147483647 | √ | null |
|
|
|||||||||||||||||
| details | jsonb | 2147483647 | √ | null |
|
|
Stores additional metadata. Current usage: tracking the origin of credit additions via a reference to the source table and record ID. Scope may evolve in the future. |
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| CompanyCreditInventoryLogs_pkey | Primary key | Asc | id |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| CompanyCreditInventoryLogs_amount_check | ((amount > 0)) |
| CompanyCreditInventoryLogs_finalBalance_check | (("finalBalance" >= 0)) |



