mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
fix(previews): keep production values for previews from before the upgrade
Public pull request previews no longer get production values, and no preview falls back to production variables. Existing previews were deployed with these values; for example, their databases were initialized with the production password, so they broke on redeploy. Previews that exist at the upgrade get keeps_production_values and keep the earlier behavior. Previews created later do not. Server transfer moves the flag.
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
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
|
||||
{
|
||||
/**
|
||||
* Until v4.5.1, previews used production values: the production variables that had no preview copy,
|
||||
* and on public pull requests also the preview copies with the production value. Existing previews
|
||||
* keep them, so their databases and services keep working. Previews created later do not get them.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('application_previews', function (Blueprint $table) {
|
||||
$table->boolean('keeps_production_values')->default(false);
|
||||
});
|
||||
|
||||
DB::table('application_previews')->update(['keeps_production_values' => true]);
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('application_previews', function (Blueprint $table) {
|
||||
$table->dropColumn('keeps_production_values');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user