feat(cuod): spacecraft.mission — x-localized текст → FK на mission.code

mission у КА хранился свободным x-localized текстом (краткое описание),
дублировался, рассинхронизировался, не был связан со справочником
mission (где уже есть программы миссий + поле spacecraft_codes).

Теперь mission — строка-код, x-references → mission.code. Референсная
целостность + единый источник.

Маппинг 14 КА → 9 миссий взят из mission.spacecraft_codes (обратная
связь уже была в данных). Проверено: все 14 мапятся однозначно,
0 пропусков, 0 конфликтов.

- 0027-spacecraft-mission-fk.xml — Liquibase-миграция существующих БД:
  схема + 14 записей одной транзакцией прямым SQL (смена типа поля —
  chicken-and-egg, как 0020 raw SQL минует Envers/outbox; forward-only).
  schema_version → 2.0.0.
- cuod-bundle: spacecraft.schema.json mission → x-references,
  records/spacecraft.records.json — 14 mission → код, manifest 2.0.0.
  Свежие установки получают новую форму сразу.

Caveat: миграция через raw SQL не пишет Envers _AUD и Kafka outbox —
проекции read-api нужно пересобрать после деплоя (как при 0020).
This commit is contained in:
Zimin A.N.
2026-05-21 16:21:46 +03:00
parent 2a82a875c8
commit 656da8c9b9
5 changed files with 95 additions and 29 deletions
@@ -6,7 +6,7 @@
"supportedLocales": ["ru-RU", "en-US"],
"defaultLocale": "ru-RU",
"dictionaries": [
{ "name": "spacecraft", "displayName": "Космические аппараты", "description": "Каталог КА (космических аппаратов) ДЗЗ-миссий", "scope": "PUBLIC", "schemaResource": "spacecraft.schema.json", "schemaVersion": "1.1.0", "approvalRequired": true },
{ "name": "spacecraft", "displayName": "Космические аппараты", "description": "Каталог КА (космических аппаратов) ДЗЗ-миссий", "scope": "PUBLIC", "schemaResource": "spacecraft.schema.json", "schemaVersion": "2.0.0", "approvalRequired": true },
{ "name": "satellite_type", "displayName": "Типы КА", "description": "Классификация типов космических аппаратов по миссиям и характеристикам", "scope": "PUBLIC", "schemaResource": "satellite_type.schema.json", "schemaVersion": "1.0.0" },
{ "name": "spacecraft_status", "displayName": "Статусы КА", "description": "Жизненный цикл КА: planned → operational → decommissioned/lost.", "scope": "PUBLIC", "schemaResource": "spacecraft_status.schema.json", "schemaVersion": "1.0.0" },
{ "name": "ground_station", "displayName": "Наземные станции", "description": "Каталог наземных пунктов приёма и управления", "scope": "PUBLIC", "schemaResource": "ground_station.schema.json", "schemaVersion": "1.0.0", "approvalRequired": true },
@@ -24,11 +24,7 @@
"inclination_deg": 98.2
},
"spectrum_bands": ["VIS", "NIR", "SWIR", "TIR"],
"mission": {
"ru-RU": "Глобальный мониторинг суши и атмосферы",
"en-US": "Global land and atmosphere monitoring"
}
}
"mission": "TERRA_AQUA"}
},
{
"businessKey": "2014-016A",
@@ -55,11 +51,7 @@
"inclination_deg": 98.18
},
"spectrum_bands": ["C_BAND"],
"mission": {
"ru-RU": "C-SAR радиолокация для Copernicus",
"en-US": "C-SAR radar for Copernicus"
}
}
"mission": "SENTINEL_1"}
},
{
"businessKey": "2015-028A",
@@ -85,11 +77,7 @@
"inclination_deg": 98.62
},
"spectrum_bands": ["VIS", "NIR", "SWIR"],
"mission": {
"ru-RU": "Multispectral imaging для Copernicus",
"en-US": "Multispectral imaging for Copernicus"
}
}
"mission": "SENTINEL_2"}
},
{
"businessKey": "2024-149E",
@@ -113,11 +101,7 @@
"inclination_deg": 97.5
},
"spectrum_bands": ["S_BAND"],
"mission": {
"ru-RU": "Радиолокационное наблюдение Земли",
"en-US": "Radar Earth observation"
}
}
"mission": "KONDOR_FKA"}
},
{
"businessKey": "2013-030A",
@@ -134,13 +118,13 @@
"status": "LOST",
"orbit": { "type": "SSO", "inclination_deg": 97.27 },
"spectrum_bands": ["VIS", "NIR"],
"mission": { "ru-RU": "Высокодетальная оптическая съёмка", "en-US": "High-resolution optical imaging" }
}
"mission": "RESURS_P"}
},
{
"businessKey": "2014-085A",
"data": {
"designator": "2014-085A",
"mission": "RESURS_P",
"norad_id": 40360,
"name": { "ru-RU": "Ресурс-П № 2", "en-US": "Resurs-P No.2" },
"operator": { "ru-RU": "Роскосмос / РКЦ Прогресс", "en-US": "Roscosmos / RSC Progress" },
@@ -157,6 +141,7 @@
"businessKey": "2016-016A",
"data": {
"designator": "2016-016A",
"mission": "RESURS_P",
"norad_id": 41386,
"name": { "ru-RU": "Ресурс-П № 3", "en-US": "Resurs-P No.3" },
"operator": { "ru-RU": "Роскосмос / РКЦ Прогресс", "en-US": "Roscosmos / RSC Progress" },
@@ -173,6 +158,7 @@
"businessKey": "2024-046A",
"data": {
"designator": "2024-046A",
"mission": "RESURS_P",
"name": { "ru-RU": "Ресурс-П № 4", "en-US": "Resurs-P No.4" },
"operator": { "ru-RU": "Роскосмос / РКЦ Прогресс", "en-US": "Roscosmos / RSC Progress" },
"country": "RU",
@@ -188,6 +174,7 @@
"businessKey": "2012-039A",
"data": {
"designator": "2012-039A",
"mission": "KANOPUS_V",
"norad_id": 38707,
"name": { "ru-RU": "Канопус-В № 1", "en-US": "Kanopus-V No.1" },
"operator": { "ru-RU": "Роскосмос / ВНИИЭМ", "en-US": "Roscosmos / VNIIEM" },
@@ -204,6 +191,7 @@
"businessKey": "2017-076A",
"data": {
"designator": "2017-076A",
"mission": "KANOPUS_V",
"name": { "ru-RU": "Канопус-В № 5 (2-Гранд)", "en-US": "Kanopus-V No.5 (Grand)" },
"operator": { "ru-RU": "Роскосмос / ВНИИЭМ", "en-US": "Roscosmos / VNIIEM" },
"country": "RU",
@@ -218,6 +206,7 @@
"businessKey": "2014-037A",
"data": {
"designator": "2014-037A",
"mission": "METEOR_M",
"name": { "ru-RU": "Метеор-М № 2", "en-US": "Meteor-M No.2" },
"operator": { "ru-RU": "Росгидромет / ВНИИЭМ", "en-US": "Roshydromet / VNIIEM" },
"country": "RU",
@@ -233,6 +222,7 @@
"businessKey": "2019-038A",
"data": {
"designator": "2019-038A",
"mission": "METEOR_M",
"name": { "ru-RU": "Метеор-М № 2-2", "en-US": "Meteor-M No.2-2" },
"operator": { "ru-RU": "Росгидромет / ВНИИЭМ", "en-US": "Roshydromet / VNIIEM" },
"country": "RU",
@@ -247,6 +237,7 @@
"businessKey": "2015-074A",
"data": {
"designator": "2015-074A",
"mission": "ELEKTRO_L",
"name": { "ru-RU": "Электро-Л № 2", "en-US": "Elektro-L No.2" },
"operator": { "ru-RU": "Росгидромет / НПО Лавочкина", "en-US": "Roshydromet / Lavochkin Association" },
"country": "RU",
@@ -262,6 +253,7 @@
"businessKey": "2021-016A",
"data": {
"designator": "2021-016A",
"mission": "ARKTIKA_M",
"name": { "ru-RU": "Арктика-М № 1", "en-US": "Arktika-M No.1" },
"operator": { "ru-RU": "Росгидромет / НПО Лавочкина", "en-US": "Roshydromet / Lavochkin Association" },
"country": "RU",
@@ -92,12 +92,9 @@
"uniqueItems": true
},
"mission": {
"type": "object",
"x-localized": true,
"description": "Краткое описание миссии",
"patternProperties": {
"^[a-z]{2}-[A-Z]{2}$": { "type": "string" }
}
"type": "string",
"description": "Программа миссии — FK на mission.code",
"x-references": "mission.code"
}
}
}