Esempio n. 1
0
 /**
  * Load the Schema information from the database that is configured in the
  * config.json
  * @return boolean
  */
 protected function loadDatabaseSchema()
 {
     $database = $this->createDatabaseInstance();
     $schemaReader = new SchemaReader($database);
     $schemas = $schemaReader->load();
     if (is_null($this->config->getSchemaListToGenerate())) {
         $this->schemas = $schemas;
     } else {
         foreach ($this->config->getSchemaListToGenerate() as $name) {
             if (isset($schemas[$name])) {
                 $this->schemas[$name] = $schemas[$name];
             } else {
                 $this->output->writeln("<error>There is no [{$name}] schema in this database.</error>");
             }
         }
     }
     if (!isset($this->schemas['public'])) {
         $this->output->writeln("<warn>WARNING: The [public] schema from your database was not selected!</warn>");
     }
     return true;
 }