Пример #1
0
 /**
  * Loads the width of all columns in the MySQL schema into $columns.
  */
 private function getColumns()
 {
     $rows = DataLayer::getAllTableColumns();
     foreach ($rows as $row) {
         $row['length'] = DataTypeHelper::deriveFieldLength($row);
         $this->columns[$row['table_name']][$row['column_name']] = $row;
     }
 }
Пример #2
0
 /**
  * Selects schema, table, column names and the column type from MySQL and saves them as replace pairs.
  */
 private function getColumnTypes()
 {
     $rows = DataLayer::getAllTableColumns();
     foreach ($rows as $row) {
         $key = '@' . $row['table_name'] . '.' . $row['column_name'] . '%type@';
         $key = strtoupper($key);
         $value = $row['column_type'];
         if (isset($row['character_set_name'])) {
             $value .= ' character set ' . $row['character_set_name'];
         }
         $this->myReplacePairs[$key] = $value;
     }
     $this->io->text(sprintf('Selected %d column types for substitution', sizeof($rows)));
 }