Re-did sql for database into one migration.

This commit is contained in:
Andrew Lalis 2018-09-27 11:57:25 +02:00
parent 7d7d4ffd2f
commit 062bfe7b61
8 changed files with 74 additions and 249 deletions

Binary file not shown.

View File

@ -1,6 +1,7 @@
# Generated by Django 2.0.6 on 2018-09-16 10:19
# Generated by Django 2.1.1 on 2018-09-27 09:48
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
@ -11,14 +12,83 @@ class Migration(migrations.Migration):
]
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.CreateModel(
name='UniversityReview',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('uni_name', models.CharField(max_length=200)),
('user_name', models.CharField(max_length=200)),
('date_published', models.DateTimeField(verbose_name='date published')),
('university_name', models.CharField(max_length=200)),
('username', models.CharField(max_length=200)),
('rating', models.IntegerField(default=1)),
('title', models.CharField(max_length=200)),
('date_published', models.DateField(verbose_name='date published')),
('content', models.CharField(max_length=200)),
],
),
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='universities',
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'),
),
]

View File

@ -1,23 +0,0 @@
# Generated by Django 2.0.6 on 2018-09-16 14:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('postings', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='universityreview',
old_name='uni_name',
new_name='university_name',
),
migrations.RenameField(
model_name='universityreview',
old_name='user_name',
new_name='username',
),
]

View File

@ -1,19 +0,0 @@
# Generated by Django 2.0.6 on 2018-09-16 15:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('postings', '0002_auto_20180916_1536'),
]
operations = [
migrations.AddField(
model_name='universityreview',
name='title',
field=models.CharField(default='example', max_length=200),
preserve_default=False,
),
]

View File

@ -1,81 +0,0 @@
# Generated by Django 2.1.1 on 2018-09-25 19:41
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.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'),
),
]

View File

@ -1,86 +0,0 @@
# 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'),
),
]

View File

@ -1,18 +0,0 @@
# Generated by Django 2.1.1 on 2018-09-25 20:32
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('postings', '0004_auto_20180925_1941'),
]
operations = [
migrations.RenameField(
model_name='professor',
old_name='university',
new_name='universities',
),
]

View File

@ -1,18 +0,0 @@
# Generated by Django 2.0.6 on 2018-09-27 07:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('postings', '0004_auto_20180926_1312'),
]
operations = [
migrations.AlterField(
model_name='universityreview',
name='date_published',
field=models.DateField(verbose_name='date published'),
),
]