Browse Source

feat(nocodb): add upgrader logic for Duration columns

pull/5106/head
Wing-Kam Wong 2 years ago
parent
commit
98bf5da816
  1. 17
      packages/nocodb/src/lib/version-upgrader/ncFilterUpgrader_0104003.ts

17
packages/nocodb/src/lib/version-upgrader/ncFilterUpgrader_0104003.ts

@ -12,7 +12,8 @@ import { UITypes } from 'nocodb-sdk';
// - remove `like`, `null`, and `empty` for numeric-based / singleSelect columns - migrate to `blank` from `null` and `empty`
// - remove `is null`, `is not null` for checkbox columns - migrate `equal` and `not equal` to `checked` and `not checked`
// - remove `like`, `null`, `equal` and `empty` for multiSelect columns
// - remove `>`, `<`, `>=`, `<=`, `is empty`, `is not empty`, `is equal`, `is not equal` for attachment / LTAR columns
// - remove `>`, `<`, `>=`, `<=`, `empty`, `equal` for attachment / LTAR columns
// - remove `empty`, `like`, `equal`, `null` for duration columns - migrate to blank if necessary
const removeEqualFilters = async (
filter,
@ -201,6 +202,20 @@ export default async function ({ ncMeta }: NcUpgraderCtx) {
ncMeta,
migrateToBlankFilter
);
} else if (col.uidt === UITypes.Duration) {
actions = await removeLikeFilters(filter, actions, ncMeta);
actions = await removeEqualFilters(
filter,
actions,
ncMeta,
migrateToBlankFilter
);
actions = await removeNullFilters(
filter,
actions,
ncMeta,
migrateToBlankFilter
);
}
}
await Promise.all(actions);

Loading…
Cancel
Save