WhiskyPay Database Schema
WhiskyPay uses Supabase (PostgreSQL) for data storage. This page documents the database schema, explaining each table’s purpose and structure.Tables Overview
The database consists of five primary tables:users- Merchant informationtiers- Pricing tiers for each merchantbuyers- Customer purchase recordssessions- Payment session datasignatures- Transaction signature verification
Table Structures
users
Stores information about merchants who use the WhiskyPay system.tiers
Stores pricing information for each merchant’s subscription tiers or products.buyers
Records of customers who have made purchases.sessions
Stores payment session information.signatures
Tracks transaction signatures to prevent double-spending and verify payments.Relationships
- A
user(merchant) can have multipletiers - A
usercan have multiplebuyers - A
usercan create multiplesessions - Each
sessionis associated with oneuser
Migration Scripts
When migrating from other databases (such as MongoDB), you can use the following sample migration script:Database Setup
To create these tables in Supabase, you can use the SQL editor in the Supabase dashboard or run the schema through other PostgreSQL tools. For a complete setup script, refer to the SQL files in the GitHub repository or check themigration-saas-table.sql and new-structure.sql files in the project root.