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:
parent
68e8062007
commit
b8daff0663
2 changed files with 24 additions and 32 deletions
24
evennia/comms/migrations/0005_auto_20150223_1517.py
Normal file
24
evennia/comms/migrations/0005_auto_20150223_1517.py
Normal 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),
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue