23 lines
615 B
Python
23 lines
615 B
Python
from django.db import migrations
|
|
|
|
|
|
def seed_stores(apps, schema_editor):
|
|
Store = apps.get_model('expenses', 'Store')
|
|
for name in ('砂村板金', 'インフラ'):
|
|
Store.objects.get_or_create(name=name, defaults={'is_active': True})
|
|
|
|
|
|
def unseed_stores(apps, schema_editor):
|
|
Store = apps.get_model('expenses', 'Store')
|
|
Store.objects.filter(name__in=('砂村板金', 'インフラ')).delete()
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
dependencies = [
|
|
('expenses', '0002_owner_type_cancel'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(seed_stores, unseed_stores),
|
|
]
|