Constraints

57 Foreign Key Constraints

Constraint Name Child Column Parent Column Delete Rule
PointsTopUpOrderAfterPaymentActions_pointsTopUpOrderId_fkey
PointsTopUpOrderAfterPaymentActions.pointsTopUpOrderId
PointsTopUpOrders.id
Cascade on delete
AutomatedCSVExportLogs_companyId_fkey
AutomatedCSVExportLogs.companyId
Companies.id
Null on delete
PointsTopUpOrderRelatedJob_pointsTopUpOrderAfterPaymentAct_fkey
PointsTopUpOrderRelatedJobs.pointsTopUpOrderAfterPaymentActionId
PointsTopUpOrderAfterPaymentActions.pointsTopUpOrderId
Cascade on delete
PointsTopUpOrderRelatedJob_jobId_fkey
PointsTopUpOrderRelatedJobs.jobId
Jobs.id
Cascade on delete
PointsJournalEntries_companyId_fkey
PointsJournalEntries.companyId
Companies.id
Null on delete
PointsJournalEntries_userId_fkey
PointsJournalEntries.userId
Users.id
Null on delete
TalentChatPointsAccounts_companyId_fkey
TalentChatPointsAccounts.companyId
Companies.id
Null on delete
TalentChatPointsAccounts_pointsAccountId_fkey
TalentChatPointsAccounts.pointsAccountId
PointsAccounts.id
Restrict delete
JobPostExtensionPointsUsageAccounts_pointsAccountId_fkey
JobPostExtensionPointsUsageAccounts.pointsAccountId
PointsAccounts.id
Restrict delete
JobPostExtensionPointsUsageAccounts_companyId_fkey
JobPostExtensionPointsUsageAccounts.companyId
Companies.id
Null on delete
Orders_userCompanyId_fkey
Orders.userCompanyId
UserCompanies.id
Null on delete
Orders_userId_fkey
Orders.userId
Users.id
Restrict delete
Orders_companyId_fkey
Orders.companyId
Companies.id
Null on delete
PointsTopUpOrderPricings_pointsTopUpOrderId_fkey
PointsTopUpOrderPricings.pointsTopUpOrderId
PointsTopUpOrders.id
Cascade on delete
SubscriptionCsvDownloads_companyJobSlotsSubscriptionId_fkey
SubscriptionCsvDownloads.companyJobSlotsSubscriptionId
CompanyJobSlotsSubscriptions.id
Cascade on delete
PointsExpiryDatetimes_pointsJournalEntryId_fkey
PointsExpiryDatetimes.pointsJournalEntryId
PointsJournalEntries.id
Cascade on delete
CompanyBalanceExpiryDates_companyId_fkey
CompanyBalanceExpiryDates.companyId
Companies.id
Cascade on delete
CompanyJobSlotsSubscriptions_companyId_fkey
CompanyJobSlotsSubscriptions.companyId
Companies.id
Null on delete
CompanyJobSlotsSubscriptions_creatorUserId_fkey
CompanyJobSlotsSubscriptions.creatorUserId
Users.id
Restrict delete
ExpiryPointsAccounts_pointsAccountId_fkey
ExpiryPointsAccounts.pointsAccountId
PointsAccounts.id
Restrict delete
ExpiryPointsAccounts_companyId_fkey
ExpiryPointsAccounts.companyId
Companies.id
Null on delete
JobPostPointsUsageAccounts_pointsAccountId_fkey
JobPostPointsUsageAccounts.pointsAccountId
PointsAccounts.id
Restrict delete
JobPostPointsUsageAccounts_companyId_fkey
JobPostPointsUsageAccounts.companyId
Companies.id
Null on delete
PointsTopUpOrders_companyId_fkey
PointsTopUpOrders.companyId
Companies.id
Null on delete
PointsTopUpOrders_userCompanyId_fkey
PointsTopUpOrders.userCompanyId
UserCompanies.id
Null on delete
PointsTopUpOrders_userId_fkey
PointsTopUpOrders.userId
Users.id
Restrict delete
EmployerBonusPointsAccounts_pointsAccountId_fkey
EmployerBonusPointsAccounts.pointsAccountId
PointsAccounts.id
Restrict delete
EmployerBonusPointsAccounts_companyId_fkey
EmployerBonusPointsAccounts.companyId
Companies.id
Null on delete
MissingXenditInvoicesForPointsTopUpOrde_pointsTopUpOrderId_fkey
MissingXenditInvoicesForPointsTopUpOrders.pointsTopUpOrderId
PointsTopUpOrders.id
Cascade on delete
PointsTopUpOrderPayments_pointsTopUpOrderId_fkey
PointsTopUpOrderPayments.pointsTopUpOrderId
PointsTopUpOrders.id
Cascade on delete
TalentChatAllocations_companyJobSlotsSubscriptionId_fkey
TalentChatAllocations.companyJobSlotsSubscriptionId
CompanyJobSlotsSubscriptions.id
Cascade on delete
PointsTopUpOrderXenditInvoiceMismatches_pointsTopUpOrderId_fkey
PointsTopUpOrderXenditInvoiceMismatches.pointsTopUpOrderId
PointsTopUpOrders.id
Cascade on delete
PointsTopUpJournalEntryDebitCredits_pointsJournalEntryId_fkey
PointsJournalEntryDebitCredits.pointsJournalEntryId
PointsJournalEntries.id
Restrict delete
PointsTopUpJournalEntryDebitCredits_pointsAccountId_fkey
PointsJournalEntryDebitCredits.pointsAccountId
PointsAccounts.id
Restrict delete
SubscriptionTalentChatQuotas_companyJobSlotsSubscriptionId_fkey
SubscriptionTalentChatQuotas.companyJobSlotsSubscriptionId
CompanyJobSlotsSubscriptions.id
Cascade on delete
CompanyJobSlotSubscriptionAdd_companyJobSlotsSubscriptionI_fkey
CompanyJobSlotSubscriptionAdditionalFeatures.companyJobSlotsSubscriptionId
CompanyJobSlotsSubscriptions.id
Cascade on delete
JobPostOrderItems_jobId_fkey
JobPostOrderItems.jobId
Jobs.id
Restrict delete
JobPostOrderItems_orderItemId_fkey
JobPostOrderItems.orderItemId
OrderItems.id
Cascade on delete
PointsTopUpJournalEntries_pointsJournalEntryId_fkey
PointsTopUpJournalEntries.pointsJournalEntryId
PointsJournalEntries.id
Restrict delete
PointsTopUpJournalEntries_pointsTopUpOrderId_fkey
PointsTopUpJournalEntries.pointsTopUpOrderId
PointsTopUpOrders.id
Cascade on delete
JobExtensionOrderItems_jobId_fkey
JobExtensionOrderItems.jobId
Jobs.id
Restrict delete
JobExtensionOrderItems_orderItemId_fkey
JobExtensionOrderItems.orderItemId
OrderItems.id
Cascade on delete
PointsTopUpOrderRelatedJobDraft_publishedJobId_fkey
PointsTopUpOrderRelatedJobDrafts.publishedJobId
Jobs.id
Cascade on delete
PointsTopUpOrderRelatedJobDraft_jobDraftId_fkey
PointsTopUpOrderRelatedJobDrafts.jobDraftId
JobDrafts.id
Null on delete
PointsTopUpOrderRelatedJobDra_pointsTopUpOrderAfterPayment_fkey
PointsTopUpOrderRelatedJobDrafts.pointsTopUpOrderAfterPaymentActionId
PointsTopUpOrderAfterPaymentActions.pointsTopUpOrderId
Cascade on delete
PointsTopUpOrderPointDetails_pointsTopUpOrderId_fkey
PointsTopUpOrderPointDetails.pointsTopUpOrderId
PointsTopUpOrders.id
Cascade on delete
SubscriptionPlanAssistanceRequests_userId_fkey
SubscriptionPlanAssistanceRequests.userId
Users.id
Null on delete
SubscriptionPlanAssistanceRequests_companyId_fkey
SubscriptionPlanAssistanceRequests.companyId
Companies.id
Cascade on delete
PointsTopUpOrderXenditPayments_pointsTopUpOrderId_fkey
PointsTopUpOrderXenditPayments.pointsTopUpOrderId
PointsTopUpOrders.id
Cascade on delete
ProductPurchaseAssistanceRequests_companyId_fkey
ProductPurchaseAssistanceRequests.companyId
Companies.id
Cascade on delete
ProductPurchaseAssistanceRequests_userId_fkey
ProductPurchaseAssistanceRequests.userId
Users.id
Null on delete
EmployerPaidPointsAccounts_pointsAccountId_fkey
EmployerPaidPointsAccounts.pointsAccountId
PointsAccounts.id
Restrict delete
EmployerPaidPointsAccounts_companyId_fkey
EmployerPaidPointsAccounts.companyId
Companies.id
Null on delete
OrderItems_orderId_fkey
OrderItems.orderId
Orders.id
Cascade on delete
OrderItems_productId_fkey
OrderItems.productId
Products.id
Restrict delete
PointsUsageJournalEntries_orderId_fkey
PointsUsageJournalEntries.orderId
Orders.id
Restrict delete
PointsUsageJournalEntries_pointsJournalEntryId_fkey
PointsUsageJournalEntries.pointsJournalEntryId
PointsJournalEntries.id
Restrict delete

