Remove old Prefs type-checking code
This commit is contained in:
parent
25a6590a56
commit
68cf8216b7
|
@ -4,17 +4,6 @@ import norm/sqlite
|
|||
import prefs_impl, types
|
||||
export genUpdatePrefs
|
||||
|
||||
static:
|
||||
var pFields: seq[string]
|
||||
for id in getTypeImpl(Prefs)[2]:
|
||||
if $id[0] == "id": continue
|
||||
pFields.add $id[0]
|
||||
|
||||
let pDefs = toSeq(allPrefs()).mapIt(it.name)
|
||||
let missing = pDefs.filterIt(it notin pFields)
|
||||
if missing.len > 0:
|
||||
raiseAssert("{$1} missing from the Prefs type" % missing.join(", "))
|
||||
|
||||
template safeAddColumn(field: typedesc): untyped =
|
||||
try: field.addColumn
|
||||
except DbError: discard
|
||||
|
|
Loading…
Reference in New Issue