mirror of
https://github.com/coollabsio/coolify.git
synced 2026-10-03 12:37:14 -04:00
feat(commands): include sqlite in cleanup and delete commands
This commit is contained in:
@@ -18,6 +18,7 @@ use App\Models\StandaloneMongodb;
|
||||
use App\Models\StandaloneMysql;
|
||||
use App\Models\StandalonePostgresql;
|
||||
use App\Models\StandaloneRedis;
|
||||
use App\Models\StandaloneSqlite;
|
||||
use App\Models\Tag;
|
||||
use App\Models\Team;
|
||||
use App\Support\ValidationPatterns;
|
||||
@@ -49,6 +50,7 @@ class CleanupNames extends Command
|
||||
'StandaloneKeydb' => StandaloneKeydb::class,
|
||||
'StandaloneDragonfly' => StandaloneDragonfly::class,
|
||||
'StandaloneClickhouse' => StandaloneClickhouse::class,
|
||||
'StandaloneSqlite' => StandaloneSqlite::class,
|
||||
'S3Storage' => S3Storage::class,
|
||||
'Tag' => Tag::class,
|
||||
'PrivateKey' => PrivateKey::class,
|
||||
|
||||
@@ -21,6 +21,7 @@ use App\Models\StandaloneMongodb;
|
||||
use App\Models\StandaloneMysql;
|
||||
use App\Models\StandalonePostgresql;
|
||||
use App\Models\StandaloneRedis;
|
||||
use App\Models\StandaloneSqlite;
|
||||
use App\Models\Team;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
@@ -180,6 +181,15 @@ class CleanupStuckedResources extends Command
|
||||
} catch (\Throwable $e) {
|
||||
echo "Error in cleaning stuck mariadb: {$e->getMessage()}\n";
|
||||
}
|
||||
try {
|
||||
$sqlites = StandaloneSqlite::withTrashed()->whereNotNull('deleted_at')->lazyById();
|
||||
foreach ($sqlites as $sqlite) {
|
||||
echo "Deleting stuck sqlite: {$sqlite->name}\n";
|
||||
DeleteResourceJob::dispatch($sqlite);
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
echo "Error in cleaning stuck sqlite: {$e->getMessage()}\n";
|
||||
}
|
||||
try {
|
||||
$services = Service::withTrashed()->whereNotNull('deleted_at')->lazyById();
|
||||
foreach ($services as $service) {
|
||||
|
||||
@@ -77,6 +77,7 @@ class CleanupUnverifiedUsers extends Command
|
||||
->orWhereHas('projects.keydbs')
|
||||
->orWhereHas('projects.dragonflies')
|
||||
->orWhereHas('projects.clickhouses')
|
||||
->orWhereHas('projects.sqlites')
|
||||
->orWhereHas('projects.services');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ use App\Models\StandaloneMongodb;
|
||||
use App\Models\StandaloneMysql;
|
||||
use App\Models\StandalonePostgresql;
|
||||
use App\Models\StandaloneRedis;
|
||||
use App\Models\StandaloneSqlite;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
use function Laravel\Prompts\confirm;
|
||||
@@ -170,6 +171,13 @@ class ServicesDelete extends Command
|
||||
$databaseOptions->put($key, "{$db->name} (ClickHouse)");
|
||||
}
|
||||
|
||||
// Add SQLite databases
|
||||
foreach (StandaloneSqlite::all() as $db) {
|
||||
$key = "sqlite_{$db->id}";
|
||||
$allDatabases->put($key, $db);
|
||||
$databaseOptions->put($key, "{$db->name} (SQLite)");
|
||||
}
|
||||
|
||||
if ($allDatabases->count() === 0) {
|
||||
$this->error('There are no databases to delete.');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user