--- config: layout: elk --- erDiagram Brewery ||--o| BreweryLocation : "has location" Brewery ||--o{ BreweryPhoto : "has photos" Brewery ||--o{ Beer : "brews" %% Cross-schema: defined in full in auth.mmd / geolocation.mmd / media.mmd / beer.mmd User ||--o{ Brewery : "posts" BreweryLocation }o--|| City : "located in" BreweryPhoto }o--|| Photo : "uses photo" Brewery { uniqueidentifier BreweryPostID PK nvarchar BreweryName uniqueidentifier PostedByID FK nvarchar Description datetime CreatedAt datetime UpdatedAt "nullable" } BreweryLocation { uniqueidentifier BreweryPostLocationID PK uniqueidentifier BreweryPostID "FK, UK" nvarchar AddressLine1 nvarchar AddressLine2 "nullable" nvarchar PostalCode uniqueidentifier CityID FK geography Coordinates "nullable" } BreweryPhoto { uniqueidentifier BreweryPostPhotoID PK uniqueidentifier BreweryPostID FK uniqueidentifier PhotoID FK datetime LinkedAt }