20260705214103

This commit is contained in:
oneao committed 2026-07-05 21:41:03 +08:00
1 parent 3556d5e8c1
commit ae99f50f6d
27 files changed
+2945 -3292

No files matched your search

+4
View File
@@ -135,12 +135,14 @@ create table b_meal_slot (
-- ============================================================
-- 餐食安排
-- 同一个家庭、同一天、同一个餐段只有一条记录
-- status: 0=planning(进行中,可修改), 1=completed(已完成,不可修改)
-- ============================================================
create table b_meal_plan (
id bigint primary key,
family_id bigint not null,
plan_date date not null,
meal_slot_id bigint not null,
status smallint not null default 0,
remark varchar(512) default '',
cook_by bigint,
create_time timestamp,
@@ -169,6 +171,7 @@ create table b_meal_plan_item (
-- ============================================================
-- 餐食活动日志
-- type: 1=安排餐食, 2=加菜, 3=移除菜, 4=备注, 5=设置做饭人
-- dish_name: 操作时的菜品名称快照,用于时间轴展示
-- ============================================================
create table b_meal_plan_log (
id bigint primary key,
@@ -177,6 +180,7 @@ create table b_meal_plan_log (
type smallint not null,
content varchar(1024) default '',
ref_id bigint,
dish_name varchar(128) default null,
create_time timestamp,
update_time timestamp,
create_by bigint,
+14
View File
@@ -0,0 +1,14 @@
-- ============================================================
-- 餐食模块 数据库迁移记录
-- ============================================================
-- [已执行] b_meal_plan_log 新增 dish_name 字段:记录操作时的菜品名称快照
-- 用于时间轴展示,即使菜品后续被停用/改名也不影响历史记录
-- ALTER TABLE b_meal_plan_log ADD COLUMN dish_name VARCHAR(128) DEFAULT NULL;
-- [已执行] b_meal_plan 新增 status 字段:菜单状态
-- 0 = planning(进行中,可修改)
-- 1 = completed(已完成,不可修改)
-- ALTER TABLE b_meal_plan ADD COLUMN status SMALLINT NOT NULL DEFAULT 0;
-- 以上迁移已合并到 meal.sql 的完整建表语句中