bookwyrm/bookwyrm/migrations/0035_edition_edition_rank.py
2021-03-08 08:49:10 -08:00

27 lines
685 B
Python

# Generated by Django 3.0.7 on 2021-01-11 17:18
import bookwyrm.models.fields
from django.db import migrations
def set_rank(app_registry, schema_editor):
db_alias = schema_editor.connection.alias
books = app_registry.get_model("bookwyrm", "Edition")
for book in books.objects.using(db_alias):
book.save()
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0034_importjob_complete"),
]
operations = [
migrations.AddField(
model_name="edition",
name="edition_rank",
field=bookwyrm.models.fields.IntegerField(default=0),
),
migrations.RunPython(set_rank),
]