mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-14 17:54:42 +00:00
27 lines
694 B
Plaintext
27 lines
694 B
Plaintext
erDiagram
|
|
Country ||--o{ StateProvince : "has"
|
|
StateProvince ||--o{ City : "has"
|
|
|
|
%% Cross-schema: defined in full in brewery.mmd
|
|
City ||--o{ BreweryLocation : "located in"
|
|
|
|
Country {
|
|
uniqueidentifier CountryID PK
|
|
nvarchar CountryName
|
|
char ISO3166_1 UK
|
|
}
|
|
|
|
StateProvince {
|
|
uniqueidentifier StateProvinceID PK
|
|
nvarchar StateProvinceName
|
|
char ISO3166_2 UK
|
|
uniqueidentifier CountryID FK
|
|
}
|
|
|
|
%% CityName + StateProvinceID form a composite unique constraint (AK_CityStateProvince)
|
|
City {
|
|
uniqueidentifier CityID PK
|
|
nvarchar CityName UK
|
|
uniqueidentifier StateProvinceID FK,UK
|
|
}
|