fix: only encrypt instance email settings if there are any
This commit is contained in:
parent
d7a0794bd9
commit
0a851ec3f2
1 changed files with 19 additions and 17 deletions
|
|
@ -21,6 +21,7 @@ public function up(): void
|
|||
$table->text('smtp_username')->nullable()->change();
|
||||
});
|
||||
|
||||
if (DB::table('instance_settings')->exists()) {
|
||||
$settings = DB::table('instance_settings')->get();
|
||||
foreach ($settings as $setting) {
|
||||
try {
|
||||
|
|
@ -36,6 +37,7 @@ public function up(): void
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
|
|
@ -43,11 +45,11 @@ public function up(): void
|
|||
public function down(): void
|
||||
{
|
||||
Schema::table('instance_settings', function (Blueprint $table) {
|
||||
$table->text('smtp_from_address')->nullable()->change();
|
||||
$table->text('smtp_from_name')->nullable()->change();
|
||||
$table->text('smtp_recipients')->nullable()->change();
|
||||
$table->text('smtp_host')->nullable()->change();
|
||||
$table->text('smtp_username')->nullable()->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()) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue