From 9c5a75859ee204a75309e2c711cc87362ced95e5 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Thu, 5 Dec 2024 22:33:10 +0100 Subject: [PATCH] Create 2024_12_05_212355_create_email_notification_settings_table.php --- ...eate_email_notification_settings_table.php | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 database/migrations/2024_12_05_212355_create_email_notification_settings_table.php diff --git a/database/migrations/2024_12_05_212355_create_email_notification_settings_table.php b/database/migrations/2024_12_05_212355_create_email_notification_settings_table.php new file mode 100644 index 000000000..45b106827 --- /dev/null +++ b/database/migrations/2024_12_05_212355_create_email_notification_settings_table.php @@ -0,0 +1,57 @@ +id(); + $table->foreignId('team_id')->constrained()->cascadeOnDelete(); + + // SMTP Configuration + $table->boolean('smtp_enabled')->default(false); + $table->string('smtp_from_address')->nullable(); + $table->string('smtp_from_name')->nullable(); + $table->string('smtp_recipients')->nullable(); + $table->string('smtp_host')->nullable(); + $table->integer('smtp_port')->nullable(); + $table->string('smtp_encryption')->nullable(); + $table->text('smtp_username')->nullable(); + $table->text('smtp_password')->nullable(); + $table->integer('smtp_timeout')->nullable(); + + $table->boolean('use_instance_email_settings')->default(false); + + // Resend Configuration + $table->boolean('resend_enabled')->default(false); + $table->encryptedText('resend_api_key')->nullable(); + + // Notification Settings + $table->boolean('deployment_success_email_notification')->default(false); + $table->boolean('deployment_failure_email_notification')->default(true); + $table->boolean('backup_success_email_notification')->default(false); + $table->boolean('backup_failure_email_notification')->default(true); + $table->boolean('scheduled_task_success_email_notification')->default(false); + $table->boolean('scheduled_task_failure_email_notification')->default(true); + $table->boolean('status_change_email_notification')->default(false); + $table->boolean('server_disk_usage_email_notification')->default(true); + + $table->unique(['team_id']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('email_notification_settings'); + } +};