this is the first step in trying to get the bot to support multiple servers with different channels, countdown triggers, and so on this also ends up affecting some configuration around: * dispatch * markov * admin privmsg form
27 lines
762 B
Python
27 lines
762 B
Python
# Generated by Django 3.1.2 on 2021-04-25 04:11
|
|
|
|
from django.db import migrations
|
|
|
|
|
|
def create_placeholder_server(apps, schema_editor):
|
|
"""Create the first server entry, to be configured by the admin."""
|
|
IrcServer = apps.get_model('ircbot', 'IrcServer')
|
|
IrcServer.objects.create(name='default', hostname='irc.example.org', port=6667)
|
|
|
|
|
|
def delete_placeholder_server(apps, schema_editor):
|
|
"""Remove the default server."""
|
|
IrcServer = apps.get_model('ircbot', 'IrcServer')
|
|
IrcServer.objects.filter(name='default').delete()
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('ircbot', '0015_ircserver'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(create_placeholder_server, delete_placeholder_server),
|
|
]
|