Merge branch 'main' into search-refactor
This commit is contained in:
38
bookwyrm/migrations/0097_auto_20210917_1858.py
Normal file
38
bookwyrm/migrations/0097_auto_20210917_1858.py
Normal file
@ -0,0 +1,38 @@
|
||||
# Generated by Django 3.2.4 on 2021-09-17 18:58
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0096_merge_20210912_0044"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="IPBlocklist",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("created_date", models.DateTimeField(auto_now_add=True)),
|
||||
("address", models.CharField(max_length=255, unique=True)),
|
||||
("is_active", models.BooleanField(default=True)),
|
||||
],
|
||||
options={
|
||||
"ordering": ("-created_date",),
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="emailblocklist",
|
||||
name="is_active",
|
||||
field=models.BooleanField(default=True),
|
||||
),
|
||||
]
|
27
bookwyrm/migrations/0098_auto_20210918_2238.py
Normal file
27
bookwyrm/migrations/0098_auto_20210918_2238.py
Normal file
@ -0,0 +1,27 @@
|
||||
# Generated by Django 3.2.4 on 2021-09-18 22:38
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0097_auto_20210917_1858"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="sitesettings",
|
||||
name="invite_request_text",
|
||||
field=models.TextField(
|
||||
default="If your request is approved, you will receive an email with a registration link."
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="sitesettings",
|
||||
name="registration_closed_text",
|
||||
field=models.TextField(
|
||||
default='We aren\'t taking new users at this time. You can find an open instance at <a href="https://joinbookwyrm.com/instances">joinbookwyrm.com/instances</a>.'
|
||||
),
|
||||
),
|
||||
]
|
37
bookwyrm/migrations/0099_readthrough_is_active.py
Normal file
37
bookwyrm/migrations/0099_readthrough_is_active.py
Normal file
@ -0,0 +1,37 @@
|
||||
# Generated by Django 3.2.4 on 2021-09-22 16:53
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def set_active_readthrough(apps, schema_editor):
|
||||
"""best-guess for deactivation date"""
|
||||
db_alias = schema_editor.connection.alias
|
||||
apps.get_model("bookwyrm", "ReadThrough").objects.using(db_alias).filter(
|
||||
start_date__isnull=False,
|
||||
finish_date__isnull=True,
|
||||
).update(is_active=True)
|
||||
|
||||
|
||||
def reverse_func(apps, schema_editor):
|
||||
"""noop"""
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0098_auto_20210918_2238"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="readthrough",
|
||||
name="is_active",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.RunPython(set_active_readthrough, reverse_func),
|
||||
migrations.AlterField(
|
||||
model_name="readthrough",
|
||||
name="is_active",
|
||||
field=models.BooleanField(default=True),
|
||||
),
|
||||
]
|
18
bookwyrm/migrations/0100_shelf_description.py
Normal file
18
bookwyrm/migrations/0100_shelf_description.py
Normal file
@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.2.5 on 2021-09-28 23:20
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0099_readthrough_is_active"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="shelf",
|
||||
name="description",
|
||||
field=models.TextField(blank=True, max_length=500, null=True),
|
||||
),
|
||||
]
|
56
bookwyrm/migrations/0101_auto_20210929_1847.py
Normal file
56
bookwyrm/migrations/0101_auto_20210929_1847.py
Normal file
@ -0,0 +1,56 @@
|
||||
# Generated by Django 3.2 on 2021-05-21 00:17
|
||||
|
||||
from django.db import migrations
|
||||
import bookwyrm
|
||||
from bookwyrm.connectors.abstract_connector import infer_physical_format
|
||||
|
||||
|
||||
def infer_format(app_registry, schema_editor):
|
||||
"""set the new phsyical format field based on existing format data"""
|
||||
db_alias = schema_editor.connection.alias
|
||||
|
||||
editions = (
|
||||
app_registry.get_model("bookwyrm", "Edition")
|
||||
.objects.using(db_alias)
|
||||
.filter(physical_format_detail__isnull=False)
|
||||
)
|
||||
for edition in editions:
|
||||
free_format = edition.physical_format_detail.lower()
|
||||
edition.physical_format = infer_physical_format(free_format)
|
||||
edition.save()
|
||||
|
||||
|
||||
def reverse(app_registry, schema_editor):
|
||||
"""doesn't need to do anything"""
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0100_shelf_description"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name="edition",
|
||||
old_name="physical_format",
|
||||
new_name="physical_format_detail",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="edition",
|
||||
name="physical_format",
|
||||
field=bookwyrm.models.fields.CharField(
|
||||
blank=True,
|
||||
choices=[
|
||||
("AudiobookFormat", "Audiobook"),
|
||||
("EBook", "eBook"),
|
||||
("GraphicNovel", "Graphic novel"),
|
||||
("Hardcover", "Hardcover"),
|
||||
("Paperback", "Paperback"),
|
||||
],
|
||||
max_length=255,
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
migrations.RunPython(infer_format, reverse),
|
||||
]
|
Reference in New Issue
Block a user