Completed
Push — master ( 29ed93...5f1adf )
by Camille
01:41 queued 26s
created

move_foreignkeys()   A

Complexity

Conditions 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
dl 0
loc 6
rs 9.4285
1
# -*- coding: utf-8 -*-
2
# Generated by Django 1.9 on 2016-02-01 10:09
3
from __future__ import unicode_literals
4
5
from django.db import migrations
6
7
def move_foreignkeys(apps, schema_editor):
8
    GroupAcknowledgment = apps.get_model("sigma_core", "GroupAcknowledgment")
9
    for ga in GroupAcknowledgment.objects.all():
10
        ga.subgroup = ga.asking_group
11
        ga.parent_group = ga.validator_group
12
        ga.save()
13
14
class Migration(migrations.Migration):
15
16
    dependencies = [
17
        ('sigma_core', '0013_auto_20160201_1108'),
18
    ]
19
20
    operations = [
21
        migrations.RunPython(move_foreignkeys),
22
    ]
23