From 22e6734ce3dc3d246837bb05e2df47fc5c07f224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B1=95=E9=B9=8F?= Date: Wed, 19 Nov 2025 01:15:32 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=95=B0=E6=8D=AE=E5=BA=93):=20?= =?UTF-8?q?=E7=A7=BB=E9=99=A4updated=5Fat=E5=AD=97=E6=AE=B5=E7=9A=84?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=9B=B4=E6=96=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改packages和bookings表的updated_at字段,从自动更新改为可空字段,以提供更灵活的时间戳控制 --- carwash_db.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/carwash_db.sql b/carwash_db.sql index 57e7259..5ce2200 100644 --- a/carwash_db.sql +++ b/carwash_db.sql @@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS packages ( services TEXT NOT NULL COMMENT '包含的服务项目(用逗号分隔)', is_active BOOLEAN DEFAULT TRUE, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + updated_at TIMESTAMP NULL ); -- 修改预约表支持时间段 @@ -32,7 +32,7 @@ CREATE TABLE IF NOT EXISTS bookings ( notes TEXT, status ENUM('待确认', '已确认', '进行中', '已完成', '已取消') DEFAULT '待确认', created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + updated_at TIMESTAMP NULL, FOREIGN KEY (package_id) REFERENCES packages(id) ON DELETE SET NULL );