Prevent rule invalidation

This commit is contained in:
M66B 2020-11-29 10:32:59 +01:00
parent 7bdf50ab6a
commit 415469fb7e
1 changed files with 3 additions and 3 deletions

View File

@ -59,16 +59,16 @@ public interface DaoRule {
@Update
int updateRule(EntityRule rule);
@Query("UPDATE rule SET folder = :folder WHERE id = :id")
@Query("UPDATE rule SET folder = :folder WHERE id = :id AND folder <> :folder")
int setRuleFolder(long id, long folder);
@Query("UPDATE rule SET enabled = :enabled WHERE id = :id")
@Query("UPDATE rule SET enabled = :enabled WHERE id = :id AND enabled <> :enabled")
int setRuleEnabled(long id, boolean enabled);
@Query("UPDATE rule SET applied = applied + 1 WHERE id = :id")
int applyRule(long id);
@Query("UPDATE rule SET applied = 0 WHERE id = :id")
@Query("UPDATE rule SET applied = 0 WHERE id = :id AND applied <> 0")
int resetRule(long id);
@Query("DELETE FROM rule WHERE id = :id")