NDOJ/judge/migrations/0137_auto_20221116_2201.py
2022-11-16 18:48:32 -06:00

84 lines
2.6 KiB
Python

# Generated by Django 3.2.16 on 2022-11-16 15:01
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("judge", "0136_alter_profile_timezone"),
]
operations = [
migrations.CreateModel(
name="PageVote",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"page",
models.CharField(
db_index=True, max_length=30, verbose_name="associated page"
),
),
("score", models.IntegerField(default=0, verbose_name="votes")),
],
options={
"verbose_name": "pagevote",
"verbose_name_plural": "pagevotes",
},
),
migrations.AlterField(
model_name="problemtranslation",
name="language",
field=models.CharField(
choices=[("vi", "Vietnamese"), ("en", "English")],
max_length=7,
verbose_name="language",
),
),
migrations.CreateModel(
name="PageVoteVoter",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("score", models.IntegerField()),
(
"pagevote",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="votes",
to="judge.pagevote",
),
),
(
"voter",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="voted_page",
to="judge.profile",
),
),
],
options={
"verbose_name": "pagevote vote",
"verbose_name_plural": "pagevote votes",
"unique_together": {("voter", "pagevote")},
},
),
]