summaryrefslogtreecommitdiff
path: root/ishtar_common/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/migrations')
-rw-r--r--ishtar_common/migrations/0229_auto_20230608_1303.py101
1 files changed, 101 insertions, 0 deletions
diff --git a/ishtar_common/migrations/0229_auto_20230608_1303.py b/ishtar_common/migrations/0229_auto_20230608_1303.py
new file mode 100644
index 000000000..c33a42238
--- /dev/null
+++ b/ishtar_common/migrations/0229_auto_20230608_1303.py
@@ -0,0 +1,101 @@
+# Generated by Django 2.2.24 on 2023-06-08 13:03
+
+from django.db import migrations, models
+
+
+COPY_HISTORICALORGANIZATION = """
+UPDATE ishtar_common_historicalorganization
+SET precise_town_id2 = precise_town_id
+"""
+COPY_ORGANIZATION = """
+UPDATE ishtar_common_organization
+SET precise_town_id2 = precise_town_id
+"""
+COPY_HISTORICALPERSON = """
+UPDATE ishtar_common_historicalperson
+SET precise_town_id2 = precise_town_id
+"""
+COPY_PERSON = """
+UPDATE ishtar_common_person
+SET precise_town_id2 = precise_town_id
+"""
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('ishtar_common', '0228_auto_20230418_1622'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='historicalorganization',
+ name='precise_town_id2',
+ field=models.PositiveIntegerField(blank=True, null=True, verbose_name='Town (precise)'),
+ ),
+ migrations.AddField(
+ model_name='historicalperson',
+ name='precise_town_id2',
+ field=models.PositiveIntegerField(blank=True, null=True, verbose_name='Town (precise)'),
+ ),
+ migrations.AddField(
+ model_name='organization',
+ name='precise_town_id2',
+ field=models.PositiveIntegerField(blank=True, null=True, verbose_name='Town (precise)'),
+ ),
+ migrations.AddField(
+ model_name='person',
+ name='precise_town_id2',
+ field=models.PositiveIntegerField(blank=True, null=True, verbose_name='Town (precise)'),
+ ),
+ migrations.RunSQL(COPY_PERSON),
+ migrations.RunSQL(COPY_HISTORICALPERSON),
+ migrations.RunSQL(COPY_ORGANIZATION),
+ migrations.RunSQL(COPY_HISTORICALORGANIZATION),
+ migrations.RemoveField(
+ model_name='historicalorganization',
+ name='precise_town',
+ ),
+ migrations.RemoveField(
+ model_name='historicalperson',
+ name='precise_town',
+ ),
+ migrations.RemoveField(
+ model_name='organization',
+ name='precise_town',
+ ),
+ migrations.RemoveField(
+ model_name='person',
+ name='precise_town',
+ ),
+ migrations.RenameField(
+ model_name='historicalorganization',
+ old_name='precise_town_id2',
+ new_name='precise_town_id'
+ ),
+ migrations.RenameField(
+ model_name='historicalperson',
+ old_name='precise_town_id2',
+ new_name='precise_town_id'
+ ),
+ migrations.RenameField(
+ model_name='organization',
+ old_name='precise_town_id2',
+ new_name='precise_town_id'
+ ),
+ migrations.RenameField(
+ model_name='person',
+ old_name='precise_town_id2',
+ new_name='precise_town_id'
+ ),
+ migrations.AddField(
+ model_name='spatialreferencesystem',
+ name='round',
+ field=models.IntegerField(default=5, verbose_name='Number of decimal places'),
+ ),
+ migrations.AddField(
+ model_name='spatialreferencesystem',
+ name='round_z',
+ field=models.IntegerField(default=3, verbose_name='Number of decimal places for Z'),
+ ),
+ ]