[refactor] unify Database & ExternalIDs

These types are the same, except for Database.Empty

I managed to have backwards compatibility with the frontend format,
hence the frontend doesn't need any changes.
parent e7b16520
Pipeline #7247 failed with stages
in 20 minutes and 51 seconds