This commit is contained in:
2025-10-23 22:35:10 +01:00
parent 56ff4132b4
commit 5cedba21e7
6 changed files with 970 additions and 2782 deletions
+2 -1
View File
@@ -14,8 +14,8 @@ CREATE TYPE account_role AS ENUM ('unverified_email', 'verified_email', 'admin',
CREATE TYPE account_type AS ENUM ('email', 'google', 'microsoft', 'facebook', 'guest');
CREATE TYPE payment_type AS ENUM ('deposit', 'full', 'tip', 'balance', 'partial');
CREATE TYPE payment_method AS ENUM ('online_square', 'in_person_card', 'cash', 'giftcard', 'discount');
CREATE TYPE booking_status AS ENUM ('pending', 'confirmed', 'in_progress', 'completed', 'client_cancelled', 'we_cancelled', 're-schedule', 'no_show');
CREATE TYPE payment_status AS ENUM ('pending', 'completed', 'failed', 'refunded');
CREATE TYPE booking_status AS ENUM ('pending', 'confirmed', 'in_progress', 'completed', 'client_cancelled', 'we_cancelled', 're-schedule', 'no_show');
-- =======================================
-- SHORT ID GENERATION
@@ -130,6 +130,7 @@ CREATE TABLE user_referrals (
referrer_id CHAR(12) NOT NULL REFERENCES users(id) ON DELETE CASCADE,
referred_id CHAR(12) NOT NULL REFERENCES users(id) ON DELETE CASCADE,
referred_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
claimed_booking_id CHAR(12) REFERENCES bookings(id) ON DELETE SET NULL,
PRIMARY KEY (referrer_id, referred_id)
);