This commit is contained in:
Jan Prochazka 2021-07-01 13:41:48 +02:00
parent 9d711e45f9
commit 40203f2823
2 changed files with 7 additions and 7 deletions

View File

@ -88,7 +88,7 @@ class MsSqlAnalyser extends DatabaseAnalyser {
const tables = tablesRows.rows.map(row => ({
...row,
contentHash: row.modifyDate.toISOString(),
contentHash: row.modifyDate && row.modifyDate.toISOString(),
columns: columnsRows.rows.filter(col => col.objectId == row.objectId).map(getColumnInfo),
primaryKey: DatabaseAnalyser.extractPrimaryKeys(row, pkColumnsRows.rows),
foreignKeys: DatabaseAnalyser.extractForeignKeys(row, fkColumnsRows.rows),
@ -96,7 +96,7 @@ class MsSqlAnalyser extends DatabaseAnalyser {
const views = viewsRows.rows.map(row => ({
...row,
contentHash: row.modifyDate.toISOString(),
contentHash: row.modifyDate && row.modifyDate.toISOString(),
createSql: getCreateSql(row),
columns: viewColumnRows.rows.filter(col => col.objectId == row.objectId).map(getColumnInfo),
}));
@ -105,7 +105,7 @@ class MsSqlAnalyser extends DatabaseAnalyser {
.filter(x => x.sqlObjectType.trim() == 'P')
.map(row => ({
...row,
contentHash: row.modifyDate.toISOString(),
contentHash: row.modifyDate && row.modifyDate.toISOString(),
createSql: getCreateSql(row),
}));
@ -113,7 +113,7 @@ class MsSqlAnalyser extends DatabaseAnalyser {
.filter(x => ['FN', 'IF', 'TF'].includes(x.sqlObjectType.trim()))
.map(row => ({
...row,
contentHash: row.modifyDate.toISOString(),
contentHash: row.modifyDate && row.modifyDate.toISOString(),
createSql: getCreateSql(row),
}));
@ -137,7 +137,7 @@ class MsSqlAnalyser extends DatabaseAnalyser {
res[field].push({
objectId,
contentHash: modifyDate.toISOString(),
contentHash: modifyDate && modifyDate.toISOString(),
schemaName,
pureName,
});

View File

@ -128,14 +128,14 @@ class Analyser extends DatabaseAnalyser {
.map(x => ({
...x,
objectId: x.pureName,
contentHash: x.modifyDate.toISOString(),
contentHash: x.modifyDate && x.modifyDate.toISOString(),
})),
views: tableModificationsQueryData.rows
.filter(x => x.objectType == 'VIEW')
.map(x => ({
...x,
objectId: x.pureName,
contentHash: x.modifyDate.toISOString(),
contentHash: x.modifyDate && x.modifyDate.toISOString(),
})),
procedures: procedureModificationsQueryData.rows.map(x => ({
contentHash: x.Modified,