Skip to content

Complete Database Export Summary

You were absolutely correct - the `exports/database_export_20250710_010237.sql` file was incomplete and missing critical tables like `job_defaults` and many others required for the Create Booking page.

You were absolutely correct - the exports/database_export_20250710_010237.sql file was incomplete and missing critical tables like job_defaults and many others required for the Create Booking page.

New Complete Export: exports/complete_database_export_fixed.sql

The original export only included:

  • zones (18 records)
  • rate_cards (10 records)
  • service_levels (3 records)
  • crm_customers (basic table)
  • customers (basic table)
  1. Authentication Tables

    • users - Required for Replit Auth
    • oauth - Required for Replit Auth
  2. Location & Zone Management

    • countries - Country definitions
    • states - State/province definitions
    • zones - Service zones (18 existing records)
    • zone_listings - Zone groupings
    • zone_suburbs - Zone-suburb mappings
  3. Customer Management

    • customers - Main customer table
    • customer_addresses - Customer address management
    • companies - Company profiles
  4. CRM System

    • crm_customers - CRM customer records
    • crm_leads - Sales leads
    • crm_customer_notes - Customer notes
    • crm_lead_notes - Lead notes
    • crm_customer_documents - Document management
    • crm_interactions - Customer interactions
    • crm_onboarding - Onboarding workflow
  5. Rate Management

    • rate_cards - Rate card definitions (10 existing records)
    • service_levels - Service level definitions (3 existing records)
    • rate_entries - Rate entry management
    • base_rates - Base rate definitions
    • flat_rates - Flat rate configurations
    • weight_rates - Weight-based rates
    • quantity_rates - Quantity-based rates
    • distance_rates - Distance-based rates
    • time_rates - Time-based rates
    • rate_card_customers - Rate card assignments
    • rate_card_audit - Rate card audit trail
    • service_level_multipliers - Service level multipliers
    • surcharges - Surcharge definitions
  6. Booking & Job Management (CRITICAL FOR CREATE BOOKING PAGE)

    • vehicles - Vehicle fleet management
    • drivers - Driver management
    • routes - Route definitions
    • quotes - Quote management
    • bookings - Booking management
    • freight_jobs - Job management
    • job_defaults - Default values for Create Booking page (21 records)
    • hourly_rate_cards - Hourly rate cards
    • hourly_rates - Hourly rate definitions
  7. Notification System

    • notification_preferences - User notification settings
    • notifications - System notifications
    • push_subscriptions - Push notification subscriptions

The job_defaults table now includes essential default values:

  • Default pickup/delivery times
  • Default service levels
  • Default freight types
  • Default measurement units
  • Default packaging types
  • Default special requirements
  • Default notification settings
  • And 14 other booking-related defaults
  • 18 service zones across Australia
  • 10 rate cards with pricing configurations
  • 3 service levels (Express, Standard, Economy)
  • Complete customer and address management
  • Full rate calculation system

To verify the complete schema is loaded:

-- Check total tables
SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'public';
-- Expected: 37+ tables
-- Check job_defaults table
SELECT COUNT(*) FROM job_defaults;
-- Expected: 21 records
-- Check other key tables
SELECT COUNT(*) FROM zones; -- Expected: 18
SELECT COUNT(*) FROM rate_cards; -- Expected: 10
SELECT COUNT(*) FROM service_levels; -- Expected: 3
  1. Drop existing incomplete database:

    Terminal window
    psql "$DATABASE_URL" -c "DROP SCHEMA public CASCADE; CREATE SCHEMA public;"
  2. Import complete export:

    Terminal window
    psql "$DATABASE_URL" -f exports/complete_database_export_fixed.sql
  3. Verify import:

    Terminal window
    psql "$DATABASE_URL" -c "SELECT COUNT(*) FROM job_defaults;"

Create Booking Page - Now has all required default values
Rate Management - Complete rate calculation system
Customer Management - Full customer and address system
Job Management - Complete booking and job workflow
Zone Management - Complete geographical coverage
Authentication - Replit Auth integration
CRM System - Full customer relationship management
Notification System - Complete notification framework

The new export file is production-ready and includes all tables and data needed for the complete iDrv5-MyFR8 logistics management system.