fix: only enable Sentinel for new servers
This commit is contained in:
parent
8c53af088e
commit
f600c1b37d
2 changed files with 9 additions and 1 deletions
|
|
@ -55,6 +55,14 @@ class ServerSetting extends Model
|
||||||
'docker_cleanup_threshold' => 'integer',
|
'docker_cleanup_threshold' => 'integer',
|
||||||
'sentinel_token' => 'encrypted',
|
'sentinel_token' => 'encrypted',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
protected static function booted()
|
||||||
|
{
|
||||||
|
static::creating(function ($setting) {
|
||||||
|
$setting->is_sentinel_enabled = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public function server()
|
public function server()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Server::class);
|
return $this->belongsTo(Server::class);
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ public function up(): void
|
||||||
$table->dropColumn('metrics_history_days');
|
$table->dropColumn('metrics_history_days');
|
||||||
$table->dropColumn('is_server_api_enabled');
|
$table->dropColumn('is_server_api_enabled');
|
||||||
|
|
||||||
$table->boolean('is_sentinel_enabled')->default(true);
|
$table->boolean('is_sentinel_enabled')->default(false);
|
||||||
$table->text('sentinel_token')->nullable();
|
$table->text('sentinel_token')->nullable();
|
||||||
$table->integer('sentinel_metrics_refresh_rate_seconds')->default(10);
|
$table->integer('sentinel_metrics_refresh_rate_seconds')->default(10);
|
||||||
$table->integer('sentinel_metrics_history_days')->default(7);
|
$table->integer('sentinel_metrics_history_days')->default(7);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue