Migrate the database