first commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
CREATE TABLE `collects` (
|
||||
`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 '删除人',
|
||||
`collect_type` TINYINT NOT NULL DEFAULT 0 COMMENT '业务类型 1=社区穿搭',
|
||||
`target_id` BIGINT NOT NULL DEFAULT 0 COMMENT '业务目标ID',
|
||||
`user_id` BIGINT NOT NULL DEFAULT 0 COMMENT '收藏用户ID',
|
||||
`status` TINYINT NOT NULL DEFAULT 0 COMMENT '状态 1=已收藏 0=已取消',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_collect_user_target` (`collect_type`, `target_id`, `user_id`),
|
||||
KEY `idx_collects_user` (`user_id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = '收藏表';
|
||||
|
||||
CREATE TABLE `likes` (
|
||||
`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 '删除人',
|
||||
`like_type` TINYINT NOT NULL DEFAULT 0 COMMENT '业务类型 1=社区穿搭',
|
||||
`target_id` BIGINT NOT NULL DEFAULT 0 COMMENT '业务目标ID',
|
||||
`user_id` BIGINT NOT NULL DEFAULT 0 COMMENT '点赞用户ID',
|
||||
`status` TINYINT NOT NULL DEFAULT 0 COMMENT '状态 1=已点赞 0=已取消',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_like_user_target` (`like_type`, `target_id`, `user_id`),
|
||||
KEY `idx_likes_user` (`user_id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = '点赞表';
|
||||
Reference in New Issue
Block a user