Files
zyt/server/database/migrations/create_prescription_library.sql
T
2026-03-23 18:02:16 +08:00

17 lines
964 B
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 IF NOT EXISTS `zyt_prescription_library` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`prescription_name` varchar(100) NOT NULL DEFAULT '' COMMENT '处方名称',
`herbs` text COMMENT '药材列表JSON[{name, dosage}]',
`is_public` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否公开:0-仅自己可见 1-所有人可见',
`creator_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建人ID',
`creator_name` varchar(50) NOT NULL DEFAULT '' COMMENT '创建人姓名',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`delete_time` int(10) unsigned DEFAULT NULL COMMENT '删除时间',
PRIMARY KEY (`id`),
KEY `idx_creator` (`creator_id`),
KEY `idx_is_public` (`is_public`),
KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='处方库表';