mirror of
https://github.com/kuaifan/dootask.git
synced 2026-11-02 07:50:33 +00:00
- 删除友盟别名接口、模型、日志清理及 hedeqiang/umeng 依赖,迁移删除 umeng_alias / umeng_logs 表 - 系统配置(默认):通过官方 DooPush 共享通道自助注册租户,按 App 上报的推送 Token 绑定设备 - 自定义:沿用自有 DooPush 应用凭证;关闭:不推送也不记录设备 - 老站点升级后统一为系统配置,原自定义凭证保留 - PushUmengMsg 更名为 PushAppMsg;同步语言包、API 对照表与 ai-kb
36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
||
|
||
use App\Models\Setting;
|
||
use App\Module\Base;
|
||
use Illuminate\Database\Migrations\Migration;
|
||
use Illuminate\Support\Facades\Schema;
|
||
|
||
return new class extends Migration
|
||
{
|
||
/**
|
||
* 移除友盟推送:删除别名、日志表及推送设置中的友盟参数,DooPush 开关迁移为三档模式
|
||
*/
|
||
public function up(): void
|
||
{
|
||
Schema::dropIfExists('umeng_alias');
|
||
Schema::dropIfExists('umeng_logs');
|
||
|
||
$row = Setting::whereName('appPushSetting')->first();
|
||
if ($row) {
|
||
$setting = Base::string2array($row->setting);
|
||
// DooPush 改为三档,升级后统一使用系统配置;原自定义凭证保留,需要时可切回「自定义」。
|
||
$setting['doopush'] = 'system';
|
||
foreach (['push', 'ios_key', 'ios_secret', 'android_key', 'android_secret'] as $key) {
|
||
unset($setting[$key]);
|
||
}
|
||
$row->updateInstance(['setting' => $setting]);
|
||
$row->save();
|
||
}
|
||
}
|
||
|
||
public function down(): void
|
||
{
|
||
// 删除表无法恢复
|
||
}
|
||
};
|