mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 10:11:13 -05:00
Fix ride submission data loss
Implement the plan to fix critical data loss in ride submissions. This includes: - Storing ride technical specifications, coaster statistics, and name history in submission tables. - Adding missing category-specific fields to the `ride_submissions` table via a new migration. - Updating submission helpers and the edge function to include these new fields. - Fixing the park location Zod schema to include `street_address`.
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
-- Add missing category-specific fields to ride_submissions table
|
||||
-- This ensures all ride category data can flow through the submission pipeline
|
||||
|
||||
ALTER TABLE ride_submissions
|
||||
ADD COLUMN IF NOT EXISTS track_material TEXT[],
|
||||
ADD COLUMN IF NOT EXISTS support_material TEXT[],
|
||||
ADD COLUMN IF NOT EXISTS propulsion_method TEXT[],
|
||||
-- Water ride fields
|
||||
ADD COLUMN IF NOT EXISTS water_depth_cm INTEGER,
|
||||
ADD COLUMN IF NOT EXISTS splash_height_meters NUMERIC,
|
||||
ADD COLUMN IF NOT EXISTS wetness_level TEXT,
|
||||
ADD COLUMN IF NOT EXISTS flume_type TEXT,
|
||||
ADD COLUMN IF NOT EXISTS boat_capacity INTEGER,
|
||||
-- Dark ride fields
|
||||
ADD COLUMN IF NOT EXISTS theme_name TEXT,
|
||||
ADD COLUMN IF NOT EXISTS story_description TEXT,
|
||||
ADD COLUMN IF NOT EXISTS show_duration_seconds INTEGER,
|
||||
ADD COLUMN IF NOT EXISTS animatronics_count INTEGER,
|
||||
ADD COLUMN IF NOT EXISTS projection_type TEXT,
|
||||
ADD COLUMN IF NOT EXISTS ride_system TEXT,
|
||||
ADD COLUMN IF NOT EXISTS scenes_count INTEGER,
|
||||
-- Flat ride fields
|
||||
ADD COLUMN IF NOT EXISTS rotation_type TEXT,
|
||||
ADD COLUMN IF NOT EXISTS motion_pattern TEXT,
|
||||
ADD COLUMN IF NOT EXISTS platform_count INTEGER,
|
||||
ADD COLUMN IF NOT EXISTS swing_angle_degrees NUMERIC,
|
||||
ADD COLUMN IF NOT EXISTS rotation_speed_rpm NUMERIC,
|
||||
ADD COLUMN IF NOT EXISTS arm_length_meters NUMERIC,
|
||||
ADD COLUMN IF NOT EXISTS max_height_reached_meters NUMERIC,
|
||||
-- Kiddie ride fields
|
||||
ADD COLUMN IF NOT EXISTS min_age INTEGER,
|
||||
ADD COLUMN IF NOT EXISTS max_age INTEGER,
|
||||
ADD COLUMN IF NOT EXISTS educational_theme TEXT,
|
||||
ADD COLUMN IF NOT EXISTS character_theme TEXT,
|
||||
-- Transportation ride fields
|
||||
ADD COLUMN IF NOT EXISTS transport_type TEXT,
|
||||
ADD COLUMN IF NOT EXISTS route_length_meters NUMERIC,
|
||||
ADD COLUMN IF NOT EXISTS stations_count INTEGER,
|
||||
ADD COLUMN IF NOT EXISTS vehicle_capacity INTEGER,
|
||||
ADD COLUMN IF NOT EXISTS vehicles_count INTEGER,
|
||||
ADD COLUMN IF NOT EXISTS round_trip_duration_seconds INTEGER;
|
||||
|
||||
COMMENT ON TABLE ride_submissions IS 'Submission data for rides - includes all category-specific fields to prevent data loss during moderation';
|
||||
Reference in New Issue
Block a user