-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
rabbit463
committed
Feb 28, 2021
1 parent
9587ead
commit 10caec5
Showing
8 changed files
with
108 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# Generated by Django 3.1.7 on 2021-02-28 16:07 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Answer', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('answer', models.TextField()), | ||
('slug', models.SlugField(max_length=10)), | ||
('helpful', models.IntegerField(default=0)), | ||
('not_helpful', models.IntegerField(default=0)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Category', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=50, unique=True)), | ||
('description', models.TextField()), | ||
('slug', models.SlugField(unique=True)), | ||
], | ||
options={ | ||
'verbose_name_plural': 'categories', | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='Question', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('question', models.CharField(max_length=150, unique=True)), | ||
('slug', models.SlugField(max_length=150, unique=True)), | ||
('helpful', models.IntegerField(default=0)), | ||
('not_helpful', models.IntegerField(default=0)), | ||
('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='faq.category')), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='QuestionHelpful', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('vote', models.BooleanField()), | ||
('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='faq.question')), | ||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), | ||
], | ||
options={ | ||
'ordering': ['question', 'vote'], | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='FAQComment', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('comment', models.TextField()), | ||
('post_time', models.DateTimeField(auto_now_add=True)), | ||
('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='faq.question')), | ||
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), | ||
], | ||
options={ | ||
'ordering': ['question', '-post_time'], | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='AnswerHelpful', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('vote', models.BooleanField()), | ||
('answer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='faq.answer')), | ||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), | ||
], | ||
options={ | ||
'ordering': ['answer', 'vote'], | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name='answer', | ||
name='question', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='faq.question'), | ||
), | ||
migrations.AlterOrderWithRespectTo( | ||
name='answer', | ||
order_with_respect_to='question', | ||
), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters