CREATE TABLE IF NOT EXISTS kegiatan_harian_entries (
  id INT AUTO_INCREMENT PRIMARY KEY,
  activity_date DATE NOT NULL,
  job_title VARCHAR(150) NOT NULL,
  unit_name VARCHAR(150) NOT NULL,
  activity_type VARCHAR(150) DEFAULT NULL,
  activity_name TEXT NOT NULL,
  start_time TIME DEFAULT NULL,
  end_time TIME DEFAULT NULL,
  result_note TEXT DEFAULT NULL,
  created_by INT DEFAULT NULL,
  created_by_name VARCHAR(150) DEFAULT NULL,
  created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  updated_at DATETIME NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  INDEX idx_activity_date (activity_date),
  INDEX idx_job_title (job_title),
  INDEX idx_unit_name (unit_name),
  INDEX idx_created_by (created_by)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
