fix: purge rule version history after reset import
This commit is contained in:
@@ -237,6 +237,7 @@ class RuleServiceImpl(IRuleService):
|
||||
rv.published_at
|
||||
FROM leaudit_rule_versions rv
|
||||
WHERE rv.rule_set_id = :rule_set_id
|
||||
AND rv.deleted_at IS NULL
|
||||
ORDER BY rv.version_seq DESC, rv.id DESC
|
||||
"""
|
||||
),
|
||||
@@ -258,6 +259,7 @@ class RuleServiceImpl(IRuleService):
|
||||
JOIN leaudit_rule_sets rs ON rs.id = rv.rule_set_id
|
||||
WHERE rs.rule_type = :rule_type
|
||||
AND rs.deleted_at IS NULL
|
||||
AND rv.deleted_at IS NULL
|
||||
ORDER BY rv.version_seq DESC, rv.id DESC
|
||||
"""
|
||||
),
|
||||
@@ -281,6 +283,7 @@ class RuleServiceImpl(IRuleService):
|
||||
FROM leaudit_rule_versions rv
|
||||
JOIN leaudit_rule_sets rs ON rs.id = rv.rule_set_id
|
||||
WHERE rv.id = :version_id
|
||||
AND rv.deleted_at IS NULL
|
||||
LIMIT 1
|
||||
"""
|
||||
),
|
||||
@@ -1087,6 +1090,7 @@ class RuleServiceImpl(IRuleService):
|
||||
published_at
|
||||
FROM leaudit_rule_versions
|
||||
WHERE id = :version_id
|
||||
AND deleted_at IS NULL
|
||||
LIMIT 1
|
||||
"""
|
||||
),
|
||||
@@ -1102,6 +1106,7 @@ class RuleServiceImpl(IRuleService):
|
||||
SELECT id
|
||||
FROM leaudit_rule_versions
|
||||
WHERE rule_set_id = :rule_set_id
|
||||
AND deleted_at IS NULL
|
||||
ORDER BY version_seq DESC, id DESC
|
||||
LIMIT 1
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user