Moved the database upgrade code to a separate file and cleaned it
#22 Added PIN column to the database
Added a constant to represent the current version