Add automatic db migration

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>