added conditional maintenance of database
Signed-off-by:jonathanlermitage <jonathan.lermitage@gmail.com>