/**
  * Create the entity table in the database
  *
  * @throws     Exception  If the table is not created
  */
 public function createEntityTable()
 {
     if (!$this->createTable()) {
         throw new Exception(DB::errorInfo()[2], Exception::$ERROR);
     }
 }
Example #2
0
 /**
  * Drop a table
  *
  * @param      string  $command  The command passed with its arguments
  */
 private function dropTable(string $command)
 {
     $args = $this->getArgs($command);
     if ($this->checkTableName($args)) {
         if ($this->confirmAction('DROP the table "' . $args['t'] . '" ? (Y/N)') === 'Y') {
             if (DB::dropTable($args['t'])) {
                 static::ok(static::ACTION_DONE . PHP_EOL);
             } else {
                 static::fail(static::ACTION_FAIL . PHP_EOL . static::tablePrettyPrint(DB::errorInfo()) . PHP_EOL);
             }
         } else {
             static::out(static::ACTION_CANCEL . PHP_EOL);
         }
     }
 }