AdCredits table
The AdCredits table in the Shipfolio schema has 14 columns, keyed by Id, with 3 foreign keys to Companies, Campaigns and AdCharges.
Columns (14)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key | |
| Sequence | bigint | not null | |
| CompanyId | uuid | not null, references Companies.Id | |
| Kind | varchar(50) | not null | |
| AmountCents | bigint | not null | |
| BalanceAfterCents | bigint | not null | |
| CampaignId | uuid | references Campaigns.Id | |
| StripeSessionId | varchar(255) | ||
| Note | varchar(500) | ||
| ByUserId | uuid | ||
| CreatedAt | timestamptz | not null | |
| UpdatedAt | timestamptz | not null | |
| AdChargeId | uuid | references AdCharges.Id | |
| StripePaymentIntentId | varchar(255) |
Indexes (4)
(AdChargeId)(IX_AdCredits_AdChargeId)(CampaignId)(IX_AdCredits_CampaignId)(CompanyId, Sequence)unique (IX_AdCredits_CompanyId_Sequence)(Kind, CreatedAt)(IX_AdCredits_Kind_CreatedAt)
Relationships
AdCredits.CompanyIdreferencesCompanies.IdAdCredits.CampaignIdreferencesCampaigns.IdAdCredits.AdChargeIdreferencesAdCharges.Id