-- migration-version: 20260909_100000_ADD_ORDER_CANCELLED_AT USE `tour_guide`; ALTER TABLE `tour_order` ADD COLUMN `cancelled_at` DATETIME DEFAULT NULL COMMENT '取消时间' AFTER `completed_at`; UPDATE `tour_order` SET `cancelled_at` = COALESCE(`refund_time`, `updated_at`) WHERE `deleted` = 0 AND `status` IN ('CANCELLED', 'REFUNDED') AND `cancelled_at` IS NULL; INSERT INTO `sys_schema_migration` (`version`, `description`) VALUES ('20260909_100000_ADD_ORDER_CANCELLED_AT', 'add explicit order cancellation time');