CREATE TABLE `disciplinary_actions` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `user_id` INT(11) NOT NULL,
  `action_type` VARCHAR(50) NOT NULL COMMENT '예: warning, reprimand, suspension',
  `reason` TEXT NOT NULL,
  `related_handover_id` INT(11) NULL DEFAULT NULL,
  `action_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `issued_by_id` INT(11) NOT NULL,
  `status` VARCHAR(50) NOT NULL DEFAULT 'active' COMMENT '예: active, resolved',
  PRIMARY KEY (`id`),
  INDEX `user_id` (`user_id`),
  INDEX `issued_by_id` (`issued_by_id`),
  INDEX `related_handover_id` (`related_handover_id`),
  CONSTRAINT `fk_disciplinary_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_disciplinary_issuer` FOREIGN KEY (`issued_by_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_disciplinary_handover` FOREIGN KEY (`related_handover_id`) REFERENCES `handoff_logs` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
