RateMyCourse/backend/postings/migrations/0004_auto_20180926_1312.py

87 lines
3.5 KiB
Python
Raw Normal View History

# Generated by Django 2.0.6 on 2018-09-26 11:12
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('postings', '0003_universityreview_title'),
]
operations = [
migrations.CreateModel(
name='RateableEntity',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=256)),
],
),
migrations.CreateModel(
name='Review',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('rating', models.IntegerField(default=1)),
('title', models.CharField(max_length=128)),
('content', models.TextField()),
('created_date', models.DateTimeField(auto_now_add=True)),
('last_updated_date', models.DateTimeField(auto_now=True)),
],
),
migrations.CreateModel(
name='ReviewHelpfulVote',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('helpful', models.BooleanField()),
('review', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='postings.Review')),
],
),
migrations.AddField(
model_name='universityreview',
name='rating',
field=models.IntegerField(default=1),
),
migrations.CreateModel(
name='Course',
fields=[
('rateableentity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='postings.RateableEntity')),
],
bases=('postings.rateableentity',),
),
migrations.CreateModel(
name='Professor',
fields=[
('rateableentity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='postings.RateableEntity')),
],
bases=('postings.rateableentity',),
),
migrations.CreateModel(
name='University',
fields=[
('rateableentity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='postings.RateableEntity')),
],
bases=('postings.rateableentity',),
),
migrations.AddField(
model_name='review',
name='rateable_entity',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='postings.RateableEntity'),
),
migrations.AddField(
model_name='professor',
name='university',
field=models.ManyToManyField(to='postings.University'),
),
migrations.AddField(
model_name='course',
name='professors',
field=models.ManyToManyField(to='postings.Professor'),
),
migrations.AddField(
model_name='course',
name='taught_at_university',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='postings.University'),
),
]