mirror of
https://github.com/barkeser2002/offline-db.git
synced 2026-09-25 06:00:11 +03:00
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
29 lines
868 B
Python
29 lines
868 B
Python
# Generated by Django
|
|
from django.db import migrations
|
|
|
|
def seed_loyal_fan_badge(apps, schema_editor):
|
|
Badge = apps.get_model('users', 'Badge')
|
|
Badge.objects.get_or_create(
|
|
slug='loyal-fan',
|
|
defaults={
|
|
'name': 'Loyal Fan',
|
|
'description': 'Watched 10 episodes of the same anime.',
|
|
# 'icon' field does not exist, uses 'icon_url' instead.
|
|
'icon_url': 'https://img.icons8.com/color/48/000000/heart-with-pulse.png'
|
|
}
|
|
)
|
|
|
|
def remove_loyal_fan_badge(apps, schema_editor):
|
|
Badge = apps.get_model('users', 'Badge')
|
|
Badge.objects.filter(slug='loyal-fan').delete()
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('users', '0013_seed_genre_explorer_badge'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(seed_loyal_fan_badge, remove_loyal_fan_badge),
|
|
]
|