diff --git a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/manifest.json b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/manifest.json index 934b154..87edb29 100644 --- a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/manifest.json +++ b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/manifest.json @@ -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 }, diff --git a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/records/spacecraft.records.json b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/records/spacecraft.records.json index 033dc9f..382246e 100644 --- a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/records/spacecraft.records.json +++ b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/records/spacecraft.records.json @@ -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", diff --git a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/spacecraft.schema.json b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/spacecraft.schema.json index 1716cc7..d66f184 100644 --- a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/spacecraft.schema.json +++ b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/spacecraft.schema.json @@ -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" } } } diff --git a/ordinis-migrations/src/main/resources/db/changelog/changes/0027-spacecraft-mission-fk.xml b/ordinis-migrations/src/main/resources/db/changelog/changes/0027-spacecraft-mission-fk.xml new file mode 100644 index 0000000..58cca84 --- /dev/null +++ b/ordinis-migrations/src/main/resources/db/changelog/changes/0027-spacecraft-mission-fk.xml @@ -0,0 +1,76 @@ + + + + + + spacecraft.mission: x-localized текст → FK mission.code (схема + 14 записей, одна транзакция) + + + + UPDATE dictionary_definitions + SET schema_json = jsonb_set( + schema_json, + '{properties,mission}', + '{"type":"string","description":"Программа миссии — FK на mission.code","x-references":"mission.code"}'::jsonb + ), + schema_version = '2.0.0', + updated_at = NOW() + WHERE name = 'spacecraft'; + + + + + UPDATE dictionary_records r + SET data = jsonb_set(r.data, '{mission}', to_jsonb(m.code), true), + updated_at = NOW() + FROM (VALUES + ('1999-068A', 'TERRA_AQUA'), + ('2014-016A', 'SENTINEL_1'), + ('2015-028A', 'SENTINEL_2'), + ('2024-149E', 'KONDOR_FKA'), + ('2013-030A', 'RESURS_P'), + ('2014-085A', 'RESURS_P'), + ('2016-016A', 'RESURS_P'), + ('2024-046A', 'RESURS_P'), + ('2012-039A', 'KANOPUS_V'), + ('2017-076A', 'KANOPUS_V'), + ('2014-037A', 'METEOR_M'), + ('2019-038A', 'METEOR_M'), + ('2015-074A', 'ELEKTRO_L'), + ('2021-016A', 'ARKTIKA_M') + ) AS m(bk, code) + WHERE r.business_key = m.bk + AND r.dictionary_id = (SELECT id FROM dictionary_definitions WHERE name = 'spacecraft'); + + + + diff --git a/ordinis-migrations/src/main/resources/db/changelog/master.xml b/ordinis-migrations/src/main/resources/db/changelog/master.xml index 8b744e8..e9bfddf 100644 --- a/ordinis-migrations/src/main/resources/db/changelog/master.xml +++ b/ordinis-migrations/src/main/resources/db/changelog/master.xml @@ -36,5 +36,6 @@ +