Fix type mismatches in the courseware migrations.
Mixing byte and unicode strings causes migrations to fail.
This commit is contained in:
@@ -49,7 +49,7 @@ class Migration(migrations.Migration):
|
||||
('course_id', CourseKeyField(max_length=255, db_index=True)),
|
||||
('location', UsageKeyField(max_length=255, db_index=True)),
|
||||
('field', models.CharField(max_length=255)),
|
||||
('value', models.TextField(default=b'null')),
|
||||
('value', models.TextField(default='null')),
|
||||
('student', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
|
||||
],
|
||||
),
|
||||
@@ -57,13 +57,13 @@ class Migration(migrations.Migration):
|
||||
name='StudentModule',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('module_type', models.CharField(default=b'problem', max_length=32, db_index=True, choices=[(b'problem', b'problem'), (b'video', b'video'), (b'html', b'html'), (b'course', b'course'), (b'chapter', b'Section'), (b'sequential', b'Subsection'), (b'library_content', b'Library Content')])),
|
||||
('module_state_key', UsageKeyField(max_length=255, db_column=b'module_id', db_index=True)),
|
||||
('module_type', models.CharField(default='problem', max_length=32, db_index=True, choices=[('problem', 'problem'), ('video', 'video'), ('html', 'html'), ('course', 'course'), ('chapter', 'Section'), ('sequential', 'Subsection'), ('library_content', 'Library Content')])),
|
||||
('module_state_key', UsageKeyField(max_length=255, db_column='module_id', db_index=True)),
|
||||
('course_id', CourseKeyField(max_length=255, db_index=True)),
|
||||
('state', models.TextField(null=True, blank=True)),
|
||||
('grade', models.FloatField(db_index=True, null=True, blank=True)),
|
||||
('max_grade', models.FloatField(null=True, blank=True)),
|
||||
('done', models.CharField(default=b'na', max_length=8, db_index=True, choices=[(b'na', b'NOT_APPLICABLE'), (b'f', b'FINISHED'), (b'i', b'INCOMPLETE')])),
|
||||
('done', models.CharField(default='na', max_length=8, db_index=True, choices=[('na', 'NOT_APPLICABLE'), ('f', 'FINISHED'), ('i', 'INCOMPLETE')])),
|
||||
('created', models.DateTimeField(auto_now_add=True, db_index=True)),
|
||||
('modified', models.DateTimeField(auto_now=True, db_index=True)),
|
||||
('student', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
|
||||
@@ -89,7 +89,7 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('field_name', models.CharField(max_length=64, db_index=True)),
|
||||
('value', models.TextField(default=b'null')),
|
||||
('value', models.TextField(default='null')),
|
||||
('created', models.DateTimeField(auto_now_add=True, db_index=True)),
|
||||
('modified', models.DateTimeField(auto_now=True, db_index=True)),
|
||||
('student', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
|
||||
@@ -100,7 +100,7 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('field_name', models.CharField(max_length=64, db_index=True)),
|
||||
('value', models.TextField(default=b'null')),
|
||||
('value', models.TextField(default='null')),
|
||||
('created', models.DateTimeField(auto_now_add=True, db_index=True)),
|
||||
('modified', models.DateTimeField(auto_now=True, db_index=True)),
|
||||
('module_type', BlockTypeKeyField(max_length=64, db_index=True)),
|
||||
@@ -112,7 +112,7 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('field_name', models.CharField(max_length=64, db_index=True)),
|
||||
('value', models.TextField(default=b'null')),
|
||||
('value', models.TextField(default='null')),
|
||||
('created', models.DateTimeField(auto_now_add=True, db_index=True)),
|
||||
('modified', models.DateTimeField(auto_now=True, db_index=True)),
|
||||
('usage_id', UsageKeyField(max_length=255, db_index=True)),
|
||||
|
||||
@@ -16,6 +16,6 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='studentmodule',
|
||||
name='module_state_key',
|
||||
field=opaque_keys.edx.django.models.UsageKeyField(db_column=b'module_id', max_length=255),
|
||||
field=opaque_keys.edx.django.models.UsageKeyField(db_column='module_id', max_length=255),
|
||||
),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user