mirror of
https://github.com/FuzzyGrim/Yamtrack.git
synced 2026-03-03 03:07:01 +00:00
Add data migration to enable progress bar for existing users
This commit is contained in:
21
src/users/migrations/0047_set_progress_bar_true.py
Normal file
21
src/users/migrations/0047_set_progress_bar_true.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Generated by Django 5.2.9 on 2026-02-06 22:42
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def set_progress_bar_true(apps, schema_editor):
|
||||
"""Set progress_bar to True for all existing users."""
|
||||
User = apps.get_model("users", "User")
|
||||
User.objects.update(progress_bar=True)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
"""Data migration to enable progress bar for all existing users."""
|
||||
|
||||
dependencies = [
|
||||
("users", "0046_alter_user_progress_bar"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(set_progress_bar_true, migrations.RunPython.noop),
|
||||
]
|
||||
Reference in New Issue
Block a user