moviewyrm/bookwyrm/migrations/0002_auto_20200219_0816.py

67 lines
2 KiB
Python
Raw Permalink Normal View History

# Generated by Django 3.0.3 on 2020-02-19 08:16
2020-02-19 07:26:42 +00:00
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
2021-03-08 16:49:10 +00:00
("bookwyrm", "0001_initial"),
2020-02-19 07:26:42 +00:00
]
operations = [
migrations.CreateModel(
2021-03-08 16:49:10 +00:00
name="Favorite",
2020-02-19 07:26:42 +00:00
fields=[
2021-03-08 16:49:10 +00:00
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("content", models.TextField(blank=True, null=True)),
("created_date", models.DateTimeField(auto_now_add=True)),
(
"status",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
to="bookwyrm.Status",
),
),
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
to=settings.AUTH_USER_MODEL,
),
),
2020-02-19 07:26:42 +00:00
],
options={
2021-03-08 16:49:10 +00:00
"unique_together": {("user", "status")},
2020-02-19 07:26:42 +00:00
},
),
migrations.AddField(
2021-03-08 16:49:10 +00:00
model_name="status",
name="favorites",
field=models.ManyToManyField(
related_name="user_favorites",
through="bookwyrm.Favorite",
to=settings.AUTH_USER_MODEL,
),
2020-02-19 07:26:42 +00:00
),
migrations.AddField(
2021-03-08 16:49:10 +00:00
model_name="user",
name="favorites",
field=models.ManyToManyField(
related_name="favorite_statuses",
through="bookwyrm.Favorite",
to="bookwyrm.Status",
),
2020-02-19 07:26:42 +00:00
),
]