mirror of
https://github.com/coollabsio/coolify.git
synced 2026-10-29 01:54:37 +08:00
An all-databases MySQL/MariaDB restore also restored the mysql system database, so after the next restart the root and app passwords were the source ones and the MariaDB health check failed. The restore now skips mysql, sys, performance_schema and information_schema by default. The new option "Restore users and privileges" (restore_mysql_users in the API) keeps the old behaviour.
25 lines
697 B
PHP
25 lines
697 B
PHP
<?php
|
|
|
|
namespace App\Support\DatabaseImport;
|
|
|
|
use InvalidArgumentException;
|
|
|
|
readonly class DatabaseImportSource
|
|
{
|
|
public function __construct(
|
|
public string $type,
|
|
public ?string $uploadId = null,
|
|
public ?string $path = null,
|
|
public ?string $s3StorageUuid = null,
|
|
public bool $dumpAll = false,
|
|
public bool $replaceExisting = false,
|
|
public bool $keepOwners = false,
|
|
public ?string $sqliteDatabase = null,
|
|
public bool $restoreMysqlUsers = false,
|
|
) {
|
|
if (! in_array($type, ['upload', 's3', 'server'], true)) {
|
|
throw new InvalidArgumentException('Invalid database import source.');
|
|
}
|
|
}
|
|
}
|