migrate_course_sys/1781687373_create_category.up.sql
2026-06-18 11:13:32 +08:00

10 lines
648 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 `category` (
`id` INT PRIMARY KEY AUTO_INCREMENT COMMENT '分类ID',
`parent_id` INT DEFAULT 0 COMMENT '父分类ID0表示顶级分类',
`name` VARCHAR(100) NOT NULL COMMENT '分类名称',
`description` VARCHAR(255) COMMENT '分类描述',
`sort_order` INT DEFAULT 0 COMMENT '排序权重(数字越小越靠前)',
`is_active` TINYINT DEFAULT 1 COMMENT '是否启用1-禁用 2-启用',
`created_at` TIMESTAMP NULL DEFAULT NULL COMMENT '创建时间',
`updated_at` TIMESTAMP NULL DEFAULT NULL COMMENT '更新时间'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = '课程系列分类表';