User Story
As a developer, I need the station_location table created and populated by the ETL from discrete location tables, so that inventory records can reference a single clean location FK.
Background
Part of the finalized inventory and catalog schema. See docs/schema/inventory-catalog-design.md for full design rationale including is_locally_managed flag behavior and ETL warning strategy.
Definition of Done
Schema
| Column |
Type |
Nullable |
Default |
Notes |
id |
UUID |
NO |
UUIDv7 |
PK |
source_type |
VARCHAR(20) |
NO |
|
city | space_station | outpost | poi |
source_id |
BIGINT |
NO |
|
FK to originating discrete table row |
name |
VARCHAR(255) |
NO |
|
|
star_system_uex_id |
INTEGER |
YES |
NULL |
For hierarchy rollup queries |
planet_uex_id |
INTEGER |
YES |
NULL |
For hierarchy rollup queries |
moon_uex_id |
INTEGER |
YES |
NULL |
For hierarchy rollup queries |
is_available_live |
BOOLEAN |
NO |
FALSE |
|
is_locally_managed |
BOOLEAN |
NO |
FALSE |
Auto-set TRUE on admin edit; ETL skips when TRUE |
created_at |
TIMESTAMPTZ |
NO |
now() |
|
updated_at |
TIMESTAMPTZ |
NO |
now() |
|
ETL warning behavior
When the ETL would update a row with is_locally_managed = TRUE, log to station_etl_warning:
- Table name
- Row identity (source_type + source_id + name)
- What UEX wanted to change
- Timestamp
Depends on
- Discrete location tables must exist and be populated (existing ETL steps)
Related
User Story
As a developer, I need the
station_locationtable created and populated by the ETL from discrete location tables, so that inventory records can reference a single clean location FK.Background
Part of the finalized inventory and catalog schema. See
docs/schema/inventory-catalog-design.mdfor full design rationale includingis_locally_managedflag behavior and ETL warning strategy.Definition of Done
station_locationtable with all columnsstation_city,station_space_station,station_outpost,station_poiis_available_live = TRUErows from discrete tables are syncedis_locally_managed = TRUEare skipped — ETL logs warning tostation_etl_warningif UEX would have changed themis_locally_managedflag added to each discrete location table (station_city,station_space_station,station_outpost,station_poi)is_locally_managed = TRUElogic implemented at service layer when admin saves a changed valuedown()drops the table cleanlypnpm migration:reverttestedSchema
idsource_typecity|space_station|outpost|poisource_idnamestar_system_uex_idplanet_uex_idmoon_uex_idis_available_liveis_locally_managedcreated_atupdated_atETL warning behavior
When the ETL would update a row with
is_locally_managed = TRUE, log tostation_etl_warning:Depends on
Related
station_inventory_itemmigration (depends on this issue)docs/schema/inventory-catalog-design.md