Fix database.insertDevice query in config template