diff --git a/lib/model/query/forms.js b/lib/model/query/forms.js index be489ad0c..17522ac1c 100644 --- a/lib/model/query/forms.js +++ b/lib/model/query/forms.js @@ -486,7 +486,7 @@ const _draftFilter = (form, project) => : sql``)); // NOTE: copypasta alert! Similar SQL also appears in 20220209-01-purge-unneeded-drafts.js -// Purges draft form defs that are not referenced by any forms AND have no associated submission defs. +// Purges draft form defs that are not referenced by the form as either currentDefId or draftDefId AND have no associated submission defs. const clearUnneededDrafts = (form = null, project = null) => ({ run }) => run(sql` DELETE FROM form_defs