Example #1
0
 public function rename($old, $new)
 {
     //CHANGE [column] old new options
     $options = array();
     $current_type = \ActivePhp\Base::select_one("SHOW COLUMNS FROM " . $this->quoted_table_name . " LIKE '{$old}'");
     $current_type = $current_type["Type"];
     $rename_column_sql = $this->alter_table_sql() . 'CHANGE ' . Migration::quote_column_name($old) . ' ' . Migration::quote_column_name($new) . ' ' . $current_type;
     array_push($this->columns, $rename_column_sql);
 }
Example #2
0
 /**
  * Quotes each column name
  * @see Migration::quote_column_name
  */
 public static function quote_column_names($columns)
 {
     (array) ($out = array());
     foreach ($columns as $column) {
         array_push($out, Migration::quote_column_name($column));
     }
     return $out;
 }