File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed
forward_engineering/helpers Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -375,8 +375,8 @@ module.exports = _ => {
375375 'deleteUdtScriptsDtos' ,
376376 'createUdtScriptsDtos' ,
377377 'createCollectionsScriptsDtos' ,
378- 'modifyCollectionScriptsDtos' ,
379378 'addColumnScriptsDtos' ,
379+ 'modifyCollectionScriptsDtos' ,
380380 'modifyColumnScriptDtos' ,
381381 'createViewsScriptsDtos' ,
382382 'modifiedViewsScriptsDtos' ,
Original file line number Diff line number Diff line change @@ -121,11 +121,14 @@ module.exports = app => {
121121 } ;
122122
123123 const getKeys = ( keys , jsonSchema ) => {
124+ const newProperties = getSchemaNewProperties ( jsonSchema ) ;
125+ const properties = { ...newProperties , ...jsonSchema . properties } ;
126+
124127 return keys . map ( key => {
125128 return {
126- name : findName ( key . keyId , jsonSchema . properties ) ,
129+ name : findName ( key . keyId , properties ) ,
127130 order : key . type === 'descending' ? 'DESC' : 'ASC' ,
128- isActivated : checkIfActivated ( key . keyId , jsonSchema . properties ) ,
131+ isActivated : checkIfActivated ( key . keyId , properties ) ,
129132 } ;
130133 } ) ;
131134 } ;
@@ -246,6 +249,26 @@ module.exports = app => {
246249 return [ primaryKeyConstraint , ...uniqueKeyConstraints ] . filter ( Boolean ) ;
247250 } ;
248251
252+ /**
253+ * @param {JsonSchema } jsonSchema
254+ * @returns {JsonSchema }
255+ */
256+ const getSchemaNewProperties = jsonSchema => {
257+ if ( ! Array . isArray ( jsonSchema . compMod ?. newProperties ) ) {
258+ return { } ;
259+ }
260+
261+ return jsonSchema . compMod . newProperties . reduce ( ( properties , property ) => {
262+ return {
263+ ...properties ,
264+ [ property . code || property . name ] : {
265+ ...property ,
266+ GUID : property . id ,
267+ } ,
268+ } ;
269+ } , { } ) ;
270+ } ;
271+
249272 return {
250273 getTableKeyConstraints,
251274 isInlineUnique,
You can’t perform that action at this time.
0 commit comments