Esempio n. 1
0
 /**
  * Create the database schema
  *
  * Creates a new database schema based on the current mapping information.
  *
  * It expects the database to be empty, if tables that are to be created already
  * exist, this will lead to errors.
  *
  * @param string $output A file to write SQL to, instead of executing it
  * @return void
  * @see typo3.flow3:doctrine:update
  * @see typo3.flow3:doctrine:migrate
  */
 public function createCommand($output = NULL)
 {
     // "driver" is used only for Doctrine, thus we (mis-)use it here
     // additionally, when no path is set, skip this step, assuming no DB is needed
     if ($this->settings['backendOptions']['driver'] !== NULL && $this->settings['backendOptions']['host'] !== NULL) {
         $this->doctrineService->createSchema($output);
         if ($output === NULL) {
             $this->outputLine('Created database schema.');
         } else {
             $this->outputLine('Wrote schema creation SQL to file "' . $output . '".');
         }
     } else {
         $this->outputLine('Database schema creation has been SKIPPED, the driver and host backend options are not set in /Configuration/Settings.yaml.');
         $this->quit(1);
     }
 }