fixes
This commit is contained in:
@@ -92,6 +92,7 @@ return new class extends Migration
|
||||
|
||||
$table->text('resend_api_key')->nullable();
|
||||
|
||||
$table->boolean('smtp_notifications_test')->default(false);
|
||||
$table->boolean('smtp_notifications_deployments')->default(false);
|
||||
$table->boolean('smtp_notifications_database_backups')->default(true);
|
||||
$table->boolean('smtp_notifications_scheduled_tasks')->default(false);
|
||||
|
@@ -2,6 +2,7 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
@@ -33,6 +34,17 @@ return new class extends Migration
|
||||
|
||||
$table->unique(['team_id']);
|
||||
});
|
||||
$teams = DB::table('teams')->get();
|
||||
|
||||
foreach ($teams as $team) {
|
||||
try {
|
||||
DB::table('slack_notification_settings')->insert([
|
||||
'team_id' => $team->id,
|
||||
]);
|
||||
} catch (\Throwable $e) {
|
||||
\Log::error('Error migrating slack notification settings from teams table: '.$e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -45,11 +45,11 @@ return new class extends Migration
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('instance_settings', function (Blueprint $table) {
|
||||
$table->string('smtp_from_address')->change();
|
||||
$table->string('smtp_from_name')->change();
|
||||
$table->string('smtp_recipients')->change();
|
||||
$table->string('smtp_host')->change();
|
||||
$table->string('smtp_username')->change();
|
||||
$table->string('smtp_from_address')->nullable()->change();
|
||||
$table->string('smtp_from_name')->nullable()->change();
|
||||
$table->string('smtp_recipients')->nullable()->change();
|
||||
$table->string('smtp_host')->nullable()->change();
|
||||
$table->string('smtp_username')->nullable()->change();
|
||||
});
|
||||
|
||||
if (DB::table('instance_settings')->exists()) {
|
||||
|
Reference in New Issue
Block a user