diff --git a/supabase/functions/seed-test-data/index.ts b/supabase/functions/seed-test-data/index.ts index 30ad5903..c606392e 100644 --- a/supabase/functions/seed-test-data/index.ts +++ b/supabase/functions/seed-test-data/index.ts @@ -662,7 +662,7 @@ Deno.serve(async (req) => { } // Create ride models - if (entityTypes.includes('ride_models') && includeDependencies && createdCompanies.manufacturer.length > 0) { + if (entityTypes.includes('ride_models') && includeDependencies && createdSubmissionItems.manufacturer.length > 0) { for (let i = 0; i < plan.rideModels; i++) { const level = getPopulationLevel(fieldDensity, i); const { data: mfgData } = await supabase.from('companies').select('id').eq('slug', randomItem(createdCompanies.manufacturer)).maybeSingle(); diff --git a/supabase/migrations/20251010175728_1aafe1aa-27d1-4e11-8f35-8296b2b111ba.sql b/supabase/migrations/20251010175728_1aafe1aa-27d1-4e11-8f35-8296b2b111ba.sql new file mode 100644 index 00000000..df2709fb --- /dev/null +++ b/supabase/migrations/20251010175728_1aafe1aa-27d1-4e11-8f35-8296b2b111ba.sql @@ -0,0 +1,20 @@ +-- Drop existing constraint +ALTER TABLE public.content_submissions +DROP CONSTRAINT IF EXISTS content_submissions_submission_type_check; + +-- Add updated constraint including ride_model +ALTER TABLE public.content_submissions +ADD CONSTRAINT content_submissions_submission_type_check +CHECK (submission_type IN ( + 'park', + 'ride', + 'review', + 'photo', + 'manufacturer', + 'operator', + 'designer', + 'property_owner', + 'photo_edit', + 'photo_delete', + 'ride_model' +)); \ No newline at end of file