CompanyProductSubscriptions


Columns

Column Type Size Nulls Auto Default Children Parents Comments
id uuid 2147483647 gen_random_uuid()
AfterCompanyProductSubscriptionPurchaseNotifications.companyProductSubscriptionId AfterCompanyProductSubscripti_companyProductSubscriptionId_fkey C
CompanyProductInventorySubscriptionLogs.companyProductSubscriptionId CompanyProductInventorySubscr_companyProductSubscriptionId_fkey N
CompanyProductSubscriptionAfterPaymentReceivedLogs.companyProductSubscriptionId CompanyProductSubscriptionAft_companyProductSubscriptionId_fkey C
CreditPurchaseOrderSubscriptionDetails.companyProductSubscriptionId CreditPurchaseOrderSubscripti_companyProductSubscriptionId_fkey R
companyId uuid 2147483647 null
Companies.id CompanyProductSubscriptions_companyId_fkey N
productId uuid 2147483647 null
Products.id CompanyProductSubscriptions_productId_fkey R
subscriptionStatus "employer_purchases"."enum_CompanyProductSubscriptions_subscriptionStatus" 2147483647 null
nextPaymentStatus "employer_purchases"."enum_CompanyProductSubscriptions_nextPaymentStatus" 2147483647 null
nextPaymentChargeDate timestamptz 35,6 null
createdAt timestamptz 35,6 now()
updatedAt timestamptz 35,6 now()
paymentService "employer_purchases"."enum_CreditPurchaseOrderPaymentRequests_paymentService" 2147483647 null
bufferTimePeriod int4 10 null

Time period of the buffer added for the subscription

bufferTimePeriodUnit "employer_purchases"."enum_employer_purchases_timePeriodUnit" 2147483647 null

Time period unit of the buffer added for the subscription

Indexes

Constraint Name Type Sort Column(s)
CompanyProductSubscriptions_pkey Primary key Asc id
CompanyProductSubscriptions_unique_idx Must be unique Asc/Asc/Asc companyId + productId + subscriptionStatus

Check Constraints

Constraint Name Constraint
bufferTimePeriod_bufferTimePeriodUnit_check (((("bufferTimePeriod" IS NOT NULL) AND ("bufferTimePeriod" > 0) AND ("bufferTimePeriodUnit" IS NOT NULL)) OR (("bufferTimePeriod" IS NULL) AND ("bufferTimePeriodUnit" IS NULL))))

Relationships