mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-28 18:46:02 +00:00
This commit is contained in:
@@ -88,7 +88,7 @@ class MsSqlAnalyser extends DatabaseAnalyser {
|
|||||||
|
|
||||||
const tables = tablesRows.rows.map(row => ({
|
const tables = tablesRows.rows.map(row => ({
|
||||||
...row,
|
...row,
|
||||||
contentHash: row.modifyDate.toISOString(),
|
contentHash: row.modifyDate && row.modifyDate.toISOString(),
|
||||||
columns: columnsRows.rows.filter(col => col.objectId == row.objectId).map(getColumnInfo),
|
columns: columnsRows.rows.filter(col => col.objectId == row.objectId).map(getColumnInfo),
|
||||||
primaryKey: DatabaseAnalyser.extractPrimaryKeys(row, pkColumnsRows.rows),
|
primaryKey: DatabaseAnalyser.extractPrimaryKeys(row, pkColumnsRows.rows),
|
||||||
foreignKeys: DatabaseAnalyser.extractForeignKeys(row, fkColumnsRows.rows),
|
foreignKeys: DatabaseAnalyser.extractForeignKeys(row, fkColumnsRows.rows),
|
||||||
@@ -96,7 +96,7 @@ class MsSqlAnalyser extends DatabaseAnalyser {
|
|||||||
|
|
||||||
const views = viewsRows.rows.map(row => ({
|
const views = viewsRows.rows.map(row => ({
|
||||||
...row,
|
...row,
|
||||||
contentHash: row.modifyDate.toISOString(),
|
contentHash: row.modifyDate && row.modifyDate.toISOString(),
|
||||||
createSql: getCreateSql(row),
|
createSql: getCreateSql(row),
|
||||||
columns: viewColumnRows.rows.filter(col => col.objectId == row.objectId).map(getColumnInfo),
|
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')
|
.filter(x => x.sqlObjectType.trim() == 'P')
|
||||||
.map(row => ({
|
.map(row => ({
|
||||||
...row,
|
...row,
|
||||||
contentHash: row.modifyDate.toISOString(),
|
contentHash: row.modifyDate && row.modifyDate.toISOString(),
|
||||||
createSql: getCreateSql(row),
|
createSql: getCreateSql(row),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ class MsSqlAnalyser extends DatabaseAnalyser {
|
|||||||
.filter(x => ['FN', 'IF', 'TF'].includes(x.sqlObjectType.trim()))
|
.filter(x => ['FN', 'IF', 'TF'].includes(x.sqlObjectType.trim()))
|
||||||
.map(row => ({
|
.map(row => ({
|
||||||
...row,
|
...row,
|
||||||
contentHash: row.modifyDate.toISOString(),
|
contentHash: row.modifyDate && row.modifyDate.toISOString(),
|
||||||
createSql: getCreateSql(row),
|
createSql: getCreateSql(row),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@ class MsSqlAnalyser extends DatabaseAnalyser {
|
|||||||
|
|
||||||
res[field].push({
|
res[field].push({
|
||||||
objectId,
|
objectId,
|
||||||
contentHash: modifyDate.toISOString(),
|
contentHash: modifyDate && modifyDate.toISOString(),
|
||||||
schemaName,
|
schemaName,
|
||||||
pureName,
|
pureName,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -128,14 +128,14 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
.map(x => ({
|
.map(x => ({
|
||||||
...x,
|
...x,
|
||||||
objectId: x.pureName,
|
objectId: x.pureName,
|
||||||
contentHash: x.modifyDate.toISOString(),
|
contentHash: x.modifyDate && x.modifyDate.toISOString(),
|
||||||
})),
|
})),
|
||||||
views: tableModificationsQueryData.rows
|
views: tableModificationsQueryData.rows
|
||||||
.filter(x => x.objectType == 'VIEW')
|
.filter(x => x.objectType == 'VIEW')
|
||||||
.map(x => ({
|
.map(x => ({
|
||||||
...x,
|
...x,
|
||||||
objectId: x.pureName,
|
objectId: x.pureName,
|
||||||
contentHash: x.modifyDate.toISOString(),
|
contentHash: x.modifyDate && x.modifyDate.toISOString(),
|
||||||
})),
|
})),
|
||||||
procedures: procedureModificationsQueryData.rows.map(x => ({
|
procedures: procedureModificationsQueryData.rows.map(x => ({
|
||||||
contentHash: x.Modified,
|
contentHash: x.Modified,
|
||||||
|
|||||||
Reference in New Issue
Block a user