Management Entities¶
This section covers the 20 entities in the mng_* domain, which represent core configuration data for the AClimate platform.
MngCountry¶
Represents countries configured in the system with ISO codes.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Unique identifier |
| name | String(255) | NOT NULL | Country name |
| iso2 | String(2) | NOT NULL | ISO 3166-1 alpha-2 code |
| enable | Boolean | Default: true | Soft delete flag |
| register | DateTime(tz) | NOT NULL | Creation timestamp |
| updated | DateTime(tz) | NOT NULL | Last update timestamp |
Relationships: MngAdmin1, Forecast, MngCultivar, MngSoil, MngDataSource, UserAccess, MngCountryIndicator, MngCountryClimateMeasure
MngAdmin1¶
First-level administrative divisions (departments, states, provinces) within a country.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | BigInteger | PK, Auto-increment | Unique identifier |
| country_id | Integer | FK -> mng_country.id, NOT NULL | Parent country |
| name | String(255) | NOT NULL | Division name |
| ext_id | String(255) | Default: '' | External identifier |
| enable | Boolean | Default: true | Soft delete flag |
| register | DateTime(tz) | NOT NULL | Creation timestamp |
| updated | DateTime(tz) | NOT NULL | Last update timestamp |
Relationships: MngCountry (parent), MngAdmin2 (children)
MngAdmin2¶
Second-level administrative divisions (municipalities, districts) within an admin level 1.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | BigInteger | PK, Auto-increment | Unique identifier |
| admin_1_id | BigInteger | FK -> mng_admin_1.id, NOT NULL | Parent admin level 1 |
| name | String(255) | NOT NULL | Division name |
| ext_id | String(255) | Default: '' | External identifier |
| visible | Boolean | Default: true | Visibility flag |
| enable | Boolean | Default: true | Soft delete flag |
| register | DateTime(tz) | NOT NULL | Creation timestamp |
| updated | DateTime(tz) | NOT NULL | Last update timestamp |
Relationships: MngAdmin1 (parent), MngLocation (children)
MngLocation¶
Geographic locations representing weather stations, monitoring points, or points of interest.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | BigInteger | PK, Auto-increment | Unique identifier |
| admin_2_id | BigInteger | FK -> mng_admin_2.id, NOT NULL | Parent admin level 2 |
| source_id | Integer | FK -> mng_source.id, NOT NULL | Data source |
| name | String(255) | NOT NULL | Location name |
| machine_name | String(120) | NOT NULL, UNIQUE | System identifier |
| ext_id | String(255) | NOT NULL | External identifier |
| latitude | Float | NOT NULL | Geographic latitude |
| longitude | Float | NOT NULL | Geographic longitude |
| altitude | Float | NOT NULL | Altitude in meters |
| enable | Boolean | Default: true | Soft delete flag |
| register | DateTime(tz) | NOT NULL | Creation timestamp |
| updated | DateTime(tz) | NOT NULL | Last update timestamp |
| visible | Boolean | Default: true | Visibility flag |
Indexes: admin_2_id, source_id, ext_id, machine_name
Relationships: MngAdmin2 (parent), MngSource (parent), ClimateHistoricalDaily, ClimateHistoricalMonthly, ClimateHistoricalClimatology, ClimateHistoricalIndicator, MngSeason, HistoricalAgroclimaticIndicator
MngCrop¶
Crop type definitions.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Unique identifier |
| name | String(255) | NOT NULL | Crop name |
| enable | Boolean | Default: true | Soft delete flag |
| register | DateTime(tz) | NOT NULL | Creation timestamp |
| updated | DateTime(tz) | NOT NULL | Last update timestamp |
Relationships: MngSoil, MngCultivar, MngPhenologicalStage, MngSeason
MngCultivar¶
Cultivar varieties per country and crop.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Unique identifier |
| country_id | Integer | FK -> mng_country.id, NOT NULL | Country |
| crop_id | Integer | FK -> mng_crop.id, NOT NULL | Parent crop |
| name | String(255) | NOT NULL | Cultivar name |
| sort_order | Integer | NOT NULL | Display order |
| rainfed | Boolean | Default: false | Rainfed agriculture flag |
| enable | Boolean | Default: true | Soft delete flag |
| register | DateTime(tz) | NOT NULL | Creation timestamp |
| updated | DateTime(tz) | NOT NULL | Last update timestamp |
Relationships: MngCrop (parent), MngSetup (children), MngCountry (parent)
MngSoil¶
Soil type definitions per country and crop.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Unique identifier |
| country_id | Integer | FK -> mng_country.id, NOT NULL | Country |
| crop_id | Integer | FK -> mng_crop.id, NOT NULL | Parent crop |
| name | String(255) | NOT NULL | Soil type name |
| sort_order | Integer | NOT NULL | Display order |
| enable | Boolean | Default: true | Soft delete flag |
| register | DateTime(tz) | NOT NULL | Creation timestamp |
| updated | DateTime(tz) | NOT NULL | Last update timestamp |
Relationships: MngCrop (parent), MngSetup (children), MngCountry (parent)
MngSeason¶
Growing seasons defined per location and crop.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | BigInteger | PK, Auto-increment | Unique identifier |
| location_id | BigInteger | FK -> mng_location.id, NOT NULL | Location |
| crop_id | Integer | FK -> mng_crop.id, NOT NULL | Crop type |
| planting_start | Date | NOT NULL | Start of planting window |
| planting_end | Date | NOT NULL | End of planting window |
| season_start | Date | NOT NULL | Season start date |
| season_end | Date | NOT NULL | Season end date |
| enable | Boolean | Default: true | Soft delete flag |
Relationships: MngLocation (parent), MngCrop (parent), MngSetup (children)
MngSetup¶
Crop setup configurations connecting cultivars, soils, and seasons.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | BigInteger | PK, Auto-increment | Unique identifier |
| cultivar_id | Integer | FK -> mng_cultivar.id, NOT NULL | Cultivar |
| soil_id | Integer | FK -> mng_soil.id, NOT NULL | Soil type |
| season_id | BigInteger | FK -> mng_season.id, NOT NULL | Growing season |
| frequency | Integer | NOT NULL | Planting frequency |
| enable | Boolean | Default: true | Soft delete flag |
| register | DateTime(tz) | NOT NULL | Creation timestamp |
| updated | DateTime(tz) | NOT NULL | Last update timestamp |
Relationships: MngCultivar (parent), MngSoil (parent), MngSeason (parent), MngConfigurationFile (children)
MngSource¶
Data source definitions classifying weather stations and spatial data origins.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Unique identifier |
| name | String(255) | NOT NULL | Source name |
| source_type | Enum(SourceType) | NOT NULL | MA, AU, SP, PL, TP |
| enable | Boolean | Default: true | Soft delete flag |
| register | DateTime(tz) | NOT NULL | Creation timestamp |
| updated | DateTime(tz) | NOT NULL | Last update timestamp |
Relationships: MngLocation (children)
MngDataSource¶
Data source assignments per country.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Unique identifier |
| country_id | Integer | FK -> mng_country.id, NOT NULL | Country |
| name | String(255) | NOT NULL | Data source name |
| description | Text | Description | |
| type | String(50) | NOT NULL | Source type |
| enable | Boolean | Default: true | Soft delete flag |
| created_at | DateTime(tz) | NOT NULL | Creation timestamp |
| content | Text | Content |
Relationships: MngCountry (parent)
MngClimateMeasure¶
Climate measure definitions describing measurable climate variables.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Unique identifier |
| name | String(150) | NOT NULL | Measure name |
| short_name | String(75) | NOT NULL | Short name/code |
| unit | String(50) | NOT NULL | Measurement unit |
| description | Text | Description | |
| enable | Boolean | Default: true | Soft delete flag |
| register | DateTime(tz) | NOT NULL | Creation timestamp |
| updated | DateTime(tz) | NOT NULL | Last update timestamp |
Relationships: ClimateHistoricalDaily, ClimateHistoricalMonthly, ClimateHistoricalClimatology, MngCountryClimateMeasure
MngIndicator¶
Indicator definitions for climate and agroclimatic indices.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Unique identifier |
| type | Enum(IndicatorsType) | NOT NULL | climate, agroclimatic, hydrological, scenario |
| name | String(150) | NOT NULL | Indicator name |
| short_name | String(50) | NOT NULL | Short name/code |
| unit | String(25) | NOT NULL | Measurement unit |
| temporality | Enum(Period) | NOT NULL | daily, monthly, annual, etc. |
| description | Text | Description | |
| indicator_category_id | Integer | FK -> mng_indicator_category.id | Category |
| enable | Boolean | Default: true | Soft delete flag |
| register | DateTime(tz) | NOT NULL | Creation timestamp |
| updated | DateTime(tz) | NOT NULL | Last update timestamp |
Relationships: ClimateHistoricalIndicator, HistoricalAgroclimaticIndicator, MngCountryIndicator, MngIndicatorCategory
MngIndicatorCategory¶
Categories for grouping indicators.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Unique identifier |
| name | String(100) | NOT NULL | Category name |
| description | Text | Description | |
| enable | Boolean | Default: true | Soft delete flag |
| register | DateTime(tz) | NOT NULL | Creation timestamp |
| updated | DateTime(tz) | NOT NULL | Last update timestamp |
Relationships: MngIndicator (children)
MngIndicatorsFeatures¶
Features associated with country indicators.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Unique identifier |
| country_indicator_id | Integer | FK -> mng_country_indicator.id, NOT NULL | Parent country indicator |
| title | String(150) | NOT NULL | Feature title |
| description | Text | Description | |
| type | Enum(IndicatorFeatureType) | NOT NULL | recommendation or feature |
Relationships: MngCountryIndicator (parent)
MngPhenologicalStage¶
Crop phenological stages definitions per crop.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Unique identifier |
| crop_id | Integer | FK -> mng_crop.id, NOT NULL | Parent crop |
| name | String(255) | NOT NULL | Stage name |
| short_name | String(50) | Short name | |
| description | Text | Description | |
| order_stage | Integer | NOT NULL | Stage order |
| duration_avg_day | Integer | Average duration in days | |
| start_model | String(100) | Model start parameter | |
| end_model | String(100) | Model end parameter | |
| enable | Boolean | Default: true | Soft delete flag |
Relationships: MngCrop (parent), HistoricalAgroclimaticIndicator, PhenologicalStageStress
MngStress¶
Stress type definitions for crop stress factors.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Unique identifier |
| name | String(255) | NOT NULL | Stress name |
| short_name | String(100) | NOT NULL | Short name/code |
| category | Enum(StressCategory) | NOT NULL | CROP or WEATHER |
| description | Text | Description | |
| enable | Boolean | Default: true | Soft delete flag |
Relationships: PhenologicalStageStress (children)
MngConfigurationFile¶
Configuration files associated with setups.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | BigInteger | PK, Auto-increment | Unique identifier |
| setup_id | BigInteger | FK -> mng_setup.id, NOT NULL | Parent setup |
| name | String(255) | NOT NULL | File name |
| path | String(255) | NOT NULL | File path |
| enable | Boolean | Default: true | Soft delete flag |
| register | DateTime(tz) | NOT NULL | Creation timestamp |
| updated | DateTime(tz) | NOT NULL | Last update timestamp |
Relationships: MngSetup (parent)
MngCountryIndicator¶
Country-specific indicator configurations.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Unique identifier |
| country_id | Integer | FK -> mng_country.id, NOT NULL | Country |
| indicator_id | Integer | FK -> mng_indicators.id, NOT NULL | Indicator |
| spatial_forecast | Boolean | Default: false | Spatial forecast available |
| spatial_climate | Boolean | Default: false | Spatial climate available |
| location_forecast | Boolean | Default: false | Location forecast available |
| location_climate | Boolean | Default: false | Location climate available |
| criteria | JSON | Filtering criteria | |
| description | Text | Description | |
| store | String(255) | Store identifier | |
| workspace | String(255) | GeoServer workspace |
Relationships: MngCountry (parent), MngIndicator (parent), MngIndicatorsFeatures (children)
MngCountryClimateMeasure¶
Country-specific climate measure configurations.
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Unique identifier |
| country_id | Integer | FK -> mng_country.id, NOT NULL | Country |
| measure_id | Integer | FK -> mng_climate_measure.id, NOT NULL | Climate measure |
| spatial_forecast | Boolean | Default: false | Spatial forecast available |
| spatial_climate | Boolean | Default: false | Spatial climate available |
| location_forecast | Boolean | Default: false | Location forecast available |
| location_climate | Boolean | Default: false | Location climate available |
| description | Text | Description | |
| store | String(255) | Store identifier | |
| workspace | String(255) | GeoServer workspace |
Relationships: MngCountry (parent), MngClimateMeasure (parent)