migrate_course_sys/1783321230_create_comment.up.sql
2026-07-06 15:10:04 +08:00

11 lines
802 B
SQL
Raw Permalink 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 `comment` (
`id` BIGINT PRIMARY KEY AUTO_INCREMENT COMMENT '评论ID',
`target_type` VARCHAR(30) NOT NULL COMMENT '评论目标类型',
`target_id` INT NOT NULL COMMENT '评论目标ID对应具体表的记录ID',
`user_id` INT NOT NULL COMMENT '评论用户ID',
`parent_id` BIGINT DEFAULT 0 COMMENT '父评论ID0表示顶级评论非0表示回复',
`content` TEXT NOT NULL COMMENT '评论内容',
`status` TINYINT DEFAULT 0 COMMENT '状态1-正常 2-已删除(软删除) 3-待审核 4-违规屏蔽',
`created_at` TIMESTAMP NUll DEFAULT NULL COMMENT '创建时间',
`updated_at` TIMESTAMP NUll DEFAULT NULL COMMENT '更新时间'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = '通用评论表(支持多种内容类型)';