chore: 重写初始提交(清空历史,整理后全量提交)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace addon\forum\library;
|
||||
|
||||
use ywxapp\model\BaseModel;
|
||||
|
||||
/**
|
||||
* 论坛(forum)插件专属表结构自愈。
|
||||
*
|
||||
* 归属原则:forum_* 表属于 forum 插件私有表,其列兜底逻辑内聚在本插件,
|
||||
* 不污染核心框架 ywxapp/library/BaseModel 自愈引擎(核心只保留通用引擎)。
|
||||
*/
|
||||
class ForumSchema
|
||||
{
|
||||
/**
|
||||
* 补齐 forum_topic 扩展列(审核结论 / 经纬度),幂等。
|
||||
* 建表由插件 install.sql 负责,此处仅做运行时兜底(老库 / 全新安装后结构差异)。
|
||||
*/
|
||||
public static function ensure(): void
|
||||
{
|
||||
$prefix = BaseModel::currentPrefix();
|
||||
$p = $prefix;
|
||||
BaseModel::ensureColumn("{$p}forum_topic", 'audit_reason', "varchar(255) NOT NULL DEFAULT '' COMMENT '审核结论/驳回理由'");
|
||||
BaseModel::ensureColumn("{$p}forum_topic", 'lat', "decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT '纬度(可选)'");
|
||||
BaseModel::ensureColumn("{$p}forum_topic", 'lng', "decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT '经度(可选)'");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user