예제 #1
0
파일: DbInit.php 프로젝트: sigma-z/dive
 /**
  * (re)create table
  *
  * @param DriverInterface $driver
  * @param string          $tableName
  */
 private function createTable(DriverInterface $driver, $tableName)
 {
     /** @var $createMigration Migration */
     $createMigration = $driver->createSchemaMigration($this->conn, $tableName, MigrationInterface::CREATE_TABLE);
     $createMigration->importFromSchema($this->schema);
     if ($this->conn->getScheme() === 'mysql') {
         // TODO tableOptions should be defined by Schema
         $createMigration->setTableOption('engine', 'InnoDB');
         $createMigration->setTableOption('collation', 'utf8_unicode_ci');
     }
     $createMigration->execute();
 }
예제 #2
0
파일: Connection.php 프로젝트: sigma-z/dive
 /**
  * @return string
  */
 public function getDatabaseName()
 {
     return $this->driver->getDatabaseName($this);
 }