mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-26 08:11:08 -05:00
Fix JSON storage violations
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
-- Add size constraint to prevent JSON blob storage in content_submissions
|
||||
-- This enforces the architectural rule: "NEVER STORE JSON IN SQL COLUMNS"
|
||||
-- Content should only contain: action + max 2 reference IDs (< 500 bytes)
|
||||
|
||||
ALTER TABLE public.content_submissions
|
||||
ADD CONSTRAINT content_size_check
|
||||
CHECK (pg_column_size(content) < 500);
|
||||
|
||||
COMMENT ON CONSTRAINT content_size_check ON public.content_submissions
|
||||
IS 'Prevents large JSON blobs in content column. Content should only contain action and reference IDs. All actual data goes in submission_items.item_data or specialized relational tables.';
|
||||
Reference in New Issue
Block a user