live-forum/server/webapi/数据库脚本/v1.2.0_post_reply_permission.sql
2026-03-24 11:27:37 +08:00

18 lines
641 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.

-- v1.2.0 帖子回复权限 数据库升级脚本
-- 目标数据库LiveForumDB业务库
-- 说明: 为 T_Posts 表新增 AllowReply 字段,控制帖子是否允许回复
-- =============================================
-- 1. T_Posts 新增 AllowReply 字段
IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID('T_Posts') AND name = 'AllowReply')
BEGIN
ALTER TABLE T_Posts ADD AllowReply BIT NOT NULL DEFAULT 1;
PRINT '✓ T_Posts 表添加 AllowReply 字段成功'
END
ELSE
BEGIN
PRINT '⚠ AllowReply 字段已存在,跳过添加'
END
PRINT 'v1.2.0 帖子回复权限升级脚本执行完成';