-
Notifications
You must be signed in to change notification settings - Fork 77
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
7 changed files
with
82 additions
and
1 deletion.
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
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
21 changes: 21 additions & 0 deletions
21
geotrek/outdoor/migrations/0042_flatten_geometrycollection.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,21 @@ | ||
# Generated by Django 3.1.7 on 2021-03-15 15:12 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def flatten_geometrycollection(apps, schema_editor): | ||
Site = apps.get_model('outdoor', 'Site') | ||
Course = apps.get_model('outdoor', 'Course') | ||
Site.objects.bulk_update(Site.objects.all(), ['geom']) | ||
Course.objects.bulk_update(Course.objects.all(), ['geom']) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('outdoor', '0041_auto_20221110_1128'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(flatten_geometrycollection, migrations.RunPython.noop), | ||
] |
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
12 changes: 12 additions & 0 deletions
12
geotrek/outdoor/templates/outdoor/sql/post_30_geometrycollections.sql
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,12 @@ | ||
------------------------------------------------------------------------------- | ||
-- Compute elevation and elevation-based indicators | ||
------------------------------------------------------------------------------- | ||
|
||
|
||
CREATE TRIGGER outdoor_site_30_geometrycollection_flatten_iu_tgr | ||
BEFORE INSERT OR UPDATE OF geom ON outdoor_site | ||
FOR EACH ROW EXECUTE PROCEDURE flatten_geometrycollection_iu(); | ||
|
||
CREATE TRIGGER outdoor_course_30_geometrycollection_flatten_iu_tgr | ||
BEFORE INSERT OR UPDATE OF geom ON outdoor_course | ||
FOR EACH ROW EXECUTE PROCEDURE flatten_geometrycollection_iu(); |
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