Check Constraints

Table Constraint Name Constraint
PointsTopUpOrderAfterPaymentActions PointsTopUpOrderAfterPaymentActions_check ((((status <> 'FAILED'::employer_commerce."enum_EmployerCommerce_PointsTopUpOrderAfterPaymentActionStatus") AND ("failureJson" IS NULL)) OR ((status = 'FAILED'::employer_commerce."enum_EmployerCommerce_PointsTopUpOrderAfterPaymentActionStatus") AND ("failureJson" IS NOT NULL))))
PointsTopUpOrderPricings PointsTopUpOrderPricings_subtotal_check ((subtotal >= (0)::numeric))
PointsTopUpOrderPricings PointsTopUpOrderPricings_taxAmount_check (("taxAmount" >= (0)::numeric))
PointsTopUpOrderPricings PointsTopUpOrderPricings_total_check ((total >= (0)::numeric))
CompanyJobSlotsSubscriptions price ((((price IS NOT NULL) AND (price > (0)::numeric)) OR (price IS NULL)))
PointsAccounts PointsAccounts_balance_check ((balance >= (0)::numeric))
PointsTopUpOrderXenditInvoiceMismatches PointsTopUpOrderXenditInvoiceMismatches_check (((("actualStatus" IS NULL) = ("expectedStatus" IS NULL)) AND ((("actualTotalAmount" IS NULL) AND ("expectedTotalAmount" IS NULL)) OR (("actualTotalAmount" IS NOT NULL) AND ("actualTotalAmount" >= (0)::numeric) AND ("expectedTotalAmount" IS NOT NULL) AND ("expectedTotalAmount" >= (0)::numeric)))))
PointsJournalEntryDebitCredits PointsJournalEntryDebitCredits_check ((((debit IS NOT NULL) AND (debit >= (0)::numeric) AND (credit IS NULL)) OR ((credit IS NOT NULL) AND (credit >= (0)::numeric) AND (debit IS NULL))))
PointsJournalEntryDebitCredits PointsTopUpJournalEntryDebitCredits_finalAccountBalance_check (("finalAccountBalance" >= (0)::numeric))
Products Products_costInPoints_check (("costInPoints" >= (0)::numeric))
PointsTopUpOrderPointDetails PointsTopUpOrderPointDetails_bonusPoints_check (("bonusPoints" >= (0)::numeric))
PointsTopUpOrderPointDetails PointsTopUpOrderPointDetails_paidPoints_check (("paidPoints" > (0)::numeric))
PointsTopUpOrderXenditPayments check_requestedAt_before_expiryAt (("requestedAt" < "expiryAt"))
OrderItems OrderItems_costInPoints_check (("costInPoints" >= (0)::numeric))
SubscriptionPlans concurrentJobSlotsCheck (((("planType" <> 'CUSTOMIZED'::employer_commerce."enum_SubscriptionPlan_types") AND ("concurrentJobSlots" IS NOT NULL)) OR (("planType" = 'CUSTOMIZED'::employer_commerce."enum_SubscriptionPlan_types") AND ("concurrentJobSlots" IS NULL))))
SubscriptionPlans defaultPrice_and_currency_code_check (((("defaultPrice" IS NULL) AND ("currencyCode" IS NULL)) OR (("defaultPrice" IS NOT NULL) AND ("defaultPrice" > (0)::numeric) AND ("currencyCode" IS NOT NULL))))
SubscriptionPlans SubscriptionPlans_promotionPercentage_check (("promotionPercentage" >= 0))
SubscriptionPlans timePeriod (((("timePeriod" IS NOT NULL) AND ("timePeriod" > 0)) OR ("timePeriod" IS NULL)))
SubscriptionPlans timePeriodUnit (((("timePeriod" IS NOT NULL) AND ("timePeriodUnit" IS NOT NULL)) OR (("timePeriod" IS NULL) AND ("timePeriodUnit" IS NULL))))