diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-10-17 15:05:03 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:23:19 +0100 |
commit | 4d2730f4003347eab7c25a5f0b3f01918e522d5a (patch) | |
tree | 67ba67af8d87a8479d4d53f4c3aaec55fc39e9d9 /archaeological_context_records/migrations | |
parent | 5a09ae075099e2cf6f509947daaf73074c7822fe (diff) | |
download | Ishtar-4d2730f4003347eab7c25a5f0b3f01918e522d5a.tar.bz2 Ishtar-4d2730f4003347eab7c25a5f0b3f01918e522d5a.zip |
Context records: Excavation technic become many2many
Diffstat (limited to 'archaeological_context_records/migrations')
-rw-r--r-- | archaeological_context_records/migrations/0109_contextrecord_excavation_technics.py | 26 | ||||
-rw-r--r-- | archaeological_context_records/migrations/0110_auto_20221017_1435.py | 21 |
2 files changed, 47 insertions, 0 deletions
diff --git a/archaeological_context_records/migrations/0109_contextrecord_excavation_technics.py b/archaeological_context_records/migrations/0109_contextrecord_excavation_technics.py new file mode 100644 index 000000000..2179eb558 --- /dev/null +++ b/archaeological_context_records/migrations/0109_contextrecord_excavation_technics.py @@ -0,0 +1,26 @@ +# Generated by Django 2.2.24 on 2022-10-17 12:22 + +from django.db import migrations, models + + +def migrate(apps, schema_editor): + ContextRecord = apps.get_model('archaeological_context_records', 'ContextRecord') + for cr in ContextRecord.objects.filter(excavation_technic__isnull=False).all(): + cr.excavation_technics.add(cr.excavation_technic) + + + +class Migration(migrations.Migration): + + dependencies = [ + ('archaeological_context_records', '0108_auto_20220707_1633'), + ] + + operations = [ + migrations.AddField( + model_name='contextrecord', + name='excavation_technics', + field=models.ManyToManyField(blank=True, related_name='context_records', to='archaeological_context_records.ExcavationTechnicType', verbose_name='Excavation technique'), + ), + migrations.RunPython(migrate), + ] diff --git a/archaeological_context_records/migrations/0110_auto_20221017_1435.py b/archaeological_context_records/migrations/0110_auto_20221017_1435.py new file mode 100644 index 000000000..c9f7f76a2 --- /dev/null +++ b/archaeological_context_records/migrations/0110_auto_20221017_1435.py @@ -0,0 +1,21 @@ +# Generated by Django 2.2.24 on 2022-10-17 14:35 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('archaeological_context_records', '0109_contextrecord_excavation_technics'), + ] + + operations = [ + migrations.RemoveField( + model_name='contextrecord', + name='excavation_technic', + ), + migrations.RemoveField( + model_name='historicalcontextrecord', + name='excavation_technic', + ), + ] |