create and migrate database