Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions forward_engineering/enums/schedules.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
17 changes: 4 additions & 13 deletions forward_engineering/helpers/tableHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 => {
Expand Down
6 changes: 3 additions & 3 deletions properties_pane/entity_level/entityLevelConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
Loading