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.

feat: update default image value for standalone ClickHouse instances

Andras Bacsai6e7ce9d822f9
diff --git a/database/migrations/2024_04_10_091519_create_standalone_clickhouses_table.php b/database/migrations/2024_04_10_091519_create_standalone_clickhouses_table.php
index f7ea310cf0..7433948b99 100644
--- a/database/migrations/2024_04_10_091519_create_standalone_clickhouses_table.php
+++ b/database/migrations/2024_04_10_091519_create_standalone_clickhouses_table.php
@@ -19,7 +19,6 @@ return new class extends Migration
$table->string('clickhouse_admin_user')->default('default');
$table->text('clickhouse_admin_password');
- $table->string('clickhouse_db')->default('default');
$table->boolean('is_log_drain_enabled')->default(false);
$table->boolean('is_include_timestamps')->default(false);
@@ -27,7 +26,7 @@ return new class extends Migration
$table->string('status')->default('exited');
- $table->string('image')->default('clickhouse/clickhouse-server:latest');
+ $table->string('image')->default('bitnami/clickhouse');
$table->boolean('is_public')->default(false);
$table->integer('public_port')->nullable();
diff --git a/database/migrations/2025_10_03_154100_update_clickhouse_image.php b/database/migrations/2025_10_03_154100_update_clickhouse_image.php
new file mode 100644
index 0000000000..e573540373
--- /dev/null
+++ b/database/migrations/2025_10_03_154100_update_clickhouse_image.php
@@ -0,0 +1,32 @@
+<?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
+{
+ public function up()
+ {
+ // Change the default value for the 'image' column
+ Schema::table('standalone_clickhouses', function (Blueprint $table) {
+ $table->string('image')->default('bitnamilegacy/clickhouse')->change();
+ });
+ // Optionally, update any existing rows with the old default to the new one
+ DB::table('standalone_clickhouses')
+ ->where('image', 'bitnami/clickhouse')
+ ->update(['image' => 'bitnamilegacy/clickhouse']);
+ }
+
+ public function down()
+ {
+ Schema::table('standalone_clickhouses', function (Blueprint $table) {
+ $table->string('image')->default('bitnami/clickhouse')->change();
+ });
+ // Optionally, revert any changed values
+ DB::table('standalone_clickhouses')
+ ->where('image', 'bitnamilegacy/clickhouse')
+ ->update(['image' => 'bitnami/clickhouse']);
+ }
+};
diff --git a/database/migrations/2025_11_28_000001_migrate_clickhouse_to_official_image.php b/database/migrations/2025_11_28_000001_migrate_clickhouse_to_official_image.php
index 925b0dd092..4e8528c12e 100644
--- a/database/migrations/2025_11_28_000001_migrate_clickhouse_to_official_image.php
+++ b/database/migrations/2025_11_28_000001_migrate_clickhouse_to_official_image.php
@@ -1,11 +1,11 @@
<?php
+use App\Models\LocalPersistentVolume;
+use App\Models\StandaloneClickhouse;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
-use App\Models\StandaloneClickhouse;
-use App\Models\LocalPersistentVolume;
+use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
@@ -17,22 +17,31 @@ return new class extends Migration
*/
public function up(): void
{
- if (!Schema::hasColumn('standalone_clickhouses', 'clickhouse_db')) {
+ // Add clickhouse_db column if it doesn't exist
+ if (! Schema::hasColumn('standalone_clickhouses', 'clickhouse_db')) {
Schema::table('standalone_clickhouses', function (Blueprint $table) {
$table->string('clickhouse_db')
->default('default')
->after('clickhouse_admin_password');
});
}
+
+ // Change the default value for the 'image' column to the official image
+ Schema::table('standalone_clickhouses', function (Blueprint $table) {
+ $table->string('image')->default('clickhouse/clickhouse-server:latest')->change();
+ });
+
+ // Update existing ClickHouse instances from Bitnami images to official image
StandaloneClickhouse::where(function ($query) {
- $query->where('image', 'like', '%bitnami/clickhouse%')
- ->orWhere('image', 'like', '%bitnamilegacy/clickhouse%');
- })
+ $query->where('image', 'like', '%bitnami/clickhouse%')
+ ->orWhere('image', 'like', '%bitnamilegacy/clickhouse%');
+ })
->update([
'image' => 'clickhouse/clickhouse-server:latest',
- 'clickhouse_db' => DB::raw("COALESCE(clickhouse_db, 'default')")
+ 'clickhouse_db' => DB::raw("COALESCE(clickhouse_db, 'default')"),
]);
+ // Update volume mount paths from Bitnami to official image paths
LocalPersistentVolume::where('resource_type', StandaloneClickhouse::class)
->where('mount_path', '/bitnami/clickhouse')
->update(['mount_path' => '/var/lib/clickhouse']);
@@ -43,8 +52,16 @@ return new class extends Migration
*/
public function down(): void
{
+ // Revert the default value for the 'image' column
+ Schema::table('standalone_clickhouses', function (Blueprint $table) {
+ $table->string('image')->default('bitnamilegacy/clickhouse')->change();
+ });
+
+ // Revert existing ClickHouse instances back to Bitnami image
StandaloneClickhouse::where('image', 'clickhouse/clickhouse-server:latest')
- ->update(['image' => 'bitnami/clickhouse']);
+ ->update(['image' => 'bitnamilegacy/clickhouse']);
+
+ // Revert volume mount paths
LocalPersistentVolume::where('resource_type', StandaloneClickhouse::class)
->where('mount_path', '/var/lib/clickhouse')
->update(['mount_path' => '/bitnami/clickhouse']);