-- Add display_mode column to studies table for card sort visualization mode
-- This allows choosing between 'standard' (traditional card sort) and 'visual_nav' (navigation builder)

ALTER TABLE `studies` ADD COLUMN `display_mode` VARCHAR(20) NOT NULL DEFAULT 'standard' AFTER `sort_type`;

-- Update existing card sort studies to use standard mode
UPDATE `studies` SET `display_mode` = 'standard' WHERE `study_type` = 'card_sort' OR `study_type` IS NULL;

-- Verify the changes
DESCRIBE `studies`;

