Merge branch 'main' into book-format-choices
This commit is contained in:
17
bookwyrm/migrations/0080_alter_shelfbook_options.py
Normal file
17
bookwyrm/migrations/0080_alter_shelfbook_options.py
Normal file
@ -0,0 +1,17 @@
|
||||
# Generated by Django 3.2.4 on 2021-08-05 00:00
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0079_merge_20210804_1746"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="shelfbook",
|
||||
options={"ordering": ("-shelved_date", "-created_date", "-updated_date")},
|
||||
),
|
||||
]
|
19
bookwyrm/migrations/0081_alter_user_last_active_date.py
Normal file
19
bookwyrm/migrations/0081_alter_user_last_active_date.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Generated by Django 3.2.4 on 2021-08-06 02:51
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.utils.timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0080_alter_shelfbook_options"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="user",
|
||||
name="last_active_date",
|
||||
field=models.DateTimeField(default=django.utils.timezone.now),
|
||||
),
|
||||
]
|
56
bookwyrm/migrations/0082_auto_20210806_2324.py
Normal file
56
bookwyrm/migrations/0082_auto_20210806_2324.py
Normal file
@ -0,0 +1,56 @@
|
||||
# Generated by Django 3.2.4 on 2021-08-06 23:24
|
||||
|
||||
import bookwyrm.models.base_model
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0081_alter_user_last_active_date"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="sitesettings",
|
||||
name="require_confirm_email",
|
||||
field=models.BooleanField(default=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="user",
|
||||
name="confirmation_code",
|
||||
field=models.CharField(
|
||||
default=bookwyrm.models.base_model.new_access_code, max_length=32
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="connector",
|
||||
name="deactivation_reason",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
choices=[
|
||||
("pending", "Pending"),
|
||||
("self_deletion", "Self Deletion"),
|
||||
("moderator_deletion", "Moderator Deletion"),
|
||||
("domain_block", "Domain Block"),
|
||||
],
|
||||
max_length=255,
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="user",
|
||||
name="deactivation_reason",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
choices=[
|
||||
("pending", "Pending"),
|
||||
("self_deletion", "Self Deletion"),
|
||||
("moderator_deletion", "Moderator Deletion"),
|
||||
("domain_block", "Domain Block"),
|
||||
],
|
||||
max_length=255,
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
]
|
56
bookwyrm/migrations/0083_auto_20210816_2022.py
Normal file
56
bookwyrm/migrations/0083_auto_20210816_2022.py
Normal file
@ -0,0 +1,56 @@
|
||||
# Generated by Django 3.2.4 on 2021-08-16 20:22
|
||||
|
||||
import bookwyrm.models.fields
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0082_auto_20210806_2324"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="comment",
|
||||
name="reading_status",
|
||||
field=bookwyrm.models.fields.CharField(
|
||||
blank=True,
|
||||
choices=[
|
||||
("to-read", "Toread"),
|
||||
("reading", "Reading"),
|
||||
("read", "Read"),
|
||||
],
|
||||
max_length=255,
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="quotation",
|
||||
name="reading_status",
|
||||
field=bookwyrm.models.fields.CharField(
|
||||
blank=True,
|
||||
choices=[
|
||||
("to-read", "Toread"),
|
||||
("reading", "Reading"),
|
||||
("read", "Read"),
|
||||
],
|
||||
max_length=255,
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="review",
|
||||
name="reading_status",
|
||||
field=bookwyrm.models.fields.CharField(
|
||||
blank=True,
|
||||
choices=[
|
||||
("to-read", "Toread"),
|
||||
("reading", "Reading"),
|
||||
("read", "Read"),
|
||||
],
|
||||
max_length=255,
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
]
|
56
bookwyrm/migrations/0084_auto_20210817_1916.py
Normal file
56
bookwyrm/migrations/0084_auto_20210817_1916.py
Normal file
@ -0,0 +1,56 @@
|
||||
# Generated by Django 3.2.4 on 2021-08-17 19:16
|
||||
|
||||
import bookwyrm.models.fields
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0083_auto_20210816_2022"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="comment",
|
||||
name="reading_status",
|
||||
field=bookwyrm.models.fields.CharField(
|
||||
blank=True,
|
||||
choices=[
|
||||
("to-read", "To-Read"),
|
||||
("reading", "Reading"),
|
||||
("read", "Read"),
|
||||
],
|
||||
max_length=255,
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="quotation",
|
||||
name="reading_status",
|
||||
field=bookwyrm.models.fields.CharField(
|
||||
blank=True,
|
||||
choices=[
|
||||
("to-read", "To-Read"),
|
||||
("reading", "Reading"),
|
||||
("read", "Read"),
|
||||
],
|
||||
max_length=255,
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="review",
|
||||
name="reading_status",
|
||||
field=bookwyrm.models.fields.CharField(
|
||||
blank=True,
|
||||
choices=[
|
||||
("to-read", "To-Read"),
|
||||
("reading", "Reading"),
|
||||
("read", "Read"),
|
||||
],
|
||||
max_length=255,
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
]
|
20
bookwyrm/migrations/0085_user_saved_lists.py
Normal file
20
bookwyrm/migrations/0085_user_saved_lists.py
Normal file
@ -0,0 +1,20 @@
|
||||
# Generated by Django 3.2.4 on 2021-08-23 18:05
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0084_auto_20210817_1916"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="user",
|
||||
name="saved_lists",
|
||||
field=models.ManyToManyField(
|
||||
related_name="saved_lists", to="bookwyrm.List"
|
||||
),
|
||||
),
|
||||
]
|
40
bookwyrm/migrations/0086_auto_20210827_1727.py
Normal file
40
bookwyrm/migrations/0086_auto_20210827_1727.py
Normal file
@ -0,0 +1,40 @@
|
||||
# Generated by Django 3.2.4 on 2021-08-27 17:27
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.expressions
|
||||
|
||||
|
||||
def normalize_readthrough_dates(app_registry, schema_editor):
|
||||
"""Find any invalid dates and reset them"""
|
||||
db_alias = schema_editor.connection.alias
|
||||
app_registry.get_model("bookwyrm", "ReadThrough").objects.using(db_alias).filter(
|
||||
start_date__gt=models.F("finish_date")
|
||||
).update(start_date=models.F("finish_date"))
|
||||
|
||||
|
||||
def reverse_func(apps, schema_editor):
|
||||
"""nothing to do here"""
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0085_user_saved_lists"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(normalize_readthrough_dates, reverse_func),
|
||||
migrations.AlterModelOptions(
|
||||
name="readthrough",
|
||||
options={"ordering": ("-start_date",)},
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name="readthrough",
|
||||
constraint=models.CheckConstraint(
|
||||
check=models.Q(
|
||||
("finish_date__gte", django.db.models.expressions.F("start_date"))
|
||||
),
|
||||
name="chronology",
|
||||
),
|
||||
),
|
||||
]
|
49
bookwyrm/migrations/0086_auto_20210828_1724.py
Normal file
49
bookwyrm/migrations/0086_auto_20210828_1724.py
Normal file
@ -0,0 +1,49 @@
|
||||
# Generated by Django 3.2.4 on 2021-08-28 17:24
|
||||
|
||||
import bookwyrm.models.fields
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
from django.db.models import F, Value, CharField
|
||||
from django.db.models.functions import Concat
|
||||
|
||||
|
||||
def forwards_func(apps, schema_editor):
|
||||
"""generate followers url"""
|
||||
db_alias = schema_editor.connection.alias
|
||||
apps.get_model("bookwyrm", "User").objects.using(db_alias).annotate(
|
||||
generated_url=Concat(
|
||||
F("remote_id"), Value("/followers"), output_field=CharField()
|
||||
)
|
||||
).update(followers_url=models.F("generated_url"))
|
||||
|
||||
|
||||
def reverse_func(apps, schema_editor):
|
||||
"""noop"""
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0085_user_saved_lists"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="user",
|
||||
name="followers_url",
|
||||
field=bookwyrm.models.fields.CharField(
|
||||
default="/followers", max_length=255
|
||||
),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.RunPython(forwards_func, reverse_func),
|
||||
migrations.AlterField(
|
||||
model_name="user",
|
||||
name="followers",
|
||||
field=models.ManyToManyField(
|
||||
related_name="following",
|
||||
through="bookwyrm.UserFollows",
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
]
|
@ -0,0 +1,13 @@
|
||||
# Generated by Django 3.2.4 on 2021-08-29 18:19
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0086_auto_20210827_1727"),
|
||||
("bookwyrm", "0086_auto_20210828_1724"),
|
||||
]
|
||||
|
||||
operations = []
|
34
bookwyrm/migrations/0088_auto_20210905_2233.py
Normal file
34
bookwyrm/migrations/0088_auto_20210905_2233.py
Normal file
@ -0,0 +1,34 @@
|
||||
# Generated by Django 3.2.4 on 2021-09-05 22:33
|
||||
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0087_merge_0086_auto_20210827_1727_0086_auto_20210828_1724"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="quotation",
|
||||
name="position",
|
||||
field=models.IntegerField(
|
||||
blank=True,
|
||||
null=True,
|
||||
validators=[django.core.validators.MinValueValidator(0)],
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="quotation",
|
||||
name="position_mode",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
choices=[("PG", "page"), ("PCT", "percent")],
|
||||
default="PG",
|
||||
max_length=3,
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
]
|
Reference in New Issue
Block a user