-
Notifications
You must be signed in to change notification settings - Fork 1
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
16 changed files
with
115 additions
and
40 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
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
5 changes: 4 additions & 1 deletion
5
airflow/include/sql/sparte/models/ocsge/intersected/artificial_commune.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
5 changes: 4 additions & 1 deletion
5
airflow/include/sql/sparte/models/ocsge/intersected/difference_commune.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
2 changes: 1 addition & 1 deletion
2
airflow/include/sql/sparte/models/ocsge/intersected/occupation_du_sol_commune.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 4.2.13 on 2024-10-22 08:51 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("project", "0096_alter_historicalproject_land_id_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="projectcommune", | ||
name="commune_insee", | ||
field=models.CharField(blank=True, max_length=250, null=True, verbose_name="Code INSEE"), | ||
), | ||
] |
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,19 @@ | ||
# Generated by Django 4.2.13 on 2024-10-22 08:51 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def modify_project_commune_from_primary_keys_to_natural_key(apps, schema_editor): | ||
ProjectCommune = apps.get_model("project", "ProjectCommune") | ||
for project_commune in ProjectCommune.objects.all(): | ||
commune = project_commune.commune | ||
project_commune.commune_insee = commune.insee | ||
project_commune.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("project", "0097_projectcommune_commune_insee"), | ||
] | ||
|
||
operations = [migrations.RunPython(modify_project_commune_from_primary_keys_to_natural_key)] |
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,20 @@ | ||
# Generated by Django 4.2.13 on 2024-10-22 08:57 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("project", "0098_auto_20241022_1051"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunSQL( | ||
""" | ||
ALTER TABLE public.project_projectcommune | ||
ALTER COLUMN commune_id TYPE text USING commune_id::text; | ||
""" | ||
) | ||
] |
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,19 @@ | ||
# Generated by Django 4.2.13 on 2024-10-22 09:00 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("project", "0099_auto_20241022_1057"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunSQL( | ||
""" | ||
UPDATE project_projectcommune | ||
SET commune_id = commune_insee; | ||
""" | ||
) | ||
] |
16 changes: 16 additions & 0 deletions
16
project/migrations/0101_remove_projectcommune_commune_insee.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,16 @@ | ||
# Generated by Django 4.2.13 on 2024-10-22 09:02 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("project", "0100_auto_20241022_1100"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="projectcommune", | ||
name="commune_insee", | ||
), | ||
] |
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