summaryrefslogtreecommitdiff
path: root/archaeological_context_records/migrations
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-05-11 12:33:54 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-06-12 08:44:18 +0200
commit83d4e47b7e0ee3946e07d1c5de04597a06613cf0 (patch)
tree67981f597f7b7a98b782d2db02687d83f1024772 /archaeological_context_records/migrations
parent3d12b0ac2e97ab43a555106f404ed7cf442caf17 (diff)
downloadIshtar-83d4e47b7e0ee3946e07d1c5de04597a06613cf0.tar.bz2
Ishtar-83d4e47b7e0ee3946e07d1c5de04597a06613cf0.zip
Migrate single image to M2M (refs #4076)
Diffstat (limited to 'archaeological_context_records/migrations')
-rw-r--r--archaeological_context_records/migrations/0022_migrate_image.py27
-rw-r--r--archaeological_context_records/migrations/0023_auto_20180511_1232.py31
2 files changed, 58 insertions, 0 deletions
diff --git a/archaeological_context_records/migrations/0022_migrate_image.py b/archaeological_context_records/migrations/0022_migrate_image.py
new file mode 100644
index 000000000..87ac0cc55
--- /dev/null
+++ b/archaeological_context_records/migrations/0022_migrate_image.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.10 on 2018-05-11 12:03
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+from ishtar_common.utils_migrations import migrate_simple_image_to_m2m
+
+
+def migrate_image(apps, schema_editor):
+ ContextRecord = apps.get_model('archaeological_context_records',
+ 'ContextRecord')
+ IshtarImage = apps.get_model('ishtar_common', 'IshtarImage')
+ ContextRecordImage = apps.get_model('archaeological_context_records',
+ 'ContextRecordImage')
+ migrate_simple_image_to_m2m(ContextRecord, IshtarImage, ContextRecordImage)
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('archaeological_context_records', '0021_auto_20180509_1736'),
+ ]
+
+ operations = [
+ migrations.RunPython(migrate_image),
+ ]
diff --git a/archaeological_context_records/migrations/0023_auto_20180511_1232.py b/archaeological_context_records/migrations/0023_auto_20180511_1232.py
new file mode 100644
index 000000000..e6d69127f
--- /dev/null
+++ b/archaeological_context_records/migrations/0023_auto_20180511_1232.py
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.10 on 2018-05-11 12:32
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('archaeological_context_records', '0022_migrate_image'),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name='contextrecord',
+ name='image',
+ ),
+ migrations.RemoveField(
+ model_name='contextrecord',
+ name='thumbnail',
+ ),
+ migrations.RemoveField(
+ model_name='historicalcontextrecord',
+ name='image',
+ ),
+ migrations.RemoveField(
+ model_name='historicalcontextrecord',
+ name='thumbnail',
+ ),
+ ]