save finished migrations in the db