fix: use only cols with comments for obj hash

This commit is contained in:
Pavel
2025-08-07 14:17:28 +02:00
parent 52f74f1204
commit bfafcb76ba
2 changed files with 10 additions and 8 deletions

View File

@@ -1,10 +1,11 @@
module.exports = `
select c.object_id as objectId,
ep.value as columnComment
ep.value as columnComment,
c.column_id as columnId
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'
INNER 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
`;