From: Florian G. <re...@us...> - 2006-10-29 22:29:50
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19049/db_tools Modified Files: convert.c Log Message: Start autoconvert to new db schema Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** convert.c 18 Aug 2006 09:05:21 -0000 1.2 --- convert.c 29 Oct 2006 22:29:34 -0000 1.3 *************** *** 108,111 **** --- 108,118 ---- } + if (version < 0.20) { + printf(_("Warning, this stage may take some time:\n")); + printf(_("Creating new group table:\n")); + query("create table perfdata_groups (group_id INT AUTO_INCREMENT PRIMARY KEY, group_name VARCHAR(75) UNIQUE) type=InnoDB select group_name from perfdata_host_group"); + query("drop table perfdata_host_group"); + } + /* Always check the tables */ /* Create where missing */ *************** *** 126,129 **** --- 133,142 ---- + void DropForeignKey(char *TableName, char *ForeignTableName) { + GString *querystr=g_string_new(""); + GString *resultstr=g_string_new(""); + g_string_printf(querystr,"show create table %s",TableName); + query(querystr); + } void addIdFields() *************** *** 419,423 **** - void addTableHostGroup(void) { --- 432,435 ---- |