fix: purge rule version history after reset import
This commit is contained in:
@@ -483,6 +483,7 @@ class RuleConfigServiceImpl(IRuleConfigService):
|
||||
SELECT id, oss_url
|
||||
FROM leaudit_rule_versions
|
||||
WHERE id = ANY(:version_ids)
|
||||
AND deleted_at IS NULL
|
||||
"""
|
||||
),
|
||||
{"version_ids": version_ids},
|
||||
@@ -501,6 +502,7 @@ class RuleConfigServiceImpl(IRuleConfigService):
|
||||
SELECT DISTINCT ON (rule_set_id) rule_set_id, id
|
||||
FROM leaudit_rule_versions
|
||||
WHERE rule_set_id = ANY(:rule_set_ids)
|
||||
AND deleted_at IS NULL
|
||||
ORDER BY rule_set_id, version_seq DESC, id DESC
|
||||
"""
|
||||
),
|
||||
@@ -518,6 +520,7 @@ class RuleConfigServiceImpl(IRuleConfigService):
|
||||
SELECT oss_url
|
||||
FROM leaudit_rule_versions
|
||||
WHERE id = :version_id
|
||||
AND deleted_at IS NULL
|
||||
LIMIT 1
|
||||
"""
|
||||
),
|
||||
@@ -676,6 +679,7 @@ class RuleConfigServiceImpl(IRuleConfigService):
|
||||
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
|
||||
"""
|
||||
@@ -696,6 +700,7 @@ class RuleConfigServiceImpl(IRuleConfigService):
|
||||
SELECT version_seq
|
||||
FROM leaudit_rule_versions
|
||||
WHERE id = :version_id
|
||||
AND deleted_at IS NULL
|
||||
LIMIT 1
|
||||
"""
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user