Files
edx-platform/lms/djangoapps/ccx/migrations/0001_initial.py
Tyler Hallada 1540f9ec72 Add on_delete kwarg to ForeignKey & OneToOneFields
Django 2.0 will make this field required for `ForeignKey` and `OneToOneFields`.
In previous versions the option defaulted to `models.CASCADE` when not
specified. This change should make the deprecation warnings in the current
Django version go away.

The migrations where also modified, but the changes should not cause a change in
the database schema since `models.CASCADE` was already the old default.
2018-06-05 17:05:12 -04:00

44 lines
1.6 KiB
Python

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
from opaque_keys.edx.django.models import CourseKeyField, UsageKeyField
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='CcxFieldOverride',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('location', UsageKeyField(max_length=255, db_index=True)),
('field', models.CharField(max_length=255)),
('value', models.TextField(default=b'null')),
],
),
migrations.CreateModel(
name='CustomCourseForEdX',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', CourseKeyField(max_length=255, db_index=True)),
('display_name', models.CharField(max_length=255)),
('coach', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
],
),
migrations.AddField(
model_name='ccxfieldoverride',
name='ccx',
field=models.ForeignKey(to='ccx.CustomCourseForEdX', on_delete=models.CASCADE),
),
migrations.AlterUniqueTogether(
name='ccxfieldoverride',
unique_together=set([('ccx', 'location', 'field')]),
),
]