summaryrefslogtreecommitdiff
path: root/archaeological_context_records/migrations/0022_migrate_image.py
blob: 87ac0cc551d8f505dc65265aac5c4155653ed7c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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),
    ]