fix: test migration cleanup for discount types/tables, fix type ordering in init-script
- Add new discount types to testdb.Migrate drop list (campaign_type, milestone_type, etc.) - Add new discount tables to testdb.Migrate drop order and TruncateTables - Move discount type definitions to top of init-script.sql with other enums - Remove duplicate type definitions that were after admin_notification_reason - Types must be defined before tables that reference them
This commit is contained in:
@@ -17,6 +17,11 @@ 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 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', 'no_deposit');
|
||||
CREATE TYPE campaign_type AS ENUM ('time_based', 'milestone');
|
||||
CREATE TYPE milestone_type AS ENUM ('per_user_booking_count', 'global_booking_count', 'anniversary');
|
||||
CREATE TYPE milestone_unit AS ENUM ('bookings', 'months', 'years');
|
||||
CREATE TYPE discount_campaign_scope AS ENUM ('all_bookings', 'first_booking_only', 'new_customers_only');
|
||||
CREATE TYPE discount_campaign_status AS ENUM ('draft', 'active', 'completed', 'cancelled');
|
||||
|
||||
-- =======================================
|
||||
-- SHORT ID GENERATION
|
||||
@@ -520,13 +525,6 @@ INSERT INTO business_settings (
|
||||
|
||||
CREATE TYPE admin_notification_reason AS ENUM ('pending_booking', 'cancelled_booking', 'rescheduled_booking', '1_week_no_pay', '1_month_no_pay', 'affiliate_claim', 'late_cancellation', 'no_deposit', 'deposit_paid', 'edit_request');
|
||||
|
||||
-- Loyalty/Discount System ENUMs
|
||||
CREATE TYPE campaign_type AS ENUM ('time_based', 'milestone');
|
||||
CREATE TYPE milestone_type AS ENUM ('per_user_booking_count', 'global_booking_count', 'anniversary');
|
||||
CREATE TYPE milestone_unit AS ENUM ('bookings', 'months', 'years');
|
||||
CREATE TYPE discount_campaign_scope AS ENUM ('all_bookings', 'first_booking_only', 'new_customers_only');
|
||||
CREATE TYPE discount_campaign_status AS ENUM ('draft', 'active', 'completed', 'cancelled');
|
||||
|
||||
CREATE TABLE admin_notifications (
|
||||
id SERIAL PRIMARY KEY,
|
||||
reason admin_notification_reason NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user