refactor alembic implementation

refactor alembic implementation to facilitate database upgrades when
using scaffolds