Columns
Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | ||
---|---|---|---|---|---|---|---|---|---|---|
id | int8 | 19 | null |
|
|
|||||
planting_site_id | int8 | 19 | null |
|
|
|||||
start_date | date | 13 | null |
|
|
What day the planting season starts. |
||||
start_time | timestamptz | 35,6 | null |
|
|
When the planting season will start. This is midnight on |
||||
end_date | date | 13 | null |
|
|
What day the planting season ends. This is the last day of the season, not the day after the season, that is, if the planting season is the month of January, this will be January 31, not February 1. |
||||
end_time | timestamptz | 35,6 | null |
|
|
When the planting season will be finished. This is midnight on the day after |
||||
is_active | bool | 1 | null |
|
|
True if the planting season is currently in progress. Only one planting season can be active at a time for a planting site. |
Indexes
Constraint Name | Type | Sort | Column(s) |
---|---|---|---|
planting_seasons_pkey | Primary key | Asc | id |
one_active_per_site | Performance | Asc | planting_site_id |
planting_seasons_is_active_end_time_idx | Performance | Asc/Asc | is_active + end_time |
planting_seasons_is_active_start_time_end_time_idx | Performance | Asc/Asc/Asc | is_active + start_time + end_time |
planting_seasons_planting_site_id_idx | Performance | Asc | planting_site_id |
Check Constraints
Constraint Name | Constraint |
---|---|
planting_seasons_check1 | ((start_time < end_time)) |
planting_seasons_check | ((start_date < end_date)) |