[wpdev-commits] xmlscripts/scripts/system dbupdate.py,1.1,1.2
Brought to you by:
rip,
thiagocorrea
From: spddmn <xxx...@us...> - 2004-09-08 16:07:57
|
Update of /cvsroot/wpdev/xmlscripts/scripts/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24756/system Modified Files: dbupdate.py Log Message: will now update a sqlite world db from 7 to 8 Index: dbupdate.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/dbupdate.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dbupdate.py 4 Sep 2004 21:19:03 -0000 1.1 --- dbupdate.py 8 Sep 2004 16:07:48 -0000 1.2 *************** *** 12,19 **** database.execute(sql) return True - # # MySQL Database Updates # MYSQL_UPDATES = { 7: mysql_update_7, --- 12,44 ---- database.execute(sql) return True # # MySQL Database Updates # + + def sqlite_update_8(): + + sql = "CREATE TABLE tmp_players7 ( serial bigint, account varchar(16), additionalflags bigint, visualrange tinyint(3), profile longtext, fixedlight tinyint(3), strlock smallint, dexlock smallint, intlock smallint);" + database.execute(sql) + sql = "insert into tmp_players7 select * from players;" + database.execute(sql) + sql = "drop table players;" + database.execute(sql) + + sql = "CREATE TABLE players ( serial bigint NOT NULL default '0', account varchar(16) default NULL, additionalflags bigint NOT NULL default '0', visualrange tinyint(3) NOT NULL default '0', profile longtext, fixedlight tinyint(3) NOT NULL default '0', strlock smallint NOT NULL default '0', dexlock smallint NOT NULL default '0', intlock smallint NOT NULL default '0', maxcontrolslots tinyint(4) NOT NULL default '5', PRIMARY KEY (serial) );" + database.execute(sql) + + sql = "insert into players select *, 5 from tmp_players7" + database.execute(sql) + sql = "drop table tmp_players7;" + database.execute(sql) + + sql = "replace into settings (option, value) values ('db_version',8)" + database.execute(sql) + + sql = "VACUUM" + database.execute(sql) + + return True + MYSQL_UPDATES = { 7: mysql_update_7, *************** *** 21,25 **** SQLITE_UPDATES = { ! # 7: sqlite_update_8, } --- 46,50 ---- SQLITE_UPDATES = { ! 7: sqlite_update_8, } |