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.

Create 2024_12_05_212440_create_telegram_notification_settings_table.php

peaklabs-dev832239bbc76f
diff --git a/database/migrations/2024_12_05_212440_create_telegram_notification_settings_table.php b/database/migrations/2024_12_05_212440_create_telegram_notification_settings_table.php
new file mode 100644
index 0000000000..3a2e8d8a6f
--- /dev/null
+++ b/database/migrations/2024_12_05_212440_create_telegram_notification_settings_table.php
@@ -0,0 +1,54 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ */
+ public function up(): void
+ {
+ Schema::create('telegram_notification_settings', function (Blueprint $table) {
+ $table->id();
+ $table->foreignId('team_id')->constrained()->cascadeOnDelete();
+
+ // Telegram Configuration
+ $table->boolean('telegram_enabled')->default(false);
+ $table->text('telegram_token')->nullable();
+ $table->text('telegram_chat_id')->nullable();
+
+ // Notification Settings
+ $table->boolean('deployment_success_telegram_notification')->default(false);
+ $table->boolean('deployment_failure_telegram_notification')->default(true);
+ $table->boolean('backup_success_telegram_notification')->default(false);
+ $table->boolean('backup_failure_telegram_notification')->default(true);
+ $table->boolean('scheduled_task_success_telegram_notification')->default(false);
+ $table->boolean('scheduled_task_failure_telegram_notification')->default(true);
+ $table->boolean('status_change_telegram_notification')->default(false);
+ $table->boolean('server_disk_usage_telegram_notification')->default(true);
+
+ // Thread IDs for Different Notifications
+ $table->text('telegram_notifications_deployment_success_thread_id')->nullable();
+ $table->text('telegram_notifications_deployment_failure_thread_id')->nullable();
+ $table->text('telegram_notifications_backup_success_thread_id')->nullable();
+ $table->text('telegram_notifications_backup_failure_thread_id')->nullable();
+ $table->text('telegram_notifications_scheduled_task_success_thread_id')->nullable();
+ $table->text('telegram_notifications_scheduled_task_failure_thread_id')->nullable();
+ $table->text('telegram_notifications_status_change_thread_id')->nullable();
+ $table->text('telegram_notifications_server_disk_usage_thread_id')->nullable();
+
+ $table->unique(['team_id']);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::dropIfExists('telegram_notification_settings');
+ }
+};