Added migration to rename the default channels. If those were already changed, the settings file will need to be updated with the changed name.

This commit is contained in:
Griatch 2015-02-23 16:26:41 +01:00
parent 68e8062007
commit b8daff0663
2 changed files with 24 additions and 32 deletions

View file

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def convert_channelnames(apps, schema_editor):
ChannelDB = apps.get_model("comms", "ChannelDB")
for chan in ChannelDB.objects.filter(db_key="MUDinfo"):
# remove the old MUDinfo default channel
chan.delete()
for chan in ChannelDB.objects.filter(db_key__iexact="MUDconnections"):
# change the old mudconnections to MudInfo instead
chan.db_key = "MudInfo"
chan.save()
class Migration(migrations.Migration):
dependencies = [
('comms', '0004_auto_20150118_1631'),
]
operations = [
migrations.RunPython(convert_channelnames),
]