mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-26 08:51:13 -06:00
Implemented how the CreateDatabaseCommand checks if the database tables exist
This commit is contained in:
parent
f78fa58cf1
commit
b68e262eac
@ -66,15 +66,19 @@ class CreateDatabaseCommand extends AbstractDatabaseCommand
|
||||
{
|
||||
$schemaManager = $this->conn->getSchemaManager();
|
||||
$databases = $schemaManager->listDatabases();
|
||||
if (! contains($databases, '')) {
|
||||
$schemaManager->createDatabase($this->conn->getDatabase());
|
||||
$shlinkDatabase = $this->conn->getDatabase();
|
||||
|
||||
if (! contains($databases, $shlinkDatabase)) {
|
||||
$schemaManager->createDatabase($shlinkDatabase);
|
||||
}
|
||||
}
|
||||
|
||||
private function schemaExists(): bool
|
||||
{
|
||||
// TODO Implement
|
||||
return false;
|
||||
// If at least one of the shlink tables exist, we will consider the database exists somehow.
|
||||
// Any inconsistency will be taken care by the migrations
|
||||
$schemaManager = $this->conn->getSchemaManager();
|
||||
return ! empty($schemaManager->listTableNames());
|
||||
}
|
||||
|
||||
protected function getLockConfig(): LockedCommandConfig
|
||||
|
Loading…
Reference in New Issue
Block a user