diff --git a/forward_engineering/enums/schedules.js b/forward_engineering/enums/schedules.js index 5d727e7..dd4bd56 100644 --- a/forward_engineering/enums/schedules.js +++ b/forward_engineering/enums/schedules.js @@ -6,13 +6,6 @@ const ScheduleTypesEnum = Object.freeze({ TRIGGER_ON_UPDATE_BETA: 'Trigger on Update (Beta)', }); -const ScheduleUnitEnum = Object.freeze({ - HOURS: 'HOURS', - DAYS: 'DAYS', - WEEKS: 'WEEKS', -}); - module.exports = { ScheduleTypesEnum, - ScheduleUnitEnum, }; diff --git a/forward_engineering/helpers/tableHelper.js b/forward_engineering/helpers/tableHelper.js index e4687ae..7469a9b 100644 --- a/forward_engineering/helpers/tableHelper.js +++ b/forward_engineering/helpers/tableHelper.js @@ -22,7 +22,7 @@ const { const constraintHelper = require('./constrainthelper'); const { getColumnTagsStatement } = require('./unityTagsHelper'); const { Runtime } = require('../enums/runtime'); -const { ScheduleTypesEnum, ScheduleUnitEnum } = require('../enums/schedules'); +const { ScheduleTypesEnum } = require('../enums/schedules'); const getCreateStatement = ({ fullTableName, @@ -655,22 +655,13 @@ const adjustPropertyValue = propertyValue => { }; const buildEveryClause = scheduleGroup => { - const { scheduleEveryUnit, scheduleEveryValueHours, scheduleEveryValueDays, scheduleEveryValueWeeks } = - scheduleGroup; + const { scheduleEveryUnit, scheduleEveryValue } = scheduleGroup; - const unitToValueMap = { - [ScheduleUnitEnum.HOURS]: scheduleEveryValueHours, - [ScheduleUnitEnum.DAYS]: scheduleEveryValueDays, - [ScheduleUnitEnum.WEEKS]: scheduleEveryValueWeeks, - }; - - const value = unitToValueMap[scheduleEveryUnit]; - - if (!value) { + if (!scheduleEveryValue) { return ''; } - return `SCHEDULE REFRESH EVERY ${value} ${scheduleEveryUnit}`; + return `SCHEDULE REFRESH EVERY ${scheduleEveryValue} ${scheduleEveryUnit}`; }; const buildCronClause = scheduleGroup => { diff --git a/properties_pane/entity_level/entityLevelConfig.json b/properties_pane/entity_level/entityLevelConfig.json index 3642454..c60f87d 100644 --- a/properties_pane/entity_level/entityLevelConfig.json +++ b/properties_pane/entity_level/entityLevelConfig.json @@ -312,7 +312,7 @@ making sure that you maintain a proper JSON format. }, { "propertyName": "Value (1-72)", - "propertyKeyword": "scheduleEveryValueHours", + "propertyKeyword": "scheduleEveryValue", "propertyType": "numeric", "allowNegative": false, "minValue": 1, @@ -333,7 +333,7 @@ making sure that you maintain a proper JSON format. }, { "propertyName": "Value (1-31)", - "propertyKeyword": "scheduleEveryValueDays", + "propertyKeyword": "scheduleEveryValue", "propertyType": "numeric", "allowNegative": false, "minValue": 1, @@ -354,7 +354,7 @@ making sure that you maintain a proper JSON format. }, { "propertyName": "Value (1-8)", - "propertyKeyword": "scheduleEveryValueWeeks", + "propertyKeyword": "scheduleEveryValue", "propertyType": "numeric", "allowNegative": false, "minValue": 1,