20 lines
593 B
SQL
20 lines
593 B
SQL
-- Fixed slot count: NULL = unlimited list; 1 for single; N for a row of N uploaders
|
|
|
|
ALTER TABLE website_image_slots
|
|
ADD COLUMN IF NOT EXISTS item_count INTEGER;
|
|
|
|
ALTER TABLE website_image_slots
|
|
DROP CONSTRAINT IF EXISTS website_image_slots_item_count_check;
|
|
|
|
ALTER TABLE website_image_slots
|
|
ADD CONSTRAINT website_image_slots_item_count_check
|
|
CHECK (item_count IS NULL OR item_count >= 1);
|
|
|
|
UPDATE website_image_slots
|
|
SET item_count = 1
|
|
WHERE kind = 'single' AND item_count IS NULL;
|
|
|
|
UPDATE website_image_slots
|
|
SET item_count = 2
|
|
WHERE slot_key = 'two-banner-row' AND kind = 'list';
|