-- ============================================
-- Migration 005: Fix LPJ Data Column for Large Photos
-- E-Proposal Komite - MySQL Migration
-- ============================================

-- This migration:
-- 1. Changes lpj_data from JSON to LONGTEXT to handle larger data
-- 2. Increases max_allowed_packet for this session

USE db_proposalkomite;

-- Set max_allowed_packet for this session (16MB)
SET GLOBAL max_allowed_packet = 16777216;

-- Change lpj_data column to LONGTEXT for larger capacity
-- LONGTEXT can hold up to 4GB of data
ALTER TABLE proposals MODIFY COLUMN lpj_data LONGTEXT;

-- Verify the change
DESCRIBE proposals;

SELECT 'Migration 005 completed: lpj_data column changed to LONGTEXT' AS message;
