Files
zt-closet-backend/pkg/migration/000015_create_horoscopes.up.sql
T
2026-09-11 01:41:52 +08:00

21 lines
1.4 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
CREATE TABLE `horoscopes` (
`id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`created_at` BIGINT NOT NULL DEFAULT 0 COMMENT '创建时间',
`updated_at` BIGINT NOT NULL DEFAULT 0 COMMENT '更新时间',
`deleted_at` BIGINT NOT NULL DEFAULT 0 COMMENT '删除时间(0 表示未删除)',
`created_by` BIGINT NOT NULL DEFAULT 0 COMMENT '创建人',
`updated_by` BIGINT NOT NULL DEFAULT 0 COMMENT '更新人',
`deleted_by` BIGINT NOT NULL DEFAULT 0 COMMENT '删除人',
`stat_date` BIGINT NOT NULL DEFAULT 0 COMMENT '运势日期(YYYYMMDD)',
`zodiac` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '星座',
`overall_score` TINYINT NOT NULL DEFAULT 0 COMMENT '综合运势 1-5分',
`love_score` TINYINT NOT NULL DEFAULT 0 COMMENT '爱情运势 1-5分',
`career_score` TINYINT NOT NULL DEFAULT 0 COMMENT '工作运势 1-5分',
`wealth_score` TINYINT NOT NULL DEFAULT 0 COMMENT '财富运势 1-5分',
`daily_text` TEXT COMMENT '今日运势详情',
`lucky_color` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '幸运色',
`lucky_number` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '幸运数字',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_horoscope_date_zodiac` (`stat_date`, `zodiac`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = '星座运势表';