kadenios/elections/migrations/0009_auto_20210318_1441.py

58 lines
1.5 KiB
Python
Raw Permalink Normal View History

# Generated by Django 2.2.19 on 2021-03-18 13:41
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("elections", "0008_question_voters"),
]
operations = [
migrations.CreateModel(
name="Vote",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
],
),
migrations.RemoveField(
model_name="option",
name="voters",
),
migrations.AddField(
model_name="option",
name="voters",
field=models.ManyToManyField(
blank=True,
related_name="votes",
through="elections.Vote",
to=settings.AUTH_USER_MODEL,
),
),
migrations.AddField(
model_name="vote",
name="option",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="elections.Option"
),
),
migrations.AddField(
model_name="vote",
name="user",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL
),
),
]