mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
@@ -38,11 +38,22 @@ export default class MySQL extends KnexMySQL implements SchemaInspector {
|
||||
};
|
||||
}
|
||||
|
||||
let dataType = column.data_type.split('(')[0];
|
||||
|
||||
/**
|
||||
* Smooth out a difference between MySQL and MariaDB. MySQL reports the column type as `int
|
||||
* unsigned`, while MariaDB reports it as `int(11) unsigned`. This would cause the `unsigned` part
|
||||
* of the type to be dropped in the columnInfo retrieval for MariaDB powered databases.
|
||||
*/
|
||||
if (column.data_type.includes('unsigned') && dataType.includes('unsigned') === false) {
|
||||
dataType += ' unsigned';
|
||||
}
|
||||
|
||||
overview[column.table_name].columns[column.column_name] = {
|
||||
...column,
|
||||
default_value: column.extra === 'auto_increment' ? 'AUTO_INCREMENT' : parseDefaultValue(column.default_value),
|
||||
is_nullable: column.is_nullable === 'YES',
|
||||
data_type: column.data_type.split('(')[0],
|
||||
data_type: dataType,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user