2025-10-10 12:40:31 +08:00
|
|
|
drop table if exists `goal`;
|
2025-10-01 09:44:35 +08:00
|
|
|
|
2025-10-10 12:40:31 +08:00
|
|
|
CREATE TABLE if not exists `goal`
|
2025-10-01 09:44:35 +08:00
|
|
|
(
|
2025-10-10 12:40:31 +08:00
|
|
|
id INT unsigned auto_increment PRIMARY KEY,
|
2025-10-10 11:41:50 +08:00
|
|
|
status enum ('DOING', 'DONE', 'CANCEL') default 'DOING' not null,
|
|
|
|
create_time DATETIME NULL,
|
|
|
|
update_time DATETIME NULL,
|
2025-10-10 14:49:34 +08:00
|
|
|
type enum ('GOAL', 'TASK', 'HABIT') default 'TASK' NOT NULL,
|
2025-10-10 11:41:50 +08:00
|
|
|
name varchar(100) NOT NULL,
|
|
|
|
tag varchar(100) NULL,
|
2025-10-10 14:53:19 +08:00
|
|
|
detail varchar(100) NULL,
|
|
|
|
root_id int unsigned null,
|
|
|
|
parent_id int unsigned null
|
2025-09-29 19:50:02 +08:00
|
|
|
)
|
2025-10-10 14:49:34 +08:00
|
|
|
COMMENT ='目标管理表';
|
|
|
|
|
|
|
|
drop table if exists `habit_record`;
|
|
|
|
|
|
|
|
create table habit_record
|
|
|
|
(
|
|
|
|
id int unsigned auto_increment
|
|
|
|
primary key,
|
|
|
|
create_time datetime null,
|
|
|
|
update_time datetime null,
|
|
|
|
goal_id int unsigned not null
|
|
|
|
)
|
2025-10-11 16:18:18 +08:00
|
|
|
comment '习惯记录表';
|
|
|
|
|
|
|
|
drop table if exists `anniversary`
|
|
|
|
|
|
|
|
create table `anniversary`
|
|
|
|
(
|
|
|
|
id int unsigned auto_increment,
|
|
|
|
create_time datetime null,
|
|
|
|
update_time datetime null,
|
|
|
|
date date not null comment '重要的日期',
|
|
|
|
type enum ('anniversary', 'commemoration') default 'anniversary' not null
|
|
|
|
)
|
|
|
|
comment '周年纪念日';
|
|
|
|
|