USE kapadokya_db;

CREATE TABLE IF NOT EXISTS content_translations (
  id INT AUTO_INCREMENT PRIMARY KEY,
  entity_type ENUM('category', 'destination', 'post') NOT NULL,
  entity_id INT NOT NULL,
  lang VARCHAR(5) NOT NULL,
  field_name VARCHAR(50) NOT NULL,
  field_value TEXT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  UNIQUE KEY uq_translation (entity_type, entity_id, lang, field_name),
  INDEX idx_entity (entity_type, entity_id),
  INDEX idx_lang (lang)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
