aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/migrations
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-05-28 08:28:03 +0300
committerGravatar GitHub <[email protected]>2020-05-28 08:28:03 +0300
commit8eb69db369c232e668270a25717323370883bb7d (patch)
treeb5e1d81ebabe20ce72b5ce961d326f991206ec28 /pydis_site/apps/api/migrations
parentOT: Replace help text of `used` field (diff)
parentMerge pull request #353 from python-discord/post-game-jam (diff)
Merge branch 'master' into off-topic-non-random
Diffstat (limited to 'pydis_site/apps/api/migrations')
-rw-r--r--pydis_site/apps/api/migrations/0051_create_news_setting.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/pydis_site/apps/api/migrations/0051_create_news_setting.py b/pydis_site/apps/api/migrations/0051_create_news_setting.py
new file mode 100644
index 00000000..f18fdfb1
--- /dev/null
+++ b/pydis_site/apps/api/migrations/0051_create_news_setting.py
@@ -0,0 +1,25 @@
+from django.db import migrations
+
+
+def up(apps, schema_editor):
+ BotSetting = apps.get_model('api', 'BotSetting')
+ setting = BotSetting(
+ name='news',
+ data={}
+ ).save()
+
+
+def down(apps, schema_editor):
+ BotSetting = apps.get_model('api', 'BotSetting')
+ BotSetting.objects.get(name='news').delete()
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('api', '0050_remove_infractions_active_default_value'),
+ ]
+
+ operations = [
+ migrations.RunPython(up, down)
+ ]