fix: unique keys not recognized in table settings on some MariaDB versions

This commit is contained in:
Fabio Di Stasio 2023-05-30 18:33:37 +02:00
parent 53a71d55c5
commit 446199827b
1 changed files with 2 additions and 2 deletions

View File

@ -689,11 +689,11 @@ export class MySQLClient extends AntaresCore {
return rows.map(row => {
return {
unique: !row.Non_unique,
unique: !Number(row.Non_unique),
name: row.Key_name,
column: row.Column_name,
indexType: row.Index_type,
type: row.Key_name === 'PRIMARY' ? 'PRIMARY' : !row.Non_unique ? 'UNIQUE' : row.Index_type === 'FULLTEXT' ? 'FULLTEXT' : 'INDEX',
type: row.Key_name === 'PRIMARY' ? 'PRIMARY' : !Number(row.Non_unique) ? 'UNIQUE' : row.Index_type === 'FULLTEXT' ? 'FULLTEXT' : 'INDEX',
cardinality: row.Cardinality,
comment: row.Comment,
indexComment: row.Index_comment