-- Add missing columns to studies table
-- Run this SQL in phpMyAdmin or your MySQL client

ALTER TABLE `studies` 
ADD COLUMN `description` TEXT NULL AFTER `title`,
ADD COLUMN `sort_type` VARCHAR(20) NOT NULL DEFAULT 'open' AFTER `description`,
ADD COLUMN `status` VARCHAR(20) NOT NULL DEFAULT 'draft' AFTER `sort_type`,
ADD COLUMN `updated_at` DATETIME NULL AFTER `created_at`;

-- Verify the changes
DESCRIBE `studies`;

