From: Florian G. <re...@us...> - 2006-12-02 21:31:16
|
Update of /cvsroot/perfparse/_perfparse/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20640/scripts Modified Files: Makefile.in mysql_create.sql Log Message: Changes in database schema: delete policy uses a id instead of name and in the other tables are only 2 entries for the delete policy. Made group editing work in php gui, started phpgui delete policy editing. Started database conversion program for new schema .... Index: Makefile.in =================================================================== RCS file: /cvsroot/perfparse/_perfparse/scripts/Makefile.in,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Makefile.in 17 Aug 2006 13:57:17 -0000 1.16 --- Makefile.in 2 Dec 2006 21:31:11 -0000 1.17 *************** *** 1,3 **** ! # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ --- 1,3 ---- ! # Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ Index: mysql_create.sql =================================================================== RCS file: /cvsroot/perfparse/_perfparse/scripts/mysql_create.sql,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mysql_create.sql 6 Sep 2006 21:58:41 -0000 1.7 --- mysql_create.sql 2 Dec 2006 21:31:11 -0000 1.8 *************** *** 18,25 **** # CREATE TABLE IF NOT EXISTS perfdata_delete_policy ( ! policy_name VARCHAR(20) NOT NULL PRIMARY KEY, ! delete_policy INT DEFAULT NULL ) TYPE=InnoDB; --- 18,28 ---- # + # TODO: Check if we need servicegroups like in nagios 2.6 + CREATE TABLE IF NOT EXISTS perfdata_delete_policy ( ! policy_id INT AUTO_INCREMENT PRIMARY KEY, ! policy_name VARCHAR(20) NOT NULL UNIQUE, ! delete_policy_seconds INT DEFAULT NULL ) TYPE=InnoDB; *************** *** 37,53 **** host_id INT PRIMARY KEY, host_name VARCHAR(75) UNIQUE, ! raw_delete_policy INTEGER, ! raw_delete_policy_name VARCHAR(20) DEFAULT NULL, ! raw_delete_policy_type ENUM('user','template') NOT NULL, ! INDEX host_ix1 (raw_delete_policy_name), ! FOREIGN KEY (raw_delete_policy_name) ! REFERENCES perfdata_delete_policy (policy_name) ON DELETE SET NULL, ! bin_delete_policy INTEGER, ! bin_delete_policy_name VARCHAR(20) DEFAULT NULL, ! bin_delete_policy_type ENUM('user','template') NOT NULL, ! INDEX host_ix2 (bin_delete_policy_name), ! FOREIGN KEY (bin_delete_policy_name) ! REFERENCES perfdata_delete_policy (policy_name) ON DELETE SET NULL, is_deleted TINYINT DEFAULT 0 --- 40,54 ---- host_id INT PRIMARY KEY, host_name VARCHAR(75) UNIQUE, ! raw_delete_policy_id INTEGER, ! raw_delete_individual INTEGER, ! INDEX host_ix1 (raw_delete_policy_id), ! FOREIGN KEY perfdata_host_ibfk_1 (raw_delete_policy_id) ! REFERENCES perfdata_delete_policy (policy_id) ON DELETE SET NULL, ! bin_delete_policy_id INTEGER, ! bin_delete_policy_individual INTEGER, ! INDEX host_ix2 (bin_delete_policy_id), ! FOREIGN KEY perfdata_host_ibfk_2 (bin_delete_policy_id) ! REFERENCES perfdata_delete_policy (policy_id) ON DELETE SET NULL, is_deleted TINYINT DEFAULT 0 *************** *** 59,65 **** CREATE TABLE IF NOT EXISTS perfdata_host_groups ( group_id INT, ! FOREIGN KEY (group_id) REFERENCES perfdata_groups(group_id) ON DELETE CASCADE, host_id INT, ! FOREIGN KEY (host_id) REFERENCES perfdata_host(host_id) ON DELETE CASCADE ) type=InnoDB; --- 60,68 ---- CREATE TABLE IF NOT EXISTS perfdata_host_groups ( group_id INT, ! FOREIGN KEY perfdata_host_groups_ibfk_1 (group_id) ! REFERENCES perfdata_groups(group_id) ON DELETE CASCADE, host_id INT, ! FOREIGN KEY perfdata_host_groups_ibfk_2 (host_id) ! REFERENCES perfdata_host(host_id) ON DELETE CASCADE ) type=InnoDB; *************** *** 71,90 **** CREATE TABLE IF NOT EXISTS perfdata_service ( service_id INT PRIMARY KEY, - UNIQUE(service_id), host_id INT NOT NULL, service_description VARCHAR(75) NOT NULL, UNIQUE (host_id, service_description), INDEX service_ix0 (host_id), ! FOREIGN KEY (host_id) REFERENCES perfdata_host (host_id) ON DELETE RESTRICT, last_perfdata_raw INTEGER DEFAULT NULL, UNIQUE INDEX service_ix1 (last_perfdata_raw), ! raw_delete_policy INTEGER DEFAULT NULL, ! raw_delete_policy_name VARCHAR(20) DEFAULT NULL, ! raw_delete_policy_type ENUM('template','user','host') NOT NULL, ! INDEX service_ix2 (raw_delete_policy_name), ! FOREIGN KEY (raw_delete_policy_name) ! REFERENCES perfdata_delete_policy (policy_name) ON DELETE SET NULL, is_deleted TINYINT DEFAULT 0 --- 74,91 ---- CREATE TABLE IF NOT EXISTS perfdata_service ( service_id INT PRIMARY KEY, host_id INT NOT NULL, service_description VARCHAR(75) NOT NULL, UNIQUE (host_id, service_description), INDEX service_ix0 (host_id), ! FOREIGN KEY perfdata_service_ibfk_1 (host_id) REFERENCES perfdata_host (host_id) ON DELETE RESTRICT, last_perfdata_raw INTEGER DEFAULT NULL, UNIQUE INDEX service_ix1 (last_perfdata_raw), ! raw_delete_policy_id INTEGER DEFAULT NULL, ! raw_delete_policy_individual INTEGER, ! INDEX service_ix2 (raw_delete_policy_id), ! FOREIGN KEY perfdata_service_ibfk_2 (raw_delete_policy_iD) ! REFERENCES perfdata_delete_policy (policy_id) ON DELETE SET NULL, is_deleted TINYINT DEFAULT 0 *************** *** 132,141 **** last_perfdata_bin INTEGER, UNIQUE INDEX perfdata_metric_ix1 (last_perfdata_bin), ! bin_delete_policy INTEGER DEFAULT NULL, ! bin_delete_policy_name VARCHAR(20) DEFAULT NULL, ! bin_delete_policy_type ENUM('template','user','host') NOT NULL, ! INDEX metric_ix2 (bin_delete_policy_name), ! FOREIGN KEY (bin_delete_policy_name) ! REFERENCES perfdata_delete_policy (policy_name) ON DELETE SET NULL, is_deleted TINYINT DEFAULT 0 --- 133,141 ---- last_perfdata_bin INTEGER, UNIQUE INDEX perfdata_metric_ix1 (last_perfdata_bin), ! bin_delete_policy_id INTEGER , ! bin_delete_policy_individual INTEGER, ! INDEX metric_ix2 (bin_delete_policy_id), ! FOREIGN KEY perfdata_service_metric_ifk_1 (bin_delete_policy_id) ! REFERENCES perfdata_delete_policy (policy_id) ON DELETE SET NULL, is_deleted TINYINT DEFAULT 0 *************** *** 170,174 **** # Binary Summary Data # Delete policy and frequency in Hours. ! # CREATE TABLE IF NOT EXISTS perfdata_bin_summary_del_policy ( --- 170,174 ---- # Binary Summary Data # Delete policy and frequency in Hours. ! # Todo: rework the tables before real use! CREATE TABLE IF NOT EXISTS perfdata_bin_summary_del_policy ( |