0008_auto_20151212_2313.py
1.98 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dictionary', '0007_auto_20151212_2218'),
('patterns', '0004_pattern'),
]
state_operations = [
migrations.RemoveField(
model_name='pattern',
name='type',
),
migrations.DeleteModel(
name='Pattern',
),
]
def update_content_type(apps, schema_editor):
ContentType = apps.get_model(
'django.contrib.contenttypes', 'ContentType')
ContentType.objects.filter(
app_label='patterns', model='pattern').delete()
ct = ContentType.objects.get(app_label='dictionary', model='pattern')
ct.app_label = 'patterns'
ct.save()
operations = [
migrations.RunPython(update_content_type),
migrations.AlterField(
model_name='ending',
name='pattern',
field=models.ForeignKey(related_name='endings', db_column=b'w_id', to='patterns.Pattern'),
),
migrations.AlterField(
model_name='history',
name='pattern',
field=models.ForeignKey(db_column=b'pattern_id_', blank=True, to='patterns.Pattern', null=True),
),
migrations.AlterField(
model_name='lexeme',
name='patterns',
field=models.ManyToManyField(to='patterns.Pattern', through='dictionary.LexemeInflectionPattern'),
),
migrations.AlterField(
model_name='lexemeinflectionpattern',
name='pattern',
field=models.ForeignKey(db_column=b'w_id', verbose_name='pattern', to='patterns.Pattern'),
),
migrations.AlterField(
model_name='patternexample',
name='pattern',
field=models.ForeignKey(to='patterns.Pattern'),
),
migrations.SeparateDatabaseAndState(state_operations=state_operations),
]