Database Schema
Documentation for all database tables in the Fold application.
ACH & Banking
5 tablesACH transfers, bank accounts, and Dwolla integration
Accounts
34 tablesUser accounts, authentication, KYC, and profile management
Balances
5 tablesAccount balances and balance changes
Bitcoin & Transfers
2 tablesBitcoin transfers, Bitgo operations, and custody
Brands
9 tablesGift card brands, merchants, and vendor sources
Features & Config
7 tablesFeature flags, notifications, and system configuration
Fold Card
17 tablesDebit card functionality, transactions, and funding
Games & Rewards
11 tablesSpin wheel, rewards, and gamification features
Gift Cards
6 tablesAssigned gift cards and card management
Gifts
7 tablesGift sending, third-party gifts, and promotions
Merchant Dashboard
3 tablesMerchant card inventory and management
Orders
11 tablesGift card order processing and fulfillment
Other Models
134 tablesAdditional models not categorized elsewhere
Payments & Withdrawals
17 tablesCredit cards, withdrawals, and deposit addresses
Referrals
7 tablesReferral program and tracking
Webhook Events
9 tablesExternal service webhook events and processing
Relationship Overview
====================================================================== DATABASE RELATIONSHIP OVERVIEW ====================================================================== Account ------- .default_credit_card ──N:1──> fold.CreditCard .created ──1:1──> fold.AccountCreated .account_enabled_features ──N:M──> fold.Feature .shipping_address ──N:1──> fold.AccountAddress .billing_address ──N:1──> fold.AccountAddress Order ----- .transfers ──N:M──> merchant_dash.Transfer .profile ──N:1──> CardForCoinProfile .account_manager ──N:1──> CardForCoinProfile .amount_owed ──N:1──> CurrencyAmount .payments ──N:M──> merchant_dash.Payment .status ──N:1──> OrderStatus .auto_buy_config ──N:1──> AutoBuyConfig Brand ----- .brand_parent ──N:1──> BrandParent .tags ──N:M──> Tag .countries ──N:M──> Country FoldCardTransaction ------------------- .account ──N:1──> fold.Account .card ──N:1──> fold.FoldCardCard .fold_order ──1:1──> fold.Order .group ──N:1──> fold.FoldCardTransactionGroup .transaction_boost ──1:1──> fold.FoldCardTransactionBoost .base_reward_balance_change ──1:1──> fold.BalanceChange .ach_reward_rate ──N:1──> fold.ACHRewardRate .ach_reward_balance_change ──1:1──> fold.BalanceChange .merchant_boost_reward_balance_change ──1:1──> fold.BalanceChange .merchant_boost ──N:1──> fold.MerchantBoost CurrentBalance -------------- .profile ──N:1──> CardForCoinProfile AccountGameReward ----------------- .account ──N:1──> fold.Account .created ──1:1──> fold.AccountGameRewardCreated .balance_change ──1:1──> fold.BalanceChange .extra_spin_entries ──N:M──> fold.AccountGameEntry ====================================================================== SUMMARY ====================================================================== Total Tables: 284 Total Relationships: 367