mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-25 09:45:59 +00:00
fix(mysql): contentHash return null if modifyDate is not set
This commit is contained in:
@@ -79,7 +79,7 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
tables: tables.rows.map(table => ({
|
tables: tables.rows.map(table => ({
|
||||||
...table,
|
...table,
|
||||||
objectId: table.pureName,
|
objectId: table.pureName,
|
||||||
contentHash: table.modifyDate.toISOString(),
|
contentHash: table.modifyDate?.toISOString(),
|
||||||
columns: columns.rows.filter(col => col.pureName == table.pureName).map(getColumnInfo),
|
columns: columns.rows.filter(col => col.pureName == table.pureName).map(getColumnInfo),
|
||||||
primaryKey: DatabaseAnalyser.extractPrimaryKeys(table, pkColumns.rows),
|
primaryKey: DatabaseAnalyser.extractPrimaryKeys(table, pkColumns.rows),
|
||||||
foreignKeys: DatabaseAnalyser.extractForeignKeys(table, fkColumns.rows),
|
foreignKeys: DatabaseAnalyser.extractForeignKeys(table, fkColumns.rows),
|
||||||
@@ -87,7 +87,7 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
views: views.rows.map(view => ({
|
views: views.rows.map(view => ({
|
||||||
...view,
|
...view,
|
||||||
objectId: view.pureName,
|
objectId: view.pureName,
|
||||||
contentHash: view.modifyDate.toISOString(),
|
contentHash: view.modifyDate?.toISOString(),
|
||||||
columns: columns.rows.filter(col => col.pureName == view.pureName).map(getColumnInfo),
|
columns: columns.rows.filter(col => col.pureName == view.pureName).map(getColumnInfo),
|
||||||
createSql: viewTexts[view.pureName],
|
createSql: viewTexts[view.pureName],
|
||||||
requiresFormat: true,
|
requiresFormat: true,
|
||||||
@@ -98,7 +98,7 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
.map(x => ({
|
.map(x => ({
|
||||||
...x,
|
...x,
|
||||||
objectId: x.pureName,
|
objectId: x.pureName,
|
||||||
contentHash: x.modifyDate.toISOString(),
|
contentHash: x.modifyDate?.toISOString(),
|
||||||
})),
|
})),
|
||||||
functions: programmables.rows
|
functions: programmables.rows
|
||||||
.filter(x => x.objectType == 'FUNCTION')
|
.filter(x => x.objectType == 'FUNCTION')
|
||||||
@@ -106,7 +106,7 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
.map(x => ({
|
.map(x => ({
|
||||||
...x,
|
...x,
|
||||||
objectId: x.pureName,
|
objectId: x.pureName,
|
||||||
contentHash: x.modifyDate.toISOString(),
|
contentHash: x.modifyDate?.toISOString(),
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user