-- Migration 002: Add unique content code to generated_content
-- Run via: http://localhost/Content/migrate.php

ALTER TABLE `generated_content`
  ADD COLUMN IF NOT EXISTS `content_code` VARCHAR(20) DEFAULT NULL AFTER `id`;

-- Add unique index only if it doesn't exist
CREATE UNIQUE INDEX IF NOT EXISTS `ux_content_code` ON `generated_content` (`content_code`);
