Пример #1
0
 /**
  * Migrates the unit of work into the database
  *
  * @throws \Bytepark\Component\Migration\Exception\QueryNotSuccessfulException
  *
  * @param Connection $connection The connection to migrate to
  */
 public function migrate(Connection $connection)
 {
     $connection->execute($this->getQuery());
 }
Пример #2
0
 /**
  * Setup of the database
  *
  * @return void
  */
 private function setupDatabaseTable()
 {
     $query = sprintf("CREATE TABLE IF NOT EXISTS %s (id INTEGER AUTO_INCREMENT PRIMARY KEY, " . "unique_id VARCHAR(255), query TEXT, migrated_at DATETIME);", $this->tableName);
     $this->connection->execute($query);
 }