mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-13 16:03:04 +00:00
- Simplify few JavaScript usage; - Fix DDNS enable's node clone may cause bug; - Fix System config page, multiple selectors will trigger update function multiple times. 1
36 lines
920 B
PHP
36 lines
920 B
PHP
<?php
|
|
|
|
use App\Models\Config;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
private static array $configs = ['node_renewal_notification'];
|
|
|
|
public function up(): void
|
|
{
|
|
Schema::table('node', static function (Blueprint $table) {
|
|
$table->json('details')->nullable()->comment('节点信息')->after('client_limit');
|
|
});
|
|
|
|
if (Config::exists()) {
|
|
foreach (self::$configs as $config) {
|
|
Config::insert(['name' => $config]);
|
|
}
|
|
}
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::table('node', static function (Blueprint $table) {
|
|
$table->dropColumn('details');
|
|
});
|
|
|
|
foreach (self::$configs as $config) {
|
|
Config::destroy(['name' => $config]);
|
|
}
|
|
}
|
|
};
|