mirror of
https://github.com/cupcakearmy/coolify.git
synced 2024-10-22 08:04:19 +02:00
add DB migration
This commit is contained in:
parent
27a15138b7
commit
b738e5c000
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddServerCleanupEnabledToServerSettingsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('server_settings', function (Blueprint $table) {
|
||||
$table->boolean('force_server_cleanup')->default(false);
|
||||
$table->string('server_cleanup_cron')->default('*/10 * * * *');
|
||||
$table->integer('server_cleanup_threshold')->default(80);
|
||||
|
||||
// Remove old columns
|
||||
$table->dropColumn('is_force_cleanup_enabled');
|
||||
$table->dropColumn('cleanup_after_percentage');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('server_settings', function (Blueprint $table) {
|
||||
$table->dropColumn('force_server_cleanup');
|
||||
$table->dropColumn('server_cleanup_cron');
|
||||
$table->dropColumn('server_cleanup_threshold');
|
||||
|
||||
// Add back old columns
|
||||
$table->boolean('is_force_cleanup_enabled')->default(false);
|
||||
$table->integer('cleanup_after_percentage')->default(80);
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user