Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

add DB migration

ayntk-aib738e5c00008
diff --git a/database/migrations/2024_08_09_215659_add_server_cleanup_fields_to_server_settings_table.php b/database/migrations/2024_08_09_215659_add_server_cleanup_fields_to_server_settings_table.php
new file mode 100644
index 0000000000..e4715b228c
--- /dev/null
+++ b/database/migrations/2024_08_09_215659_add_server_cleanup_fields_to_server_settings_table.php
@@ -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);
+ });
+ }
+}
\ No newline at end of file