aboutsummaryrefslogtreecommitdiffstats
path: root/api/migrations/0033_create_defcon_settings.py
blob: 830f3fb09059475df72a944ad534d22f85945675 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Generated by Django 2.1.5 on 2019-02-18 19:30

from django.db import migrations


def up(apps, schema_editor):
    BotSetting = apps.get_model('api', 'BotSetting')
    setting = BotSetting(
        name='defcon',
        data={
            'enabled': False,
            'days': 0
        }
    ).save()


def down(apps, schema_editor):  # pragma: no cover - not necessary to test
    BotSetting = apps.get_model('api', 'BotSetting')
    BotSetting.get(name='defcon').delete()


class Migration(migrations.Migration):

    dependencies = [
        ('api', '0032_botsetting'),
    ]

    operations = [
        migrations.RunPython(up, down)
    ]