feat: fetch only base column info for modifications, drop columnComment only if exists

This commit is contained in:
Pavel
2025-08-05 17:39:53 +02:00
parent 32b1a5b22d
commit de43880a1c
4 changed files with 33 additions and 8 deletions

View File

@@ -0,0 +1,10 @@
module.exports = `
select c.object_id as objectId,
ep.value as columnComment
from sys.columns c
inner join sys.objects o on c.object_id = o.object_id
INNER JOIN sys.schemas u ON u.schema_id=o.schema_id
left join sys.extended_properties ep on ep.major_id = c.object_id and ep.minor_id = c.column_id and ep.name = 'MS_Description'
where o.type IN ('U', 'V') and o.object_id =OBJECT_ID_CONDITION and u.name =SCHEMA_NAME_CONDITION
order by c.column_id
`;

View File

@@ -13,6 +13,7 @@ const viewColumns = require('./viewColumns');
const indexes = require('./indexes');
const indexcols = require('./indexcols');
const triggers = require('./triggers');
const baseColumns = require('./baseColumns');
module.exports = {
columns,
@@ -30,4 +31,5 @@ module.exports = {
indexcols,
tableSizes,
triggers,
baseColumns,
};