moviewyrm/bookwyrm/migrations/0002_auto_20200219_0816.py

39 lines
1.4 KiB
Python
Raw 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 = [
('bookwyrm', '0001_initial'),
2020-02-19 07:26:42 +00:00
]
operations = [
migrations.CreateModel(
name='Favorite',
fields=[
('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')),
2020-02-19 07:26:42 +00:00
('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
],
options={
'unique_together': {('user', 'status')},
2020-02-19 07:26:42 +00:00
},
),
migrations.AddField(
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(
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
),
]