summaryrefslogtreecommitdiffstats
path: root/core/Command
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-07-19 11:17:04 +0200
committerJoas Schilling <coding@schilljs.com>2017-07-25 12:47:39 +0200
commit9307aaee498eae9fb0e1b5e802be88c2e572127d (patch)
tree63f6f999152803c25e061434788b2411197c56ac /core/Command
parent242c9ee06cdde73dfc3c0901393a0c7f30ae5680 (diff)
downloadnextcloud-server-9307aaee498eae9fb0e1b5e802be88c2e572127d.tar.gz
nextcloud-server-9307aaee498eae9fb0e1b5e802be88c2e572127d.zip
Core is converted, so this is dead code
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'core/Command')
-rw-r--r--core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php16
1 files changed, 7 insertions, 9 deletions
diff --git a/core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php b/core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php
index 38f8d82b961..54a4d95738e 100644
--- a/core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php
+++ b/core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php
@@ -65,17 +65,15 @@ class GenerateFromSchemaFileCommand extends GenerateCommand {
return 1;
}
- $reader = new MDB2SchemaReader($this->config, $this->connection->getDatabasePlatform());
- $schema = new Schema();
- if ($appName === 'core') {
- $reader->loadSchemaFromFile(\OC::$SERVERROOT . '/db_structure.xml', $schema);
- } else {
- if (!file_exists($this->appManager->getAppPath($appName) . '/appinfo/database.xml')) {
- throw new \RuntimeException('App ' . $appName . ' does not have a database.xml file');
- }
- $reader->loadSchemaFromFile($this->appManager->getAppPath($appName) . '/appinfo/database.xml', $schema);
+ $schemaFile = $this->appManager->getAppPath($appName) . '/appinfo/database.xml';
+ if (!file_exists($schemaFile)) {
+ $output->writeln('<error>App ' . $appName . ' does not have a database.xml file</error>');
+ return 2;
}
+ $reader = new MDB2SchemaReader($this->config, $this->connection->getDatabasePlatform());
+ $schema = new Schema();
+ $reader->loadSchemaFromFile($schemaFile, $schema);
$schemaBody = $this->schemaToMigration($schema);