-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
75 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/mmw/apps/modeling/migrations/0040_clear_nlcd2019_tr55_results.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Generated by Django 3.2.13 on 2022-04-20 23:35 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def clear_nlcd2019_tr55_results(apps, schema_editor): | ||
""" | ||
Clear the results For all scenarios belonging to TR-55 projects made after | ||
the release of 1.33.0, which switched NLCD19 2019 to be the default on | ||
2022-01-17: | ||
https://github.com/WikiWatershed/model-my-watershed/releases/tag/1.33.0 | ||
These will be recalculated with NLCD11 2011 the next time it is opened. | ||
""" | ||
Scenario = apps.get_model('modeling', 'Scenario') | ||
|
||
Scenario.objects.filter( | ||
project__model_package='tr-55', | ||
project__created_at__gte='2022-01-17' | ||
).update( | ||
results='[]', | ||
modification_hash='', | ||
aoi_census='{}', | ||
modification_censuses='{}', | ||
) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('modeling', '0039_override_sedaadjust_for_old_scenarios'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(clear_nlcd2019_tr55_results) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters