Commit 90f9cad5 authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Check whether the source the rule was imported from is enabled

parent 9cbbe111
......@@ -46,13 +46,13 @@ interface DnsRuleDao {
fun commitStaging()
@Insert
fun insertAll(rules:Collection<DnsRule>)
fun insertAll(rules: Collection<DnsRule>)
@Query("SELECT COUNT(*) FROM DnsRule")
fun getCount():Long
fun getCount(): Long
@Query("SELECT target FROM DnsRule WHERE host=:host AND type = :type LIMIT 1")
fun findRuleTarget(host:String, type:Record.TYPE):String?
@Query("SELECT target FROM DnsRule WHERE host=:host AND type = :type AND (importedFrom is NULL OR (SELECT enabled FROM HostSource h WHERE h.id=importedFrom) = 1) LIMIT 1")
fun findRuleTarget(host: String, type: Record.TYPE): String?
@Query("DELETE FROM DnsRule WHERE importedFrom=:sourceId")
fun deleteAllFromSource(sourceId: Long)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment