mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-04 10:42:23 +00:00
Merge remote-tracking branch 'origin/main' into next
This commit is contained in:
commit
624fbd93f1
3 files changed
+114
-2
No files matched your search
+4
-2
@@ -31,7 +31,9 @@ docker/coolify-terminal/node_modules
|
||||
/storage/app/ssh/mux
|
||||
/storage/app/tmp
|
||||
/storage/app/debugbar
|
||||
/storage/logs
|
||||
/storage/pail
|
||||
/storage/logs/*
|
||||
!/storage/logs/.gitignore
|
||||
/storage/pail/*
|
||||
!/storage/pail/.gitignore
|
||||
/storage/framework/**
|
||||
!/storage/framework/**/.gitignore
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
<?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 $withinTransaction = false;
|
||||
|
||||
public function up(): void
|
||||
{
|
||||
if (DB::getDriverName() === 'pgsql') {
|
||||
DB::statement('CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_applications_environment_id_all ON applications (environment_id)');
|
||||
DB::statement('CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_docker_cleanup_executions_server_created_at ON docker_cleanup_executions (server_id, created_at DESC)');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (! Schema::hasIndex('applications', 'idx_applications_environment_id_all')) {
|
||||
Schema::table('applications', function (Blueprint $table) {
|
||||
$table->index('environment_id', 'idx_applications_environment_id_all');
|
||||
});
|
||||
}
|
||||
|
||||
if (! Schema::hasIndex('docker_cleanup_executions', 'idx_docker_cleanup_executions_server_created_at')) {
|
||||
Schema::table('docker_cleanup_executions', function (Blueprint $table) {
|
||||
$table->index(['server_id', 'created_at'], 'idx_docker_cleanup_executions_server_created_at');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if (DB::getDriverName() === 'pgsql') {
|
||||
DB::statement('DROP INDEX CONCURRENTLY IF EXISTS idx_docker_cleanup_executions_server_created_at');
|
||||
DB::statement('DROP INDEX CONCURRENTLY IF EXISTS idx_applications_environment_id_all');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (Schema::hasIndex('docker_cleanup_executions', 'idx_docker_cleanup_executions_server_created_at')) {
|
||||
Schema::table('docker_cleanup_executions', function (Blueprint $table) {
|
||||
$table->dropIndex('idx_docker_cleanup_executions_server_created_at');
|
||||
});
|
||||
}
|
||||
|
||||
if (Schema::hasIndex('applications', 'idx_applications_environment_id_all')) {
|
||||
Schema::table('applications', function (Blueprint $table) {
|
||||
$table->dropIndex('idx_applications_environment_id_all');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
<?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 $withinTransaction = false;
|
||||
|
||||
public function up(): void
|
||||
{
|
||||
if (DB::getDriverName() === 'pgsql') {
|
||||
DB::statement('CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_server_settings_server_id ON server_settings (server_id)');
|
||||
DB::statement('CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_team_user_user_id ON team_user (user_id)');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (! Schema::hasIndex('server_settings', 'idx_server_settings_server_id')) {
|
||||
Schema::table('server_settings', function (Blueprint $table) {
|
||||
$table->index('server_id', 'idx_server_settings_server_id');
|
||||
});
|
||||
}
|
||||
|
||||
if (! Schema::hasIndex('team_user', 'idx_team_user_user_id')) {
|
||||
Schema::table('team_user', function (Blueprint $table) {
|
||||
$table->index('user_id', 'idx_team_user_user_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if (DB::getDriverName() === 'pgsql') {
|
||||
DB::statement('DROP INDEX CONCURRENTLY IF EXISTS idx_team_user_user_id');
|
||||
DB::statement('DROP INDEX CONCURRENTLY IF EXISTS idx_server_settings_server_id');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (Schema::hasIndex('team_user', 'idx_team_user_user_id')) {
|
||||
Schema::table('team_user', function (Blueprint $table) {
|
||||
$table->dropIndex('idx_team_user_user_id');
|
||||
});
|
||||
}
|
||||
|
||||
if (Schema::hasIndex('server_settings', 'idx_server_settings_server_id')) {
|
||||
Schema::table('server_settings', function (Blueprint $table) {
|
||||
$table->dropIndex('idx_server_settings_server_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user