diff options
Diffstat (limited to 'lib/mysqlschema.php')
-rw-r--r-- | lib/mysqlschema.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/mysqlschema.php b/lib/mysqlschema.php index d3b463c10..e4d91ffa0 100644 --- a/lib/mysqlschema.php +++ b/lib/mysqlschema.php @@ -134,12 +134,15 @@ class MysqlSchema extends Schema $field['description'] = $row['COLUMN_COMMENT']; } - // $row['EXTRA'] may contain 'autoincrement' - // ^ type=serial? - // $row['EXTRA'] may contain 'on update CURRENT_TIMESTAMP' - // ^ ...... how to specify? - // these seem to be the only values in curent use - + $extra = $row['EXTRA']; + if ($extra) { + if (preg_match('/(^|\s)auto_increment(\s|$)/i', $extra)) { + $field['type'] = 'serial'; + } + // $row['EXTRA'] may contain 'on update CURRENT_TIMESTAMP' + // ^ ...... how to specify? + } + if ($row['CHARACTER_SET_NAME'] !== null) { // @fixme check against defaults? //$def['charset'] = $row['CHARACTER_SET_NAME']; |