DatabaseStep: Fix schema checks

The step to setup the database considered any table of foreign schemas
as one of our own schema, causing it to never create our schema for
non-empty databases.

fixes #9799
This commit is contained in:
Johannes Meyer 2015-07-31 11:03:12 +02:00
parent 9b051cd7ce
commit c32b749701
1 changed files with 3 additions and 3 deletions

View File

@ -65,7 +65,7 @@ class DatabaseStep extends Step
$db->reconnect($this->data['resourceConfig']['dbname']);
}
if (array_search(key($this->data['tables']), $db->listTables()) !== false) {
if (array_search(reset($this->data['tables']), $db->listTables()) !== false) {
$this->log(mt('setup', 'Database schema already exists...'));
} else {
$this->log(mt('setup', 'Creating database schema...'));
@ -116,7 +116,7 @@ class DatabaseStep extends Step
$db->reconnect($this->data['resourceConfig']['dbname']);
}
if (array_search(key($this->data['tables']), $db->listTables()) !== false) {
if (array_search(reset($this->data['tables']), $db->listTables()) !== false) {
$this->log(mt('setup', 'Database schema already exists...'));
} else {
$this->log(mt('setup', 'Creating database schema...'));
@ -163,7 +163,7 @@ class DatabaseStep extends Step
try {
$db->connectToDb();
if (array_search(key($this->data['tables']), $db->listTables()) === false) {
if (array_search(reset($this->data['tables']), $db->listTables()) === false) {
if ($resourceConfig['username'] !== $this->data['resourceConfig']['username']) {
$message = sprintf(
mt(