X-Git-Url: http://www.andromeda.nl/gitweb/?a=blobdiff_plain;f=src%2Fgcm_daemon%2Fclasses%2Fgnucomo_db_version.php;h=d84a3e56a919fb94b75404e22ca1a8c84f906fa1;hb=9feb4b819b2254ff385c8ddb14022c653d21ef37;hp=dccdfef8179c4ac732438f85c734947936e09314;hpb=1094412697ffd91c93a6fb13a0d11b4d45fe8291;p=gnucomo.git diff --git a/src/gcm_daemon/classes/gnucomo_db_version.php b/src/gcm_daemon/classes/gnucomo_db_version.php index dccdfef..d84a3e5 100644 --- a/src/gcm_daemon/classes/gnucomo_db_version.php +++ b/src/gcm_daemon/classes/gnucomo_db_version.php @@ -14,8 +14,8 @@ { case 1: //DROP the rule that prohibits updates (change of spec). - $local_sql = "DROP RULE log_update"; -// $dbms->query($local_sql); DISABLED FOR NEW ROLE LOG-tABLE + $local_sql = "DROP RULE log_update ON log"; + $dbms->query($local_sql); //DISABLED FOR NEW ROLE LOG-tABLE ??? case 2: //In the log table processed should be false by default @@ -168,24 +168,24 @@ $dbms->query($local_sql); case 18: - $local_sql = "UPDATE action SET actionname = 'Investigation completed', statuscode = 'PEN', description = 'Investigation has been done.' "; + $local_sql = "UPDATE action SET actionname = 'Investigation completed', statuscode = 'PEN', description = 'Investigation has been done. Information is available to fix the problem.' "; $local_sql .= "WHERE actionid = '9'"; $dbms->query($local_sql); case 19: - $local_sql = "insert into type_of_issue (name, suggested_priority, description)"; - $local_sql .= " values ('parameter created',3,'A new parameter was created')"; + $local_sql = "insert into type_of_issue (name, suggested_priority, description, active)"; + $local_sql .= " values ('parameter created',3,'A new parameter was created', true)"; $dbms->query($local_sql); - $local_sql = "insert into type_of_issue (name, suggested_priority, description)"; - $local_sql .= " values ('property modified',3,'The STATIC property of a parameter was modified')"; + $local_sql = "insert into type_of_issue (name, suggested_priority, description, active)"; + $local_sql .= " values ('property modified',3,'The STATIC property of a parameter was modified', true)"; $dbms->query($local_sql); - $local_sql = "insert into type_of_issue (name, suggested_priority, description)"; - $local_sql .= " values ('parameter removed',3,'A parameter was removed') "; + $local_sql = "insert into type_of_issue (name, suggested_priority, description, active)"; + $local_sql .= " values ('parameter removed',3,'A parameter was removed', true) "; $dbms->query($local_sql); - case 20: + case 20: $local_sql = "CREATE TABLE parameter_notification (notificationid bigint, paramid bigint, primary key (notificationid, paramid))"; $dbms->query($local_sql); @@ -198,11 +198,11 @@ $dbms->query($local_sql); - case 21: +case 21: $local_sql = "UPDATE action SET statuscode = LOWER(statuscode)"; $dbms->query($local_sql); - case 22: +case 22: //Create a log_adv_kernel_network table that recognizes the log-records //that have come from the kernel-network interface (typically iptables). $local_sql = "CREATE TABLE log_adv_daemon ("; @@ -210,11 +210,11 @@ $local_sql .= ") INHERITS (log_adv)"; $dbms->query($local_sql); - case 23: +case 23: $local_sql = "CREATE INDEX log_adv_daemon_service ON log_adv_daemon (service)"; $dbms->query($local_sql); - case 24: +case 24: $local_sql = "ALTER TABLE object ADD COLUMN log_count BIGINT"; $dbms->query($local_sql); @@ -236,14 +236,450 @@ case 26: case 27: $local_sql = "INSERT INTO db_value VALUES ('last_notification', '0')"; $dbms->query($local_sql); - -/* - //These columns have to be removed when a new version of PGSQL has become mainstream that supportsa DROP COLUMN - $local_sql = "ALTER TABLE log DROP COLUMN recognized"; + +case 28: + $dbms->query("CREATE GROUP view"); + $dbms->query("CREATE GROUP ops"); + $dbms->query("CREATE GROUP admin"); + + $dbms->query("GRANT SELECT ON action TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON action_user TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON db_value TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON history TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON log TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON log_adv TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON log_adv_daemon TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON log_adv_kernel_network TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON log_notification TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON notification TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON object TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON object_issue TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON object_priority TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON object_service TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON object_user TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON parameter TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON parameter_class TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON parameter_notification TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON priority TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON property TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON service TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON status TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON supported_os TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON type_of_issue TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON usr TO GROUP view, GROUP ops, GROUP admin"); + + $dbms->query("GRANT INSERT ON action_user TO GROUP ops, GROUP admin"); + $dbms->query("GRANT UPDATE ON notification TO GROUP ops, GROUP admin"); + $dbms->query("GRANT INSERT ON object TO GROUP admin"); + $dbms->query("GRANT UPDATE ON object TO GROUP ops, GROUP admin"); + $dbms->query("GRANT DELETE ON object TO GROUP admin"); + $dbms->query("GRANT UPDATE ON usr TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT INSERT ON usr TO GROUP admin"); + $dbms->query("GRANT DELETE ON usr TO GROUP admin"); + +case 29: + $local_sql = "INSERT INTO action (actionname, description) VALUES ('Redisplayed to user', " + . "'The notification has been presented to a user. This is not the first time')"; + $dbms->query ($local_sql); + +case 30: + $local_sql = "INSERT INTO action (actionname, description) VALUES ('Displayed in list', " + . "'The notification has been presented in a list with other notifications.')"; + $dbms->query ($local_sql); + +case 31: + $local_sql = "CREATE TABLE log_adv_daemon_email ("; + $local_sql .= "source_ip INET, destination_ip INET, internal_messageid TEXT, "; + $local_sql .= "external_messageid TEXT, to_email TEXT, from_email TEXT, delay TIME, xdelay TIME, "; + $local_sql .= "mailer TEXT, status TEXT, pid INT"; + $local_sql .= ") INHERITS (log_adv_daemon)"; + $dbms->query($local_sql); + +case 32: + $local_sql = "CREATE INDEX log_adv_daemon_email_s_ip ON log_adv_daemon_email (source_ip)"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX log_adv_daemon_email_d_ip ON log_adv_daemon_email (destination_ip)"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX log_adv_daemon_email_to ON log_adv_daemon_email (to_email)"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX log_adv_daemon_email_from ON log_adv_daemon_email (from_email)"; + $dbms->query($local_sql); + + +case 33: + $local_sql = "ALTER TABLE log_adv_daemon_email ADD COLUMN size INT"; + $dbms->query($local_sql); + +case 34: + $local_sql = "ALTER TABLE log_adv_daemon_email ADD COLUMN pri INT"; + $dbms->query($local_sql); + + $local_sql = "ALTER TABLE log_adv_daemon_email ADD COLUMN relay TEXT"; + $dbms->query($local_sql); + + $local_sql = "ALTER TABLE log_adv_daemon_email ADD COLUMN status_details TEXT"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX log_adv_email_status ON log_adv_daemon_email (status)"; + $dbms->query($local_sql); + +case 35: + $local_sql = "ALTER TABLE log_adv_daemon_email ADD COLUMN dsn TEXT"; + $dbms->query($local_sql); + +case 36: + //Create a notification check + + $local_sql = "CREATE SEQUENCE checkid_seq"; + $dbms->query($local_sql); + + $local_sql = "CREATE TABLE notification_check ("; + $local_sql .= "checkid bigint DEFAULT nextval('checkid_seq'::text) NOT NULL,"; + $local_sql .= "checkname TEXT, description TEXT, time_between_executions INTERVAL, "; + $local_sql .= "last_execution timestamp, execution_counter BIGINT,"; + $local_sql .= "notificationcounter BIGINT)"; + $dbms->query($local_sql); + + $local_sql = "CREATE UNIQUE INDEX not_check_checkid ON notification_check (checkid)"; + $dbms->query($local_sql); + + $local_sql = "CREATE UNIQUE INDEX not_check_checkname ON notification_check (checkname)"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX not_check_check_lastexec ON notification_check (last_execution)"; + $dbms->query($local_sql); + +case 37: + $local_sql = "ALTER TABLE notification_check ADD COLUMN decreasinglist BOOLEAN"; + $dbms->query($local_sql); + + + $local_sql = "ALTER TABLE notification_check ADD COLUMN type_of_issueid BIGINT"; + $dbms->query($local_sql); + + $local_sql = "ALTER TABLE notification_check ALTER COLUMN decreasinglist SET DEFAULT false"; + $dbms->query($local_sql); + + $local_sql = "CREATE SEQUENCE checklineid_seq"; + $dbms->query($local_sql); + + $local_sql = "CREATE TABLE notification_check_line ("; + $local_sql .= "checklineid BIGINT DEFAULT nextval('checklineid_seq'::text) NOT NULL,"; + $local_sql .= "checkid BIGINT, sortorder INTEGER, last_logid BIGINT, "; + $local_sql .= "historicboundary INTERVAL, use_logid BOOLEAN, sql_query TEXT"; + $local_sql .= ")"; + $dbms->query($local_sql); + + $local_sql = "ALTER TABLE notification_check_line ALTER COLUMN historicboundary SET DEFAULT '0'"; + $dbms->query($local_sql); + + $local_sql = "ALTER TABLE notification_check_line ALTER COLUMN use_logid SET DEFAULT false"; + $dbms->query($local_sql); + + $local_sql = "ALTER TABLE notification_check_line ALTER COLUMN last_logid SET DEFAULT 0"; + $dbms->query($local_sql); + +case 38: + $local_sql = "CREATE UNIQUE INDEX notcheckline_checklineid ON notification_check_line (checklineid)"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX notcheckline_checkid ON notification_check_line (checkid)"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX notcheckline_sort ON notification_check_line (sortorder)"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX notcheckline_check_sort ON notification_check_line (checkid, sortorder)"; + $dbms->query($local_sql); + +case 39: + $local_sql = "CREATE TABLE notification_check_buffer ("; + $local_sql .= "checkid BIGINT, sortorder INTEGER, pid INTEGER, logid bigint"; + $local_sql .= ")"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX notcheckbuffer_checkid ON notification_check_buffer(checkid)"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX notcheckbuffer_sort ON notification_check_buffer(sortorder)"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX notcheckbuffer_pid ON notification_check_buffer(pid)"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX notcheckbuffer_logid ON notification_check_buffer(logid)"; + $dbms->query($local_sql); + +case 40: + $local_sql = "CREATE TABLE object_statistics ("; + $local_sql .= "objectid bigint,"; + $local_sql .= "statname text,"; + $local_sql .= "statvalue double precision,"; + $local_sql .= "primary key (objectid, statname)"; + $local_sql .= ")"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX obj_stat_objid ON object_statistics USING btree (objectid)"; + $dbms->query($local_sql); + +case 41: + $local_sql = "CREATE INDEX history_pid_mod ON history(paramid, modified)"; + $dbms->query($local_sql); + +case 42: + + // The secondary indices on log_notification should not be unique + + $local_sql = "DROP INDEX lon_notificationid"; + $dbms->query($local_sql); + $local_sql = "CREATE INDEX lon_notificationid ON log_notification USING btree (notificationid)"; + $dbms->query($local_sql); + + $local_sql = "DROP INDEX lon_logid"; + $dbms->query($local_sql); + $local_sql = "CREATE INDEX lon_logid ON log_notification USING btree (logid)"; + $dbms->query($local_sql); + + // Additional information for the users + + $local_sql = "ALTER TABLE usr ADD COLUMN display_name text"; + $dbms->query($local_sql); + $local_sql = "ALTER TABLE usr ADD COLUMN email text"; + $dbms->query($local_sql); + + // Add issues for the services check + + $local_sql = "INSERT INTO type_of_issue (name, suggested_priority, description, active)"; + $local_sql .= " VALUES ('service unknown',5,'Service in log entry is unknown', true) "; + $dbms->query($local_sql); + $local_sql = "INSERT INTO type_of_issue (name, suggested_priority, description, active)"; + $local_sql .= " VALUES ('service not used',5,'Service in log entry is not used', true) "; + $dbms->query($local_sql); + + // Add a few more services + + $local_sql = "INSERT INTO service VALUES ('CROND','Cron Daemon', 1, 5) "; + $dbms->query($local_sql); + $local_sql = "INSERT INTO service VALUES ('gnucomo','Gnucomo Daemon', 1, 5) "; + $dbms->query($local_sql); + $local_sql = "INSERT INTO service VALUES ('sendmail','Mail Transport Agent', 1, 5) "; + $dbms->query($local_sql); + $local_sql = "INSERT INTO service VALUES ('dhcpd','DHCP Daemon', 1, 5) "; + $dbms->query($local_sql); + $local_sql = "INSERT INTO service VALUES ('rpc','NFS Services', 1, 5) "; + $dbms->query($local_sql); + $local_sql = "INSERT INTO service VALUES ('named','DNS Services', 1, 5) "; + $dbms->query($local_sql); + $local_sql = "INSERT INTO service VALUES ('xinetd','Internet Daemon', 1, 5) "; + $dbms->query($local_sql); + $local_sql = "INSERT INTO service VALUES ('ipop','Post Office Protocol', 1, 5) "; + $dbms->query($local_sql); + $local_sql = "INSERT INTO service VALUES ('mgetty','Serial port login and fax', 1, 5) "; + $dbms->query($local_sql); + $local_sql = "INSERT INTO service VALUES ('login','User login', 1, 5) "; + $dbms->query($local_sql); + $local_sql = "INSERT INTO service VALUES ('pam','Authentication modules', 1, 5) "; + $dbms->query($local_sql); + $local_sql = "INSERT INTO service VALUES ('modprobe','Kernel modules', 1, 5) "; + $dbms->query($local_sql); + +case 43: + + // We need to change the type of the 'delay' and 'xdelay' fields in + // the 'log_adv_daemon_email' table from type time to type interval. + // This can not be done directly; it requires recreating the entire + // table and copying data from the old table. + + $local_sql = "ALTER TABLE log_adv_daemon_email RENAME TO old_table"; + $dbms->query($local_sql); + + $local_sql = "CREATE TABLE log_adv_daemon_email + ( + source_ip INET, + destination_ip INET, + internal_messageid TEXT, + external_messageid TEXT, + to_email TEXT, + from_email TEXT, + delay interval, + xdelay interval, + mailer TEXT, + status TEXT, + pid INT, + size INT, + pri INT, + relay TEXT, + status_details TEXT, + dsn TEXT + ) INHERITS (log_adv_daemon)"; + $dbms->query($local_sql); + + $local_sql = "INSERT INTO log_adv_daemon_email SELECT * FROM old_table"; + $dbms->query($local_sql); + + $local_sql = "DROP TABLE old_table"; + $dbms->query($local_sql); + + // The indices need to be recreated as well. + + $local_sql = "CREATE INDEX log_adv_daemon_email_s_ip ON log_adv_daemon_email (source_ip)"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX log_adv_daemon_email_d_ip ON log_adv_daemon_email (destination_ip)"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX log_adv_daemon_email_to ON log_adv_daemon_email (to_email)"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX log_adv_daemon_email_from ON log_adv_daemon_email (from_email)"; + $dbms->query($local_sql); + + $local_sql = "CREATE INDEX log_adv_email_status ON log_adv_daemon_email (status)"; + $dbms->query($local_sql); + + case 44: + + $local_sql = "CREATE TABLE object_abuse + ( + objectid bigint, + source inet, + nr_abuses integer, + status text, + + primary key (objectid, source) + );"; + $dbms->query($local_sql); + $dbms->query("GRANT SELECT ON log_adv_daemon_email TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT SELECT ON object_abuse TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT INSERT ON object_abuse TO GROUP admin"); + $dbms->query("GRANT UPDATE ON object_abuse TO GROUP ops, GROUP admin"); + $dbms->query("GRANT DELETE ON object_abuse TO GROUP admin"); + $dbms->query("GRANT SELECT ON object_statistics TO GROUP view, GROUP ops, GROUP admin"); + + $local_sql = "INSERT INTO type_of_issue (name, suggested_priority, description, active)"; + $local_sql .= " VALUES ('abuses exceeded',5,'Abuse treshold exceeded from an IP address', true) "; + $dbms->query($local_sql); + + case 45: + + $local_sql = "CREATE TABLE service_pattern + ( + service text, + rank int, + pattern text, + action text, + argument text, + + primary key (service, rank) + )"; + $dbms->query($local_sql); + $local_sql = "INSERT INTO service_pattern VALUES ('ANY', 999999, '.+', 'notify', 'unmatched log')"; + $dbms->query($local_sql); + $local_sql = "INSERT INTO type_of_issue (name, suggested_priority, description, active)"; + $local_sql .= " VALUES ('unmatched log',5,'Log entries could not be matched', true) "; + $dbms->query($local_sql); + + case 46: + + $local_sql = "CREATE TABLE log_abuse + ( + logid bigint, + objectid bigint, + source inet + )"; + $dbms->query($local_sql); + + case 47: + + $local_sql = "INSERT INTO service_pattern VALUES ('ANY', 999990, '[Ee][Rr][Rr][Oo][Rr]', 'notify', 'Error detected')"; + $dbms->query($local_sql); + $local_sql = "INSERT INTO type_of_issue (name, suggested_priority, description, active)"; + $local_sql .= " VALUES ('Error detected',5,'An Error is reported in the log', true) "; + $dbms->query($local_sql); + + $local_sql = "INSERT INTO service_pattern VALUES ('ANY', 999991, '[Ff][Aa][Ii][Ll]', 'notify', 'Failure detected')"; + $dbms->query($local_sql); + $local_sql = "INSERT INTO type_of_issue (name, suggested_priority, description, active)"; + $local_sql .= " VALUES ('Failure detected',5,'A Failure is reported in the log', true) "; $dbms->query($local_sql); - $local_sql = "ALTER TABLE logng DROP COLUMN recognized"; + $local_sql = "INSERT INTO service_pattern VALUES ('ANY', 999992, '[Ww][Aa][Rr][Nn]', 'notify', 'Warning detected')"; + $dbms->query($local_sql); + $local_sql = "INSERT INTO type_of_issue (name, suggested_priority, description, active)"; + $local_sql .= " VALUES ('Warning detected',3,'A Warning is reported in the log', true) "; $dbms->query($local_sql); + + case 48: + + $dbms->query("GRANT SELECT ON service_pattern TO GROUP view, GROUP ops, GROUP admin"); + $dbms->query("GRANT INSERT ON service_pattern TO GROUP admin"); + $dbms->query("GRANT UPDATE ON service_pattern TO GROUP ops, GROUP admin"); + $dbms->query("GRANT DELETE ON service_pattern TO GROUP admin"); + $dbms->query("GRANT SELECT ON log_abuse TO GROUP view, GROUP ops, GROUP admin"); + + case 49: + $local_sql = "ALTER TABLE object_abuse ADD COLUMN last_change timestamp"; + $dbms->query($local_sql); + + case 50: + + $dbms->query("DROP SEQUENCE log_advid_seq"); + $dbms->query("DROP TABLE log_adv_kernel_network"); + $dbms->query("DROP TABLE log_adv_daemon_email"); + $dbms->query("DROP TABLE log_adv_daemon"); + $dbms->query("DROP TABLE log_adv"); + + case 51: + + $local_sql = "INSERT INTO type_of_issue (name, suggested_priority, description, active)"; + $local_sql .= " VALUES ('property out of range',5,'The DYNAMIC property of a parameter is out of range', true) "; + $dbms->query($local_sql); + + $local_sql = "INSERT INTO parameter_class (name, property_name, description, property_type, notify)"; + $local_sql .= " VALUES ('filesystem', 'device', 'Volume on which the filesystem resides', 'STATIC', 't')"; + $dbms->query($local_sql); + $local_sql = "INSERT INTO parameter_class (name, property_name, description, property_type, notify)"; + $local_sql .= " VALUES ('filesystem', 'size', 'Total size in kilobytes', 'STATIC', 't')"; + $dbms->query($local_sql); + $local_sql = "INSERT INTO parameter_class (name, property_name, description, property_type, min, max, notify)"; + $local_sql .= " VALUES ('filesystem', 'used', 'Number of kilobytes used', 'DYNAMIC', 0, 1000000, 't')"; + $dbms->query($local_sql); + $local_sql = "INSERT INTO parameter_class (name, property_name, description, property_type, min, max, notify)"; + $local_sql .= " VALUES ('filesystem', 'available', 'Number of kilobytes available', 'DYNAMIC', 1000, 1000000, 't')"; + $dbms->query($local_sql); + + case 52: + + $local_sql = "INSERT INTO parameter_class (name, property_name, description, property_type, notify)"; + $local_sql .= " VALUES ('filesystem', 'Inodes', 'Total number of i-nodes', 'STATIC', 't')"; + $dbms->query($local_sql); + $local_sql = "INSERT INTO parameter_class (name, property_name, description, property_type, min, max, notify)"; + $local_sql .= " VALUES ('filesystem', 'Iused', 'Number of i-nodes used', 'DYNAMIC', 0, 1000000, 't')"; + $dbms->query($local_sql); + $local_sql = "INSERT INTO parameter_class (name, property_name, description, property_type, min, max, notify)"; + $local_sql .= " VALUES ('filesystem', 'Ifree', 'Number of i-nodes available', 'DYNAMIC', 1000, 1000000, 't')"; + $dbms->query($local_sql); + + case 53: + + $dbms->query("GRANT UPDATE ON action_user_actionstepid_seq TO GROUP ops, GROUP admin"); + + $dbms->query("GRANT INSERT ON property TO GROUP admin"); + $dbms->query("GRANT UPDATE ON property TO GROUP admin"); + $dbms->query("CREATE INDEX log_ab_src ON log_abuse (source, objectid)"); + +/* +TODO: +*/ +//These columns have to be removed when a new version of PGSQL has become mainstream that supportsa DROP COLUMN +/* + + $local_sql = "ALTER TABLE log DROP COLUMN recognized"; + $dbms->query($local_sql); + */ }