Fix detection of auto_increment fields in MySQL (sets them as 'serial' type)
This commit is contained in:
parent
3c979ec506
commit
85156fcbed
|
@ -134,11 +134,14 @@ class MysqlSchema extends Schema
|
||||||
$field['description'] = $row['COLUMN_COMMENT'];
|
$field['description'] = $row['COLUMN_COMMENT'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// $row['EXTRA'] may contain 'autoincrement'
|
$extra = $row['EXTRA'];
|
||||||
// ^ type=serial?
|
if ($extra) {
|
||||||
|
if (preg_match('/(^|\s)auto_increment(\s|$)/i', $extra)) {
|
||||||
|
$field['type'] = 'serial';
|
||||||
|
}
|
||||||
// $row['EXTRA'] may contain 'on update CURRENT_TIMESTAMP'
|
// $row['EXTRA'] may contain 'on update CURRENT_TIMESTAMP'
|
||||||
// ^ ...... how to specify?
|
// ^ ...... how to specify?
|
||||||
// these seem to be the only values in curent use
|
}
|
||||||
|
|
||||||
if ($row['CHARACTER_SET_NAME'] !== null) {
|
if ($row['CHARACTER_SET_NAME'] !== null) {
|
||||||
// @fixme check against defaults?
|
// @fixme check against defaults?
|
||||||
|
|
Loading…
Reference in New Issue
Block a user