Browse Source

renamed column "default" to "defchan" (default is a reserved word, bad karma), created a script to update the schema from v0.5

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
6ce1563e89
  1. 4
      pyweb/mumble/models.py
  2. 33
      pyweb/update-v0.5-v0.6.sh

4
pyweb/mumble/models.py

@ -41,7 +41,7 @@ class Mumble( models.Model ):
obfsc = models.BooleanField( 'IP Obfuscation', default = False );
player = models.CharField( 'Player name regex', max_length=200, default=r'[-=\w\[\]\{\}\(\)\@\|\.]+' );
channel= models.CharField( 'Channel name regex', max_length=200, default=r'[ \-=\w\#\[\]\{\}\(\)\@\|]+' );
default= models.IntegerField( 'Default channel', default=0 );
defchan= models.IntegerField( 'Default channel', default=0 );
booted = models.BooleanField( 'Boot Server', default = True );
def getDbusMeta( self ):
@ -87,7 +87,7 @@ class Mumble( models.Model ):
murmur.setConf( srvid, 'obfuscate', str(self.obfsc).lower() );
murmur.setConf( srvid, 'playername', self.player );
murmur.setConf( srvid, 'channelname', self.channel );
murmur.setConf( srvid, 'defaultchannel', str(self.default) );
murmur.setConf( srvid, 'defaultchannel', str(self.defchan) );
if self.port is not None:

33
pyweb/update-v0.5-v0.6.sh

@ -0,0 +1,33 @@
#!/bin/bash
#
# Copyright (C) 2009, Michael "Svedrin" Ziegler <diese-addy@funzt-halt.net>
#
# Mumble-Django is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This package is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# I know this script sucks ass, thank you very much - but it should do the
# trick. It creates the columns in the database that have been added in v0.6.
#
<<EOF ./manage.py shell >/dev/null
# -*- coding: utf-8 -*-
from django.db import connection
from django.conf import settings
crs = connection.cursor();
crs.execute( """ALTER TABLE mumble_mumble
ADD obfsc BOOLEAN NOT NULL DEFAULT 0,
ADD player VARCHAR(200) NOT NULL DEFAULT '%s',
ADD channel VARCHAR(200) NOT NULL DEFAULT '%s',
ADD defchan NOT NULL DEFAULT 0;""" % (
r'[-=\\w\\[\\]\\{\\}\\(\\)\\@\\|\\.]+',
r'[ \\-=\\w\\#\\[\\]\\{\\}\\(\\)\\@\\|]+' )
);
EOF
Loading…
Cancel
Save