added support for setting up and migrating db