Skip to content

Commit fabc89e

Browse files
committed
Even more migration dependencies
1 parent 3d1b1c6 commit fabc89e

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

esp/esp/survey/migrations/0002_anchor_replacement_1.py

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
class Migration(SchemaMigration):
99

10+
depends_on = (
11+
("program", "0001_initial"),
12+
)
13+
1014
def forwards(self, orm):
1115

1216
# Adding field 'Answer.content_type'

esp/esp/survey/migrations/0003_anchor_replacement_2.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from django.db import models
66
from django.core.exceptions import MultipleObjectsReturned
77
from django.contrib.contenttypes.models import ContentType
8-
from esp.program.models import Program, ClassSubject, ClassSection
8+
from esp.program.models import ClassSubject, ClassSection
99
from esp.survey.models import Survey, Question, Answer
1010

1111
class Migration(DataMigration):
@@ -33,9 +33,9 @@ def forwards(self, orm):
3333

3434
# Find answers associated with programs
3535
program_ct = ContentType.objects.get(app_label='program', model='program')
36-
for program in Program.objects.all():
36+
for program in orm['program.Program'].objects.all():
3737
orm.Answer.objects.filter(anchor=program.anchor).update(object_id=program.id, content_type=program_ct)
38-
print 'Updated %d programs' % Program.objects.all().count()
38+
print 'Updated %d programs' % orm['program.Program'].objects.all().count()
3939

4040
# Find answers associated with class subjects
4141
subject_ct = ContentType.objects.get(app_label='program', model='classsubject')

esp/esp/web/migrations/0001_initial.py

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
class Migration(SchemaMigration):
88

9+
depends_on = (
10+
("datatree", "0001_initial"),
11+
)
12+
913
def forwards(self, orm):
1014

1115
# Adding model 'NavBarCategory'

0 commit comments

Comments
 (0)