@sap/cds-compiler
Advanced tools
Comparing version 4.4.2 to 4.4.4
@@ -10,2 +10,8 @@ # ChangeLog for cds compiler and backends | ||
## Version 4.4.4 - 2023-11-24 | ||
### Fixed | ||
- to.hdi.migration: Changes in only `doc`-comments should not result in a drop-create of the primary key. | ||
## Version 4.4.2 - 2023-11-17 | ||
@@ -12,0 +18,0 @@ |
@@ -193,3 +193,3 @@ 'use strict'; | ||
forEach(changedElements, (_name, change) => { | ||
if((change.old.key || change.new.key) && !change.new.target && !change.old.target) { | ||
if(!change.onlyDoc && (change.old.key || change.new.key) && !change.new.target && !change.old.target) { | ||
// For to.hdi.migration: Just drop-create (commented out), for to.sql.migration: Handle case where we add/remove "key" keyword, no drop-create otherwise | ||
@@ -280,2 +280,4 @@ if(options.sqlDialect === 'hana' && options.src === 'hdi' || (!change.old.key || !change.new.key)) { | ||
changedElementsDict[name] = changedElement(element, otherElement); | ||
} else if(docCommentChanged(element, otherElement)) { | ||
changedElementsDict[name] = { ...changedElement(element, otherElement), onlyDoc: true }; | ||
} | ||
@@ -361,2 +363,5 @@ | ||
function docCommentChanged(element, otherElement) { | ||
return element.doc && !otherElement.doc || otherElement.doc && !element.doc || element.doc && element.doc !== otherElement.doc; | ||
} | ||
@@ -370,3 +375,4 @@ const relevantProperties = { | ||
/** | ||
* Returns whether any type parameters differ between two given elements. Ignores whether types themselves differ (`type` property). | ||
* Returns whether any type parameters differ between two given elements. Ignores whether types themselves differ (`type` property) and ignores | ||
* diff in doc comments. | ||
* @param element {object} an element | ||
@@ -380,3 +386,3 @@ * @param otherElement {object} another element | ||
if (Object.prototype.hasOwnProperty.call(element, key)) | ||
if((!key.startsWith('@') || relevantProperties[key]) && key !== 'type') { | ||
if((!key.startsWith('@') || relevantProperties[key]) && key !== 'type' && key !== 'doc') { | ||
checked.add(key); | ||
@@ -390,3 +396,3 @@ if(!deepEqual(element[key], otherElement[key])) | ||
if (Object.prototype.hasOwnProperty.call(otherElement, key)) | ||
if((!key.startsWith('@') || relevantProperties[key]) && key !== 'type' && !checked.has(key)) | ||
if((!key.startsWith('@') || relevantProperties[key]) && key !== 'type' && key !== 'doc' && !checked.has(key)) | ||
return true; | ||
@@ -393,0 +399,0 @@ } |
{ | ||
"name": "@sap/cds-compiler", | ||
"version": "4.4.2", | ||
"version": "4.4.4", | ||
"description": "CDS (Core Data Services) compiler and backends", | ||
@@ -5,0 +5,0 @@ "homepage": "https://cap.cloud.sap/", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4666906
95212