cities
Cities — canonical, Google-Places-backed (migration 0024). One row per Google place: `name` is the English name ("Munich"), `local_name` the name in the country's language ("München"), `alt_names` every other spelling we have resolved or seen typed ("Мюнхен", "Munique", "munchen"). The CityCombobox only ever saves one of these rows, so "München", "Мюнхен" and "munich" all end up as the same city. Free-text `city` columns elsewhere are migrated to a `city_id` FK later — plan: docs/research/2026-10-12-city-canonicalisation.md.
Columns
| Column | Type | Null | Default | Keys |
|---|---|---|---|---|
| id | uuid | no | gen_random_uuid() | PK |
| google_place_id | text | no | — | |
| slug | text | no | — | |
| name | text | no | — | |
| local_name | text | yes | — | |
| country | text | yes | — | |
| country_code | text | yes | — | |
| region | text | yes | — | |
| lat | double precision | yes | — | |
| lng | double precision | yes | — | |
| alt_names | jsonb | no | [] | |
| created_at | timestamp | no | now() | |
| updated_at | timestamp | no | now() |
Value lists come from .$type<'a' | 'b'>() in the schema — enforced in TypeScript only, not by the database.
Keys, constraints & indexes
Unique
None besides the primary key.
Indexes
- (google_place_id)uniquecities_google_place_id_uidx
- (slug)uniquecities_slug_uidx
- (lower("cities"."name"))cities_name_lower_idx
- (lower("cities"."local_name"))cities_local_name_lower_idx
- (alt_names)gincities_alt_names_gin_idx
Foreign keys
None.
Used by
Code that reads or writes this table, found by static analysis of the tRPC routers and API handlers (including helpers they call).
tRPC procedures
- hangouts.listTonight
- hangouts.eventOptions
- hangouts.placeSearch
- hangouts.create
- events.sameDays
- events.stats
- plan.discover
- plan.weekSocials
- business.create
- business.update
- businessEvents.create
- businessEvents.update
- businessEvents.seriesPreview
- businessEvents.createSeries
- businessEvents.venueIdeas
- artistInvites.suggest
- artistInvites.saveProfile
- artistInvites.respond
REST & webhooks
- GET /api/city-options
- POST /api/city-resolve
- GET /api/city-search
- ANY /mcp
- ANY /mcp/public
Relations
Rendering diagram…
Diagram source
erDiagram
cities {
uuid id PK
} Defined at server/database/schema.ts:1047 as cities.