예제 #1
0
파일: Migrator.php 프로젝트: azema/phigrate
 /**
  * Returns an array of strings which represent version numbers
  * that we *have* migrated
  *
  * @return array
  */
 public function getExecutedMigrations()
 {
     $query_sql = sprintf('SELECT version FROM %s', $this->_adapter->identifier(PHIGRATE_TS_SCHEMA_TBL_NAME));
     $versions = $this->_adapter->selectAll($query_sql);
     $executed = array();
     foreach ($versions as $v) {
         $executed[] = (string) $v['version'];
     }
     sort($executed);
     return $executed;
 }
예제 #2
0
 /**
  * toSql 
  * 
  * @return string
  */
 public function toSql()
 {
     $column_sql = sprintf('%s %s', $this->_adapter->identifier($this->name), $this->_sqlType());
     $column_sql .= $this->_adapter->addColumnOptions($this->type, $this->_options);
     return $column_sql;
 }