Refactor: Make photo upload reusable

This commit is contained in:
gpt-engineer-app[bot]
2025-09-29 19:34:54 +00:00
parent 4ea5da9f10
commit 63fb0a61aa
6 changed files with 308 additions and 178 deletions

View File

@@ -0,0 +1,18 @@
-- Update content_submissions submission_type to support all entity types
ALTER TABLE public.content_submissions
DROP CONSTRAINT IF EXISTS content_submissions_submission_type_check;
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'
));
COMMENT ON COLUMN public.content_submissions.content IS 'JSONB structure: { title?, photos: Array<{url, caption?, title?, date?, order}>, context: "park"|"ride"|"manufacturer"|"operator"|"designer"|"property_owner", entity_id: string, park_id?: string (legacy), ride_id?: string (legacy), company_id?: string (legacy) }';