fix migration dependency order
Show_guided_tour needs to come after alter_user_preferred_language due to conficts. I think.
This commit is contained in:
parent
17dc5e7eb1
commit
356c1c0b62
1 changed files with 1 additions and 1 deletions
25
bookwyrm/migrations/0155_user_show_guided_tour.py
Normal file
25
bookwyrm/migrations/0155_user_show_guided_tour.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
# Generated by Django 3.2.14 on 2022-07-09 23:33
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def existing_users_default(apps, schema_editor):
|
||||
db_alias = schema_editor.connection.alias
|
||||
user_model = apps.get_model("bookwyrm", "User")
|
||||
user_model.objects.using(db_alias).filter(local=True).update(show_guided_tour=False)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0154_alter_user_preferred_language"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="user",
|
||||
name="show_guided_tour",
|
||||
field=models.BooleanField(default=True),
|
||||
),
|
||||
migrations.RunPython(existing_users_default, migrations.RunPython.noop),
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue