Entity Detail
This page provides detailed information about key ORM entities, including their columns, types, and constraints.
MngCountry
Represents countries configured in the system.
| 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).
| Column | Type | Constraints | Description |
|---|---|---|---|
id | Integer | PK, Auto-increment | Unique identifier |
country_id | Integer | FK → mng_country.id, NOT NULL | Parent country |
name | String(255) | NOT NULL | Division name |
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, MngLocation
MngAdmin2
Second-level administrative divisions (municipalities, districts).
| Column | Type | Constraints | Description |
|---|---|---|---|
id | Integer | PK, Auto-increment | Unique identifier |
admin_1_id | Integer | FK → mng_admin_1.id, NOT NULL | Parent division |
name | String(255) | NOT NULL | Division name |
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
Forecast
Represents a forecast run for a country.
| Column | Type | Constraints | Description |
|---|---|---|---|
id | BigInteger | PK, Auto-increment | Unique identifier |
country_id | Integer | FK → mng_country.id, NOT NULL | Country for forecast |
run_date | Date | NOT NULL | Forecast run date |
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), ForecastAnalogue (children)
ForecastAnalogue
Analogue data associated with a forecast.
| Column | Type | Constraints | Description |
|---|---|---|---|
id | BigInteger | PK, Auto-increment | Unique identifier |
forecast_id | BigInteger | FK → forecast.id, NOT NULL | Parent forecast |
analogue_year | Integer | NOT NULL | Year used as analogue |
enable | Boolean | Default: true | Soft delete flag |
register | DateTime(tz) | NOT NULL | Creation timestamp |
updated | DateTime(tz) | NOT NULL | Last update timestamp |
Relationships: Forecast (parent)
ClimateHistoricalDaily
Daily climate observations data.
| Column | Type | Constraints | Description |
|---|---|---|---|
id | BigInteger | PK, Auto-increment | Unique identifier |
location_id | Integer | FK → mng_location.id, NOT NULL | Weather station/location |
date | Date | NOT NULL | Observation date |
variable | String(50) | NOT NULL | Climate variable code |
value | Float | NOT NULL | Measured value |
source_id | Integer | FK → mng_source.id | Data source |
enable | Boolean | Default: true | Soft delete flag |
register | DateTime(tz) | NOT NULL | Creation timestamp |
updated | DateTime(tz) | NOT NULL | Last update timestamp |
MngCrop
Crop type definitions.
| Column | Type | Constraints | Description |
|---|---|---|---|
id | Integer | PK, Auto-increment | Unique identifier |
name | String(255) | NOT NULL | Crop name |
code | String(50) | Crop code identifier | |
enable | Boolean | Default: true | Soft delete flag |
register | DateTime(tz) | NOT NULL | Creation timestamp |
updated | DateTime(tz) | NOT NULL | Last update timestamp |
MngCultivar
Cultivar variety definitions per country.
| 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 |
enable | Boolean | Default: true | Soft delete flag |
register | DateTime(tz) | NOT NULL | Creation timestamp |
updated | DateTime(tz) | NOT NULL | Last update timestamp |
MngSoil
Soil type definitions 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 | Soil type name |
enable | Boolean | Default: true | Soft delete flag |
register | DateTime(tz) | NOT NULL | Creation timestamp |
updated | DateTime(tz) | NOT NULL | Last update timestamp |
User and Security
User
| Column | Type | Constraints | Description |
|---|---|---|---|
id | Integer | PK, Auto-increment | Unique identifier |
username | String(100) | NOT NULL, UNIQUE | Login username |
email | String(255) | NOT NULL, UNIQUE | Email address |
password_hash | String(255) | NOT NULL | Hashed password |
enable | Boolean | Default: true | Soft delete flag |
register | DateTime(tz) | NOT NULL | Creation timestamp |
updated | DateTime(tz) | NOT NULL | Last update timestamp |
Role
| Column | Type | Constraints | Description |
|---|---|---|---|
id | Integer | PK, Auto-increment | Unique identifier |
name | String(100) | NOT NULL, UNIQUE | Role name |
description | Text | Role description | |
enable | Boolean | Default: true | Soft delete flag |
register | DateTime(tz) | NOT NULL | Creation timestamp |
updated | DateTime(tz) | NOT NULL | Last update timestamp |