***************
* 231 ==> 232 *
***************

- Field "submap_id" added to table "object_properties"
- Tables "maps", "map_access_lists", "submaps", "submap_object_positions", "submap_links" dropped


***************
* 230 ==> 231 *
***************

- Field "bridge_base_addr" added to table "nodes"


***************
* 229 ==> 230 *
***************

- Fields "bg_latitude", "bg_longitude", "bg_zoom" added to table "network_maps"
- Fields "horizontal_span", "vertical_span", "horizontal_alignment", "vertical_alignment"
  removed from table "dashboard_elements"
- Field "layout_data" added to table "dashboard_elements"
- Dashboards layout infornmation converted to XML and stored in single comlumn


***************
* 228 ==> 229 *
***************

- Added tables "dashboards" and "dashboard_elements"


***************
* 227 ==> 228 *
***************

- Maps from 1.0.x converted into network map objects
- Table "web_maps" deleted


***************
* 226 ==> 227 *
***************

- Column "zone_guid" added to table "clusters"


***************
* 225 ==> 226 *
***************

- Column "synthetic_mask" removed from table "interfaces"
- Columns "flags" added to table "interfaces"


***************
* 224 ==> 225 *
***************

- Columns "description" added to table "interfaces"


***************
* 223 ==> 224 *
***************

- Columns "zone_type" and "controller_ip" dropped from table "zones"
- Columns "agent_proxy", "snmp_proxy", "icmp_proxy" added to table "zones"
- Table "zone_ip_addr_list" dropped


***************
* 222 ==> 223 *
***************

- Column "node_type" dropped from table "nodes"
- Column "primary_name" added to table "nodes"
- Table "oid_to_type" dropped


***************
* 217 ==> 218 *
***************

- All text columns in table "snmp_communities" converted from # encoded format


***************
* 216 ==> 217 *
***************

- New column "snmp_port" added to table "nodes"
- New column "snmp_port" added to table "items"
- All text columns in table "nodes" converted from # encoded format
- All text columns in table "items" converted from # encoded format


***************
* 215 ==> 216 *
***************

- Column "description" in table ap_common converted from # encoded format
- Column "file_content" in table ap_config_files converted from # encoded format
- Column "file_name" removed from table "ap_config_files"
- New field "guid" in table "object_properties"
- GUIDs generated for all objects


***************
* 214 ==> 215 *
***************

- New tables added:
	CREATE TABLE network_maps
	(
		id integer not null,
		map_type integer not null,
		layout integer not null,
		seed integer not null,
		background integer not null,
		PRIMARY KEY(id)
	) TABLE_TYPE;

	CREATE TABLE network_map_elements
	(
		map_id integer not null,
		element_id integer not null,
		element_type integer not null,
		element_data SQL_TEXT not null,
		PRIMARY KEY(map_id,element_id)
	) TABLE_TYPE;

	CREATE TABLE network_map_links
	(
		map_id integer not null,
		element1 integer not null,
		element2 integer not null,
		link_type integer not null,
		link_name varchar(255) null,
		connector_name1 varchar(63) null,
		connector_name2 varchar(63) null,
		PRIMARY KEY(map_id,element1,element2)
	) TABLE_TYPE;


***************
* 208 ==> 209 *
***************

- New fields added to table "users":
	auth_failures integer not null,
	last_passwd_change integer not null,
	min_passwd_length integer not null,
	disabled_until integer not null,
	last_login integer not null,
	password_history SQL_TEXT
- New configuration parameters added: PasswordHistoryLength,
     IntruderLockoutThreshold, MinPasswordLength, PasswordComplexity,
     PasswordExpiration, BlockInactiveUserAccounts, IntruderLockoutTime


***************
* 207 ==> 208 *
***************

- New columns added to table "items":
	system_tag varchar(255)


***************
* 206 ==> 207 *
***************

- New configuration parameters added: RADIUSSecondaryServer,
  RADIUSSecondarySecret, RADIUSSecondaryPort, ExternalAuditServer,
  ExternalAuditPort, ExternalAuditFacility, ExternalAuditSeverity,
  ExternalAuditTag


***************
* 205 ==> 206 *
***************

- Escaped characters with # replaced in tables "audit_log", "event_log",
  "snmp_trap_log", and "syslog"


***************
* 204 ==> 205 *
***************

- New table added:
	CREATE TABLE usm_credentials
	(
		id integer not null,
		user_name varchar(255) not null,
		auth_method integer not null,
		priv_method integer not null,
		auth_password varchar(255),
		priv_password varchar(255),
		PRIMARY KEY(id)
	) TABLE_TYPE;


***************
* 203 ==> 204 *
***************

- New columns added to table "object_properties":
	location_type integer
	latitude varchar(20)
	longitude varchar(20)
- Column "image_id" deleted from table "object_properties"
- Escaped characters with # replaced in table "object_properties"


***************
* 202 ==> 203 *
***************

- Added object tool "Topology table (LLDP)"


***************
* 201 ==> 202 *
***************

- Escaped characters with # replaced in table "alarms"


****************
* 200 ==> 201 *
***************

- New columns added to table "nodes":
   usm_auth_password varchar(127) not null,
   usm_priv_password varchar(127) not null,
   usm_methods integer not null


**************
* 92 ==> 200 *
* 93 ==> 201 *
* 94 ==> 202 *
* 95 ==> 203 *
* 96 ==> 204 *
* 97 ==> 205 *
* 98 ==> 206 *
* 99 ==> 207 *
**************

- New tables added:
	CREATE TABLE ap_common
	(
		id integer not null,
		policy_type integer not null,
		version integer not null,
		description SQL_TEXT not null,
		PRIMARY KEY(id)
	) TABLE_TYPE;

	CREATE TABLE ap_bindings
	(
		policy_id integer not null,
		node_id integer not null,
		PRIMARY KEY(policy_id,node_id)
	) TABLE_TYPE;

	CREATE TABLE ap_config_files
	(
		policy_id integer not null,
		file_name varchar(63) not null,
		file_content SQL_TEXT not null,
		PRIMARY KEY(policy_id)
	) TABLE_TYPE;


*************
* 91 ==> 92 *
*************

- Tables dropped: images, default_images


*************
* 90 ==> 91 *
*************

- New table added:
	CREATE TABLE userdb_custom_attributes
	(
		object_id integer not null,
		attr_name varchar(255) not null,
		attr_value SQL_TEXT not null,
		PRIMARY KEY(object_id,attr_name)
	) TABLE_TYPE;


*************
* 89 ==> 90 *
*************

- New fields added to table "items":
	ALTER TABLE items ADD base_units integer not null
	ALTER TABLE items ADD unit_multiplier integer not null
	ALTER TABLE items ADD custom_units_name varchar(63) not null
	ALTER TABLE items ADD perftab_settings SQL_TEXT not null


*************
* 88 ==> 89 *
*************

- New fields added to table "containers":
	ALTER TABLE containers ADD enable_auto_bind integer not null
	ALTER TABLE containers ADD auto_bind_filter SQL_TEXT not null
- New fields added to table "cluster_resources":
	ALTER TABLE cluster_resources ADD current_owner integer not null
- New event added:
	INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
		(
			EVENT_DB_QUERY_FAILED, 'SYS_DB_QUERY_FAILED',
			EVENT_SEVERITY_CRITICAL, 1,
			'Database query failed (Query: %1; Error: %2)',
			'Generated when SQL query to backend database failed.#0D#0A' CONCAT
			'Parameters:#0D#0A' CONCAT
			'   1) Query#0D#0A' CONCAT
			'   2) Error message'
		);


*************
* 87 ==> 88 *
*************

- New columns added to table "templates":
	ALTER TABLE templates ADD enable_auto_apply integer not null
	ALTER TABLE templates ADD apply_filter SQL_TEXT not null


*************
* 86 ==> 87 *
*************

- New table "metadata" added for storing data like schema version,
  database syntax, etc.
	CREATE TABLE metadata
	(
		var_name varchar(63) not null,
		var_value varchar(255) not null,
		PRIMARY KEY(var_name)
	) TABLE_TYPE;
- Configuration parameters DBFormatVersion, DBSyntax,
  IDataTableCreationCommand, IDataIndexCreationCommand_* moved to
  "metadata" table


*************
* 85 ==> 86 *
*************

- Unused tables removed: alarm_grops, alarm_group_map, alarm_change_log,
                         lpp, lpp_associations, lpp_rulesets,
                         lpp_rules, lpp_groups


*************
* 84 ==> 85 *
*************

- New columns added to table "nodes":
	ALTER TABLE nodes ADD use_ifxtable integer not null
- New configuration parameters: UseIfXTable, SMTPRetryCount


*************
* 83 ==> 84 *
*************

- New configuration parameters: EnableAgentRegistration, AnonymousFileAccess,
  EnableISCListener, ReceiveForwardedEvents


*************
* 82 ==> 83 *
*************

- Fix incorrect alarm timeouts:
	UPDATE alarms SET timeout=0,timeout_event=43


*************
* 81 ==> 82 *
*************

- New table added:
	CREATE TABLE config_clob
	(
		var_name varchar(63) not null,
		var_value SQL_TEXT not null,
		PRIMARY KEY(var_name)
	) TABLE_TYPE;


*************
* 80 ==> 81 *
*************

- New column added to table "dci_schedules":
	ALTER TABLE dci_schedules ADD schedule_id integer not null
- Set primary key constraints:
	dci_schedules    ---> item_id,schedule_id
	address_lists    ---> list_type,community_id,addr_type,addr1,addr2
	lpp_associations ---> lpp_id,node_id,log_file
- New tables added:
	CREATE TABLE object_custom_attributes
	(
   		object_id integer not null,
   		attr_name varchar(127) not null,
   		attr_value SQL_TEXT not null,
   		PRIMARY KEY(object_id,attr_name)
	) TABLE_TYPE;
	CREATE TABLE web_maps
	(
	   id integer not null,
	   title varchar(63) not null,
	   properties SQL_TEXT not null,
	   data SQL_TEXT not null,
	   PRIMARY KEY(id)
	) TABLE_TYPE;


*************
* 79 ==> 80 *
*************

- New columns added to table "nodes":
	ALTER TABLE nodes ADD uname varchar(255) not null


*************
* 78 ==> 79 *
*************

- Table "modules" deleted
- MySQL only: column type blob changed to text in schema
- Configuration parameter RetainCustomInterfaceNames deleted


*************
* 77 ==> 78 *
*************

- New table added:
	CREATE TABLE trusted_nodes
	(
		source_object_id integer not null,
		target_node_id integer not null,
		PRIMARY KEY(source_object_id,target_node_id)
	) TABLE_TYPE;
- New configuration parameter added: CheckTrustedNodes


*************
* 76 ==> 77 *
*************

- Table "cond_dci_map" altered:
	- Added new column sequence_number (type "integer not null")
	- Primary key changed to "condition_id,sequence_number"


*************
* 75 ==> 76 *
*************

- New events added:
INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
	(
		EVENT_NETWORK_CONNECTION_LOST, 'SYS_NETWORK_CONN_LOST',
		EVENT_SEVERITY_CRITICAL, 1,
		'NetXMS server network connectivity lost',
		'Generated when system detects loss of network connectivity based on beacon probing.#0D#0A' CONCAT
		'Parameters:#0D#0A' CONCAT
		'   1) Number of beacons'
	);
INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
	(
		EVENT_NETWORK_CONNECTION_RESTORED, 'SYS_NETWORK_CONN_RESTORED',
		EVENT_SEVERITY_NORMAL, 1,
		'NetXMS server network connectivity restored',
		'Generated when system detects restoration of network connectivity based on beacon probing.#0D#0A' CONCAT
		'Parameters:#0D#0A' CONCAT
		'   1) Number of beacons'
	);
- New configuration parameters added: AgentCommandTimeout, BeaconHosts,
  BeaconTimeout, BeaconPollingInterval


*************
* 74 ==> 75 *
*************

- New table added:
	CREATE TABLE snmp_communities
	(
		id integer not null,
		community varchar(255) not null,
		PRIMARY KEY(id)
	) TABLE_TYPE;
- New columns added to table "address_lists":
	ALTER TABLE address_lists ADD community_id integer not null
- New configuration parameters added: UseInterfaceAliases, SyncNodeNamesWithDNS


*************
* 73 ==> 74 *
*************

- New configuration parameters added: EnableEventStormDetection,
  EventStormEventsPerSecond, EventStormDuration
- Removed configuration parameters NumberOfEventProcessors, EventStormThreshold
- New events added:
	INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
	(
		EVENT_EVENT_STORM_DETECTED, 'SYS_EVENT_STORM_DETECTED',
		EVENT_SEVERITY_MAJOR, 1,
		'Event storm detected (Events per second: %1)',
		'Generated when system detects an event storm.#0D#0A' CONCAT
		'Parameters:#0D#0A' CONCAT
		'   1) Events per second#0D#0A' CONCAT
		'   2) Duration#0D#0A' CONCAT
		'   3) Threshold'
	);
	INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
	(
		EVENT_EVENT_STORM_ENDED, 'SYS_EVENT_STORM_ENDED',
		EVENT_SEVERITY_NORMAL, 1,
		'Event storm ended',
		'Generated when system clears event storm condition.#0D#0A' CONCAT
		'Parameters:#0D#0A' CONCAT
		'   1) Events per second#0D#0A' CONCAT
		'   2) Duration#0D#0A' CONCAT
		'   3) Threshold'
	);


*************
* 72 ==> 73 *
*************

- New columns added to table "event_policy":
	ALTER TABLE event_policy ADD situation_id integer not null
	ALTER TABLE event_policy ADD situation_instance varchar(255) not null
- New table added:
	CREATE TABLE policy_situation_attr_list
	(
		rule_id integer not null,
		situation_id integer not null,
		attr_name varchar(255) not null,
		attr_value varchar(255) not null,
		PRIMARY KEY(rule_id,situation_id,attr_name)
	) TABLE_TYPE;
- New table added:
	CREATE TABLE situations
	(
		id integer not null,
		name varchar(127) not null,
		comments SQL_TEXT not null,
		PRIMARY KEY(id)
	) TABLE_TYPE;
- New configuration parameters added: RetainCustomInterfaceNames,
  AllowDirectSMS, EventStormThreshold


*************
* 71 ==> 72 *
*************

- New column added to table "items":
	ALTER TABLE items ADD proxy_node integer not null


*************
* 70 ==> 71 *
*************

- New column added to table "nodes":
	ALTER TABLE nodes ADD required_polls integer not null
- New column added to table "interfaces":
	ALTER TABLE interfaces ADD required_polls integer not null
- New column added to table "network_services":
	ALTER TABLE network_services ADD required_polls integer not null
- New configuration parameter added: PollCountForStatusChange


*************
* 69 ==> 70 *
*************

- New column added to table "snmp_trap_cfg":
	ALTER TABLE snmp_trap_cfg ADD user_tag varchar(63) not null
- New column added to table "event_log":
	ALTER TABLE event_log ADD user_tag varchar(63) not null


*************
* 68 ==> 69 *
*************
       
- New table "audit_log" added:
	CREATE TABLE audit_log
	(
		record_id integer not null,
		timestamp integer not null,
		subsystem varchar(32) not null,
		success integer not null,
		user_id integer not null,
		workstation varchar(63) not null,
		object_id integer not null,
		message SQL_TEXT not null,
		PRIMARY KEY(record_id)
	);


*************
* 67 ==> 68 *
*************

- New configuration parameter added: ThresholdRepeatInterval
- New column added to table "thresholds":
	ALTER TABLE thresholds ADD repeat_interval integer not null


*************
* 66 ==> 67 *
*************

- New column added to table "subnets":
	ALTER TABLE subnets ADD synthetic_mask integer not null
- New column added to table "interfaces":
	ALTER TABLE interfaces ADD synthetic_mask integer not null


*************
* 65 ==> 66 *
*************

- New columns added to table "submap_links":
	ALTER TABLE submap_links ADD port1 varchar(255) not null
	ALTER TABLE submap_links ADD port2 varchar(255) not null


*************
* 64 ==> 65 *
*************

- Field "community" in table "nodes" changed to varchar(127)


*************
* 63 ==> 64 *
*************

- New OID to type mappings:
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (15,'.1.3.6.1.4.1.45.3.29.*',NODE_TYPE_NORTEL_BAYSTACK,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (16,'.1.3.6.1.4.1.45.3.41.*',NODE_TYPE_NORTEL_BAYSTACK,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (17,'.1.3.6.1.4.1.45.3.45.*',NODE_TYPE_NORTEL_BAYSTACK,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (18,'.1.3.6.1.4.1.45.3.43.*',NODE_TYPE_NORTEL_BAYSTACK,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (19,'.1.3.6.1.4.1.45.3.57.*',NODE_TYPE_NORTEL_BAYSTACK,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (20,'.1.3.6.1.4.1.45.3.49.*',NODE_TYPE_NORTEL_BAYSTACK,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (21,'.1.3.6.1.4.1.45.3.54.*',NODE_TYPE_NORTEL_BAYSTACK,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (22,'.1.3.6.1.4.1.45.3.63.*',NODE_TYPE_NORTEL_BAYSTACK,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (23,'.1.3.6.1.4.1.45.3.64.*',NODE_TYPE_NORTEL_BAYSTACK,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (24,'.1.3.6.1.4.1.45.3.53.*',NODE_TYPE_NORTEL_BAYSTACK,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (25,'.1.3.6.1.4.1.45.3.59.*',NODE_TYPE_NORTEL_BAYSTACK,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (26,'.1.3.6.1.4.1.45.3.39.*',NODE_TYPE_NORTEL_BAYSTACK,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (27,'.1.3.6.1.4.1.45.3.65.*',NODE_TYPE_NORTEL_BAYSTACK,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (28,'.1.3.6.1.4.1.45.3.66.*',NODE_TYPE_NORTEL_BAYSTACK,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (29,'.1.3.6.1.4.1.45.3.44.*',NODE_TYPE_OPTERA_METRO,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (30,'.1.3.6.1.4.1.45.3.47.*',NODE_TYPE_OPTERA_METRO,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (31,'.1.3.6.1.4.1.45.3.48.*',NODE_TYPE_OPTERA_METRO,0);


*************
* 62 ==> 63 *
*************

- New events added:
INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
	(
		EVENT_INTERFACE_UNKNOWN, 'SYS_IF_UNKNOWN',
		EVENT_SEVERITY_WARNING, 1,
		'Interface "%2" changed state to UNKNOWN (IP Addr: %3/%4, IfIndex: %5)',
		'Generated when interface goes to unknown state.#0D#0A' CONCAT
		'Please note that source of event is node, not an interface itself.#0D#0A' CONCAT
		'Parameters:#0D#0A' CONCAT
		'   1) Interface object ID#0D#0A' CONCAT
		'   2) Interface name#0D#0A' CONCAT
		'   3) Interface IP address#0D#0A' CONCAT
		'   4) Interface netmask#0D#0A' CONCAT
		'   5) Interface index'
	);
INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
	(
		EVENT_INTERFACE_DISABLED, 'SYS_IF_DISABLED',
		EVENT_SEVERITY_NORMAL, 1,
		'Interface "%2" disabled (IP Addr: %3/%4, IfIndex: %5)',
		'Generated when interface administratively disabled.#0D#0A' CONCAT
		'Please note that source of event is node, not an interface itself.#0D#0A' CONCAT
		'Parameters:#0D#0A' CONCAT
		'   1) Interface object ID#0D#0A' CONCAT
		'   2) Interface name#0D#0A' CONCAT
		'   3) Interface IP address#0D#0A' CONCAT
		'   4) Interface netmask#0D#0A' CONCAT
		'   5) Interface index'
	);
INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
	(
		EVENT_INTERFACE_TESTING, 'SYS_IF_TESTING',
		EVENT_SEVERITY_NORMAL, 1,
		'Interface "%2" is testing (IP Addr: %3/%4, IfIndex: %5)',
		'Generated when interface goes to testing state.#0D#0A' CONCAT
		'Please note that source of event is node, not an interface itself.#0D#0A' CONCAT
		'Parameters:#0D#0A' CONCAT
		'   1) Interface object ID#0D#0A' CONCAT
		'   2) Interface name#0D#0A' CONCAT
		'   3) Interface IP address#0D#0A' CONCAT
		'   4) Interface netmask#0D#0A' CONCAT
		'   5) Interface index'
	);


*************
* 61 ==> 62 *
*************

- Column "alarm_ack_key" removed from table "event_policy"
- New columns added to table "event_policy":
	ALTER TABLE event_policy ADD alarm_timeout integer not null
	ALTER TABLE event_policy ADD alarm_timeout_event integer not null
- New events added:
	INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
		(
			EVENT_ALARM_TIMEOUT, 'SYS_ALARM_TIMEOUT',
			EVENT_SEVERITY_WARNING, 1,
			'Alarm timeout',
			'Generated when alarm timeout expires.#0D#0A' CONCAT
			'Parameters:#0D#0A' CONCAT
			'   1) Alarm ID#0D#0A' CONCAT
			'   2) Alarm message#0D#0A' CONCAT
			'   3) Alarm key#0D#0A' CONCAT
			'   4) Original event code'
		);
	INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
		(
			EVENT_LOG_RECORD_MATCHED, 'SYS_LOG_RECORD_MATCHED',
			EVENT_SEVERITY_WARNING, 1,
			'Log record matched (Policy: %1; File: %2; Record: %4)',
			'Default event for log record match.#0D#0A' CONCAT
			'Parameters:#0D#0A' CONCAT
			'   1) Policy name#0D#0A' CONCAT
			'   2) Log file name#0D#0A' CONCAT
			'   3) Matching regular expression#0D#0A' CONCAT
			'   4) Matched record#0D#0A' CONCAT
			'   5 .. 9) Reserved#0D#0A' CONCAT
			'   10 .. 99) Substrings extracted by regular expression'
		);
- New tables added:
CREATE TABLE lpp_groups
(
	lpp_group_id integer not null,
	lpp_group_name varchar(63) not null,
	parent_group integer not null,	// 0 for root
	PRIMARY KEY(lpp_group_id)
) TABLE_TYPE;

CREATE TABLE lpp
(
	lpp_id integer not null,
	lpp_group_id integer not null,	// 0 for root
	lpp_name varchar(63) not null,
	lpp_version integer not null,
	lpp_flags integer not null,
	PRIMARY KEY(lpp_id)
) TABLE_TYPE;

CREATE TABLE lpp_associations
(
	lpp_id integer not null,
	node_id integer not null,
	log_file varchar(255) not null
) TABLE_TYPE;

CREATE TABLE lpp_rulesets
(
	ruleset_id integer not null,
	ruleset_name varchar(63),
	PRIMARY KEY(ruleset_id)
) TABLE_TYPE;

CREATE TABLE lpp_rules
(
	lpp_id integer not null,
	rule_number integer not null,
	ruleset_id integer not null,	// 0 - matching rule, >0 - ruleset id
	msg_id_start integer not null,
	msg_id_end integer not null,
	severity integer not null,
	source_name varchar(255) not null,
	msg_text_regexp varchar(255) not null,
	event_code integer not null,
	PRIMARY KEY(lpp_id,rule_number)
) TABLE_TYPE;
- New fields added to table "alarms":
	ALTER TABLE alarms ADD timeout integer;
	ALTER TABLE alarms ADD timeout_event integer;


*************
* 60 ==> 61 *
*************

- New configuration parameters: TopologyExpirationTime, TopologyDiscoveryRadius
- Object tool "Nortel topology" changed:
	INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,matching_oid,description,confirmation_text)
		VALUES (14,'&Info->Topology table (Nortel)',TOOL_TYPE_TABLE_SNMP,'Topology table',1,' ','Show topology table (Nortel protocol)','#00');
	INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
		VALUES (14,0,'Peer IP','.1.3.6.1.4.1.45.1.6.13.2.1.1.3',CFMT_IP_ADDR,0);
	INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
		VALUES (14,1,'Peer MAC','.1.3.6.1.4.1.45.1.6.13.2.1.1.5',CFMT_MAC_ADDR,0);
	INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
		VALUES (14,2,'Slot','.1.3.6.1.4.1.45.1.6.13.2.1.1.1',CFMT_INTEGER,0);
	INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
		VALUES (14,3,'Port','.1.3.6.1.4.1.45.1.6.13.2.1.1.2',CFMT_INTEGER,0);
- New object tools added:
INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,matching_oid,description,confirmation_text)
	VALUES (17,'&Info->AR&P cache (SNMP)',TOOL_TYPE_TABLE_SNMP,'ARP Cache',1,' ','Show ARP cache','#00');
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (17,0,'IP Address','.1.3.6.1.2.1.4.22.1.3',CFMT_IP_ADDR,0);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (17,1,'MAC Address','.1.3.6.1.2.1.4.22.1.2',CFMT_MAC_ADDR,0);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (17,2,'Interface','.1.3.6.1.2.1.4.22.1.1',CFMT_IFINDEX,0);

INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,matching_oid,description,confirmation_text)
	VALUES (18,'&Info->AR&P cache (Agent)',TOOL_TYPE_TABLE_AGENT,
		'ARP Cache#7FNet.ArpCache#7F(.*) (.*) (.*)',2,' ','Show ARP cache','#00');
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (18,0,'IP Address','.1.3.6.1.2.1.4.22.1.3',CFMT_STRING,2);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (18,1,'MAC Address','.1.3.6.1.2.1.4.22.1.2',CFMT_STRING,1);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (18,2,'Interface','.1.3.6.1.2.1.4.22.1.1',CFMT_IFINDEX,3);

INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,matching_oid,description,confirmation_text)
	VALUES (19,'&Info->&Routing table (SNMP)',TOOL_TYPE_TABLE_SNMP,'Routing Table',1,' ','Show IP routing table','#00');
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (19,0,'Destination','.1.3.6.1.2.1.4.21.1.1',CFMT_IP_ADDR,0);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (19,1,'Mask','.1.3.6.1.2.1.4.21.1.11',CFMT_IP_ADDR,0);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (19,2,'Next hop','.1.3.6.1.2.1.4.21.1.7',CFMT_IP_ADDR,0);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (19,3,'Metric','.1.3.6.1.2.1.4.21.1.3',CFMT_INTEGER,0);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (19,4,'Interface','.1.3.6.1.2.1.4.21.1.2',CFMT_IFINDEX,0);

	INSERT INTO object_tools_acl (tool_id,user_id) VALUES (17,-2147483648);
	INSERT INTO object_tools_acl (tool_id,user_id) VALUES (18,-2147483648);
	INSERT INTO object_tools_acl (tool_id,user_id) VALUES (19,-2147483648);


*************
* 59 ==> 60 *
*************

- New table added:
	CREATE TABLE certificates
	(
		cert_id integer not null,
		cert_type integer not null,
		cert_data SQL_TEXT not null,
		subject SQL_TEXT not null,
		comments SQL_TEXT not null,
		PRIMARY KEY(cert_id)
	) TABLE_TYPE;
- New configuration parameters: SNMPRequestTimeout


*************
* 58 ==> 59 *
*************

- Added columns "cert_mapping_method" and "cert_mapping_data" to table "users":
	ALTER TABLE users ADD cert_mapping_method integer;
	ALTER TABLE users ADD cert_mapping_data SQL_TEXT;
	UPDATE users SET cert_mapping_method=0;
	UPDATE users SET cert_mapping_data='#00';
- New configuration parameters: InternalCA


*************
* 57 ==> 58 *
*************

- Added column "is_system" to table "object_properties":
	ALTER TABLE object_properties ADD is_system integer;
	UPDATE object_properties SET is_system=0;
- New tables added:
	CREATE TABLE graphs
	(
		graph_id integer not null,
		owner_id integer not null,
		name varchar(255) not null,
		config SQL_TEXT not null,
		PRIMARY KEY(graph_id)
	) TABLE_TYPE;
	CREATE TABLE graph_acl
	(
		graph_id integer not null,
		user_id integer not null,
		user_rights integer not null,
		PRIMARY KEY(graph_id,user_id)
	) TABLE_TYPE;


*************
* 56 ==> 57 *
*************

- Added column "resource_id" to table "items":
	ALTER TABLE items ADD resource_id integer;
	UPDATE items SET resource_id=0;
- Added column "snmp_poxy" to table "nodes":
	ALTER TABLE nodes ADD snmp_proxy integer;
	UPDATE nodes SET snmp_proxy=0;


*************
* 55 ==> 56 *
*************

- New table added:
	CREATE TABLE cluster_resources
	(
		cluster_id integer not null,
		resource_id integer not null,
		resource_name varchar(255) not null,
		ip_addr varchar(15) not null,
		PRIMARY KEY(cluster_id,resource_id)
	) TABLE_TYPE;
- New events added:
	INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
		(
			EVENT_CLUSTER_RESOURCE_MOVED, 'SYS_CLUSTER_RESOURCE_MOVED',
			EVENT_SEVERITY_WARNING, 1,
			'Cluster resource "%2" moved from node %4 to node %6',
			'Generated when cluster resource moved between nodes.#0D#0A' CONCAT
			'Parameters:#0D#0A' CONCAT
			'   1) Resource ID#0D#0A' CONCAT
			'   2) Resource name#0D#0A' CONCAT
			'   3) Previous owner node ID#0D#0A' CONCAT
			'   4) Previous owner node name#0D#0A' CONCAT
			'   5) New owner node ID#0D#0A' CONCAT
			'   6) New owner node name'
		);
	INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
		(
			EVENT_CLUSTER_RESOURCE_DOWN, 'SYS_CLUSTER_RESOURCE_DOWN',
			EVENT_SEVERITY_MAJOR, 1,
			'Cluster resource "%2" is down (last owner was %4)',
			'Generated when cluster resource goes down.#0D#0A' CONCAT
			'Parameters:#0D#0A' CONCAT
			'   1) Resource ID#0D#0A' CONCAT
			'   2) Resource name#0D#0A' CONCAT
			'   3) Last owner node ID#0D#0A' CONCAT
			'   4) Last owner node name'
		);
	INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
		(
			EVENT_CLUSTER_RESOURCE_UP, 'SYS_CLUSTER_RESOURCE_UP',
			EVENT_SEVERITY_NORMAL, 1,
			'Cluster resource "%2" is up (new owner is %4)',
			'Generated when cluster resource goes up.#0D#0A' CONCAT
			'Parameters:#0D#0A' CONCAT
			'   1) Resource ID#0D#0A' CONCAT
			'   2) Resource name#0D#0A' CONCAT
			'   3) New owner node ID#0D#0A' CONCAT
			'   4) New owner node name'
		);
	INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
		(
			EVENT_CLUSTER_DOWN, 'SYS_CLUSTER_DOWN',
			EVENT_SEVERITY_CRITICAL, 1,
			'Cluster is down',
			'Generated when cluster goes down.#0D#0A' CONCAT
			'Parameters:#0D#0A' CONCAT
			'   No message-specific parameters'
		);
	INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
		(
			EVENT_CLUSTER_UP, 'SYS_CLUSTER_UP',
			EVENT_SEVERITY_NORMAL, 1,
			'Cluster is up',
			'Generated when cluster goes up.#0D#0A' CONCAT
			'Parameters:#0D#0A' CONCAT
			'   No message-specific parameters'
		);


*************
* 54 ==> 55 *
*************

- New tables added:
	CREATE TABLE clusters
	(
		id integer not null,
		cluster_type integer not null,
		PRIMARY KEY(id)
	) TABLE_TYPE;
	CREATE TABLE cluster_members
	(
		cluster_id integer not null,
		node_id integer not null,
		PRIMARY KEY(cluster_id,node_id)
	) TABLE_TYPE;
	CREATE TABLE cluster_sync_subnets
	(
		cluster_id integer not null,
		subnet_addr varchar(15) not null,
		subnet_mask varchar(15) not null,
		PRIMARY KEY(cluster_id,subnet_addr)
	) TABLE_TYPE;
- Column "description" removed from table "nodes"
- Column "description" removed from table "containers"
- Column "description" removed from table "zones"
- Column "description" removed from table "templates"
- New object image:
	INSERT INTO images (image_id,name,file_name_png,file_hash_png,file_name_ico,file_hash_ico)
		VALUES (16,'Obj.Cluster','cluster.png','<invalid_hash>',
                	'cluster.ico','<invalid_hash>');
	INSERT INTO default_images (object_class,image_id)
		VALUES (14,16);
- New OID to type mappings:
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (12,'.1.3.6.1.4.1.45.3.46.*',3,0);
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (13,'.1.3.6.1.4.1.45.3.52.*',3,0);
- New configuration parameters: WindowsConsoleUpgradeURL


*************
* 53 ==> 54 *
*************

- New table added:
	CREATE TABLE address_lists
	(
		list_type integer not null, // discovery filter, etc.
		addr_type integer not null, // 0 - addr/mask, 1 - address range
		addr1 varchar(15) not null,
		addr2 varchar(15) not null
	) TABLE_TYPE;
	CREATE INDEX idx_address_lists_list_type ON address_lists(list_type);
- New configuration parameters: ActiveNetworkDiscovery, DiscoveryFilterFlags,
     ActiveDiscoveryInterval
- Delete configuration parameters: EnableAccessControl,
     EnableEventsAccessControl


*************
* 52 ==> 53 *
*************

- Indexes for idata tables changed


*************
* 51 ==> 52 *
*************

- New configuration parameter: MailEncoding
- Object tool "Configured ICMP targets" updated (new column "packet size" added)
	UPDATE object_tools SET tool_data='Configured ICMP targets#7FICMP.TargetList#7F^(.*) (.*) (.*) (.*) (.*)' WHERE tool_id=12;
	UPDATE object_tools_table_columns SET col_number=4 WHERE col_number=3 AND tool_id=12;
	UPDATE object_tools_table_columns SET col_number=3 WHERE col_number=2 AND tool_id=12;
	UPDATE object_tools_table_columns SET col_substr=5 WHERE col_number=1 AND tool_id=12;
	INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
		VALUES (12,2,'Packet size','',0,4);
- New object tool added:
INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,matching_oid,description,confirmation_text)
	VALUES (16,'&Info->Active &user sessions',TOOL_TYPE_TABLE_AGENT,
                'Active User Sessions#7FSystem.ActiveUserSessions#7F^"(.*)" "(.*)" "(.*)"',2,'','Show list of active user sessions','#00');
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (16,0,'User','',0,1);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (16,1,'Terminal','',0,2);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (16,2,'From','',0,3);


*************
* 50 ==> 51 *
*************

- Columns "range_start" and "range_end" added to table "event_groups"


*************
* 49 ==> 50 *
*************

- Column "confirmation_text" added to table "object_tools"
- Default confirmation texts set for agent restart, system restart, and system
  shutdown tools


*************
* 48 ==> 49 *
*************

- Column "rearm_event_code" added to table "thresholds"
- Column "all_thresholds" added to table "items"


*************
* 47 ==> 48 *
*************

- Added table "policy_time_range_list":
	CREATE TABLE policy_time_range_list
	(
		rule_id integer not null,
		time_range_id integer not null,
		PRIMARY KEY(rule_id,time_range_id)
	) TABLE_TYPE;
- Added table "time_ranges":
	CREATE TABLE time_ranges
	(
		time_range_id integer not null,
		wday_mask integer not null,	// Bits 0 .. 6 for each day of week
		mday_mask integer not null,	// Bits 0 .. 30 for each day of month
		month_mask integer not null,	// Bits 0 .. 11 for each month
		time_range varchar(255) not null, // In format HHMMHHMM[,HHMMHHMM[,...]]
		PRIMARY KEY(time_range_id)
	) TABLE_TYPE;
- Column "script" added to table "event_policy"


*************
* 46 ==> 47 *
*************

- Column "current_state" added to table "thresholds"
- Column "comments" added to table "object_properties"
- Column "discovery_flags" removed from table "nodes"
- Table "alarm_notes" redesigned:
	CREATE TABLE alarm_notes
	(
		note_id integer not null,
		alarm_id integer not null,
		change_time integer not null,
		user_id integer not null,	// Last edited by
		note_text SQL_TEXT not null,
		PRIMARY KEY(note_id)
	) TABLE_TYPE;
	CREATE INDEX idx_alarm_notes_alarm_id ON alarm_notes(alarm_id);
- Table "alarms" redesigned:
	CREATE TABLE alarms
	(
		alarm_id integer not null,	// Unique alarm identifier
		alarm_state integer not null,
		hd_state integer not null,	// Help desk system state
		hd_ref varchar(63) not null,	// Help desk reference
		creation_time integer not null,
		last_change_time integer not null,
		source_object_id integer not null,
		source_event_code integer not null,
		source_event_id SQL_INT64 not null,
		message varchar(255) not null,
		original_severity integer not null,
		current_severity integer not null,
		repeat_count integer not null,
		alarm_key varchar(255) not null, // Alarm key (used for auto acknowlegment)
		ack_by integer not null,         // ID of user who acknowleges alarm
		term_by integer not null,        // ID of user who was terminated alarm
		PRIMARY KEY(alarm_id)
	) TABLE_TYPE;
- Table "alarm_change_log" added:
	CREATE TABLE alarm_change_log
	(
		change_id SQL_INT64 not null,
		change_time integer not null,
		alarm_id integer not null,
		opcode integer not null,	// Operation code
		user_id integer not null,
		info_text SQL_TEXT not null,	// Additional information
		PRIMARY KEY(change_id)
	) TABLE_TYPE;
	CREATE INDEX idx_alarm_change_log_alarm_id ON alarm_change_log(alarm_id);
- Table "alarm_groups" added:
	CREATE TABLE alarm_grops
	(
		alarm_group_id integer not null,
		group_name varchar(255) not null,
		PRIMARY KEY(alarm_group_id)
	) TABLE_TYPE;
- Table "alarm_group_map" added:
	CREATE TABLE alarm_group_map
	(
		alarm_group_id integer not null,
		alarm_id integer not null,
		PRIMARY KEY(alarm_group_id,alarm_id)
	) TABLE_TYPE;


*************
* 45 ==> 46 *
*************

- Object tool "Switch FDB" updated:
      UPDATE object_tools_table_columns SET col_format=5 WHERE tool_id=5 AND col_number=1
- New OID to type translations added:
	   INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	      VALUES (2,'.1.3.6.1.4.1.45.3.26.*',3,0)
	   INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	      VALUES (3,'.1.3.6.1.4.1.45.3.30.*',3,0)
	   INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	      VALUES (4,'.1.3.6.1.4.1.45.3.31.*',3,0)
	   INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	      VALUES (5,'.1.3.6.1.4.1.45.3.32.*',3,0)
	   INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	      VALUES (6,'.1.3.6.1.4.1.45.3.33.*',3,0)
	   INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	      VALUES (7,'.1.3.6.1.4.1.45.3.34.*',3,0)
	   INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	      VALUES (8,'.1.3.6.1.4.1.45.3.35.*',3,0)
	   INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	      VALUES (9,'.1.3.6.1.4.1.45.3.36.*',3,0)
	   INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	      VALUES (10,'.1.3.6.1.4.1.45.3.40.*',3,0)
	   INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	      VALUES (11,'.1.3.6.1.4.1.45.3.61.*',3,0)
- New object tools added:
	INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,matching_oid,description)
		VALUES (14,'&Info->Topology table (Nortel)',2 ,'Topology table',1,'','Show topology table (Nortel protocol)');
	INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
		VALUES (14,0,'Peer IP','.1.3.6.1.4.1.45.1.6.13.2.1.1.3',3 ,0);
	INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
		VALUES (14,1,'Peer MAC','.1.3.6.1.4.1.45.1.6.13.2.1.1.5',4 ,0);
	INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
		VALUES (14,2,'Port','.1.3.6.1.4.1.45.1.6.13.2.1.1.2',5 ,0);
	INSERT INTO object_tools_acl (tool_id,user_id) VALUES (14,-2147483648);
	INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,matching_oid,description)
		VALUES (15,'&Info->Topology table (CDP)',2 ,'Topology table',1,'','Show topology table (CDP)');
	INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
		VALUES (15,0,'Device ID','.1.3.6.1.4.1.9.9.23.1.2.1.1.6',0 ,0);
	INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
		VALUES (15,1,'IP Address','.1.3.6.1.4.1.9.9.23.1.2.1.1.4',3 ,0);
	INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
		VALUES (15,2,'Platform','.1.3.6.1.4.1.9.9.23.1.2.1.1.8',0 ,0);
	INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
		VALUES (15,3,'Version','.1.3.6.1.4.1.9.9.23.1.2.1.1.5',0 ,0);
	INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
		VALUES (15,4,'Port','.1.3.6.1.4.1.9.9.23.1.2.1.1.7',0 ,0);
	INSERT INTO object_tools_acl (tool_id,user_id) VALUES (15,-2147483648);


*************
* 44 ==> 45 *
*************

- New events added:
	INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
		(
			36, 'SYS_DB_CONN_LOST', 4, 1,
			'Lost connection with backend database engine',
			'Generated if connection with backend database engine is lost.#0D#0A' CONCAT
			'Parameters:#0D#0A' CONCAT
			'   No message-specific parameters'
		);
	INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
		(
			37, 'SYS_DB_CONN_RESTORED', 0, 1,
			'Connection with backend database engine restored',
			'Generated when connection with backend database engine restored.#0D#0A' CONCAT
			'Parameters:#0D#0A' CONCAT
			'   No message-specific parameters'
		);


*************
* 43 ==> 44 *
*************

- Added table "agent_configs":
	CREATE TABLE agent_configs
	(
		config_id integer not null,
		config_name varchar(255) not null,
		config_file SQL_TEXT not null,
		config_filter SQL_TEXT not null,
		sequence_number integer not null,
		PRIMARY KEY(config_id)
	) TABLE_TYPE;
- New object tools added:
	INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,matching_oid,description)
		VALUES (13,'&Info->&Process list',3,
                	'Process List#7FSystem.ProcessList#7F^([0-9]+) (.*)',2,'','Show list of currently running processes');
	INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
		VALUES (13,0,'PID','',0,1);
	INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
		VALUES (13,1,'Name','',0,2);
	INSERT INTO object_tools_acl (tool_id,user_id) VALUES (13,-2147483648);
- New configuration parameter: DBLockPID (hidden)


*************
* 42 ==> 43 *
*************

- New configuration parameter: RADIUSPort


*************
* 41 ==> 42 *
*************

- Added table "conditions":
	CREATE TABLE conditions
	(
		id integer not null,
		activation_event integer not null,
		deactivation_event integer not null,
		source_object integer not null,
		active_status integer not null,
		inactive_status integer not null,
		script SQL_TEXT not null,
		PRIMARY KEY(id)
	) TABLE_TYPE;
- Added table "cond_dci_map":
	CREATE TABLE cond_dci_map
	(
		condition_id integer not null,
		dci_id integer not null,
		node_id integer not null,
		dci_func integer not null,
		num_polls integer not null,
		PRIMARY KEY(condition_id,dci_id)
	) TABLE_TYPE;
- New configuration parameters: NumberOfConditionPollers, ConditionPollingInterval
- New image records:
	INSERT INTO images (image_id,name,file_name_png,file_hash_png,file_name_ico,file_hash_ico)
		VALUES (15,'Obj.Condition','condition.png','<invalid_hash>',
                	'condition.ico','<invalid_hash>');
	INSERT INTO default_images (object_class,image_id)
		VALUES (13, 15);
- New events added:
	INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
		(
			34, 'SYS_CONDITION_ACTIVATED', 2, 1,
			'Condition "%2" activated',
			'Default event for condition activation.#0D#0A' CONCAT
			'Parameters:#0D#0A' CONCAT
			'   1) Condition object ID#0D#0A' CONCAT
			'   2) Condition object name#0D#0A' CONCAT
			'   3) Previous condition status#0D#0A' CONCAT
			'   4) Current condition status'
		);
	INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
		(
			35, 'SYS_CONDITION_DEACTIVATED', 0, 1,
			'Condition "%2" deactivated',
			'Default event for condition deactivation.#0D#0A' CONCAT
			'Parameters:#0D#0A' CONCAT
			'   1) Condition object ID#0D#0A' CONCAT
			'   2) Condition object name#0D#0A' CONCAT
			'   3) Previous condition status#0D#0A' CONCAT
			'   4) Current condition status'
		);
- Added new node type:
	INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
	   VALUES (1,'.1.3.6.1.4.1.3224.1.*',2,0);


*************
* 40 ==> 41 *
*************

- New configuration parameters: RADIUSServer, RADIUSSecret, RADIUSNumRetries,
  RADIUSTimeout
- Added column "guid" to table "users":
	ALTER TABLE users ADD guid varchar(36) not null;
- Added column "auth_method" to table "users":
	ALTER TABLE users ADD auth_method integer not null;
- Added column "guid" to table "user_groups":
	ALTER TABLE user_groups ADD guid varchar(36) not null;


*************
* 39 ==> 40 *
*************

- Added column "grace_logins" to table "users":
	ALTER TABLE users ADD grace_logins integer;
	UPDATE users SET grace_logins=5;


*************
* 38 ==> 39 *
*************

- Added configuration parameter "DisableVacuum"
- Added configuration parameter "LockTimeout"
- Added table "maps":
	CREATE TABLE maps
	(
		map_id integer not null,
		map_name varchar(255) not null,
		description SQL_TEXT not null,
		root_object_id integer not null,
		PRIMARY KEY(map_id)
	) TABLE_TYPE;
- Added table "map_access_lists":
	CREATE TABLE map_access_lists
	(
		map_id integer not null,
		user_id integer not null,
		access_rights integer not null,
		PRIMARY KEY(map_id,user_id)
	) TABLE_TYPE;
- Added table "submaps":
	CREATE TABLE submaps
	(
		map_id integer not null,
		submap_id integer not null,
		attributes integer not null,	
		PRIMARY KEY(map_id,submap_id)
	) TABLE_TYPE;
- Added table "submap_object_positions":
	CREATE TABLE submap_object_positions
	(
		map_id integer not null,
		submap_id integer not null,
		object_id integer not null,
		x integer not null,
		y integer not null,
		PRIMARY KEY(map_id,submap_id,object_id)
	) TABLE_TYPE;
- Added table "submap_links":
	CREATE TABLE submap_links
	(
		map_id integer not null,
		submap_id integer not null,
		object_id1 integer not null,
		object_id2 integer not null,
		link_type integer not null,
		PRIMARY KEY(map_id,submap_id,object_id1,object_id2)
	) TABLE_TYPE;
- Added default map configuration:
	INSERT INTO maps (map_id,map_name,description,root_object_id)
		VALUES (1,'Default','Default network map',1);
	INSERT INTO map_access_lists (map_id,user_id,access_rights) VALUES (1,-2147483648,1);
- Added event SYS_SCRIPT_ERROR:
	INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
		(
			33, 'SYS_SCRIPT_ERROR',	2, 1,
			'Script (%1) execution error: %2',
			'Generated when server encounters NXSL script execution error.#0D#0A' CONCAT
			'Parameters:#0D#0A' CONCAT
			'   1) Script name#0D#0A' CONCAT
			'   2) Error text#0D#0A' CONCAT
			'   3) DCI ID if script is DCI transformation script, or 0 otherwise'
		);


*************
* 37 ==> 38 *
*************

- Added table "snmp_trap_log":
	CREATE TABLE snmp_trap_log
	(
		trap_id SQL_INT64 not null,
		trap_timestamp integer not null,
		ip_addr varchar(15) not null,
		object_id integer not null,
		trap_oid varchar(255) not null,
		trap_varlist SQL_TEXT not null,
		PRIMARY KEY(trap_id)
	) TABLE_TYPE;
        CREATE INDEX idx_snmp_trap_log_trap_timestamp ON snmp_trap_log(trap_timestamp);
- Indexes added to existing log tables:
	CREATE INDEX idx_event_log_event_timestamp ON event_log(event_timestamp);
	CREATE INDEX idx_syslog_msg_timestamp ON syslog(msg_timestamp);
- Added configuration parameter "LogAllSNMPTraps"


*************
* 36 ==> 37 *
*************

- Added table "script_library":
	CREATE TABLE script_library
	(
		script_id integer not null,
		script_name varchar(63) not null,
		script_code SQL_TEXT not null,
		PRIMARY KEY(script_id)
	) TABLE_TYPE;
- Added configuration parameter "DefaultCommunityString"
- Added configuration parameter "DiscoveryFilter"
- Removed table "new_nodes"
- Removed configuration parameter "NewNodePollingInterval"


*************
* 35 ==> 36 *
*************

- Added new column proxy_node to "nodes" table:
	ALTER TABLE nodes ADD proxy_node integer not null;
	UPDATE nodes SET proxy_node=0;
- Added new column matching_oid to "object_tools" table:
	ALTER TABLE object_tools ADD matching_oid varchar(255) not null;
	UPDATE object_tools SET matching_oid='#00';
- New configuration parameters added:
	INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
		VALUES ('CapabilityExpirationTime','604800',1,0);


*************
* 34 ==> 35 *
*************

- Table object_properties modified:
	Column status_alg deleted
	New columns added:
		status_calc_alg integer not null,
		status_prop_alg integer not null,
		status_prop_alg integer not null,
		status_fixed_val integer not null,
		status_shift integer not null,
		status_translation varchar(8) not null,
		status_single_threshold integer not null,
		status_thresholds varchar(8) not null
- Configuration parameter should be re-created:
	INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
		VALUES ('StatusCalculationAlgorithm','1',1,1);
- New configuration parameters added:
	INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
		VALUES ('StatusPropagationAlgorithm','1',1,1);
	INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
		VALUES ('FixedStatusValue','0',1,1);
	INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
		VALUES ('StatusShift','0',1,1);
	INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
		VALUES ('StatusTranslation','01020304',1,1);
	INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
		VALUES ('StatusSingleThreshold','75',1,1);
	INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
		VALUES ('StatusThresholds','503C2814',1,1);


*************
* 33 ==> 34 *
*************

- Added configuration variable IcmpPingSize
	INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
		VALUES ('IcmpPingSize','46',1,1);
- Added configuration variable SMSDrvConfig
	INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
		VALUES ('SMSDrvConfig','',1,1);
- Added table for storing syslog messages
	CREATE TABLE syslog
	(
		msg_id SQL_BIGINT not null,
		msg_timestamp integer not null,
		facility integer not null,
		severity integer not null,
		source_object_id integer not null,
		hostname varchar(127) not null,
		msg_tag varchar(32) not null,
		msg_text SQL_TEXT not null,
		PRIMARY KEY(msg_id)
	) TABLE_TYPE;
- New syslog-related parameters added:
	INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
		VALUES ('EnableSyslogDaemon','0',1,1);
	INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
		VALUES ('SyslogListenPort','514',1,1);
	INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
		VALUES ('SyslogRetentionTime','5184000',1,0);
- New field adv_schedule of type integer added to table items. Existing items
  should have this field set to 0.
- New table for advanced DCI schedules
	CREATE TABLE dci_schedules
	(
		item_id integer not null,
		schedule varchar(255) not null
	) TABLE_TYPE;


*************
* 32 ==> 33 *
*************

- Added table object_tools_table_columns
	CREATE TABLE object_tools_table_columns
	(
		tool_id integer not null,
		col_number integer not null,
		col_name varchar(255),
		col_oid varchar(255),
		col_format integer,
		col_substr integer,
		PRIMARY KEY(tool_id,col_number)
	) TABLE_TYPE;
- Predefined tools added:
INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,description)
	VALUES (5,'&Info->&Switch forwarding database (FDB)',TOOL_TYPE_TABLE_SNMP,'Forwarding database',0,'Show switch forwarding database');
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (5,0,'MAC Address','.1.3.6.1.2.1.17.4.3.1.1',CFMT_MAC_ADDR,0);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (5,1,'Port','.1.3.6.1.2.1.17.4.3.1.2',CFMT_INTEGER,0);

INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,description)
	VALUES (6,'&Connect->Open &web browser',TOOL_TYPE_URL,'http://%OBJECT_IP_ADDR%',0,'Open embedded web browser to node');
INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,description)
	VALUES (7,'&Connect->Open &web browser (HTTPS)',TOOL_TYPE_URL,'https://%OBJECT_IP_ADDR%',0,'Open embedded web browser to node using HTTPS');

INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,description)
	VALUES (8,'&Info->&Agent->&Subagent list',TOOL_TYPE_TABLE_AGENT,'Subagent List#7FAgent.SubAgentList#7F^(.*) (.*) (.*) (.*)',0,'Show list of loaded subagents');
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (8,0,'Name','',CFMT_STRING,1);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (8,1,'Version','',CFMT_STRING,2);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (8,2,'File','',CFMT_STRING,4);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (8,3,'Module handle','',CFMT_STRING,3);

INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,description)
	VALUES (9,'&Info->&Agent->Supported &parameters',TOOL_TYPE_TABLE_AGENT,'Supported parameters#7FAgent.SupportedParameters#7F^(.*)',0,'Show list of parameters supported by agent');
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (9,0,'Parameter','',CFMT_STRING,1);

INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,description)
	VALUES (10,'&Info->&Agent->Supported &enums',TOOL_TYPE_TABLE_AGENT,'Supported enums#7FAgent.SupportedEnums#7F^(.*)',0,'Show list of enums supported by agent');
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (10,0,'Parameter','',CFMT_STRING,1);

INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,description)
	VALUES (11,'&Info->&Agent->Supported &actions',TOOL_TYPE_TABLE_AGENT,'Supported actions#7FAgent.ActionList#7F^(.*) (.*) "(.*)".*',0,'Show list of actions supported by agent');
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (11,0,'Name','',CFMT_STRING,1);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (11,1,'Type','',CFMT_STRING,2);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (11,2,'Data','',CFMT_STRING,3);

INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,description)
	VALUES (12,'&Info->&Agent->Configured &ICMP targets',TOOL_TYPE_TABLE_AGENT,'Configured ICMP targets#7FICMP.TargetList#7F^(.*) (.*) (.*) (.*)',0,'Show list of actions supported by agent');
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (12,0,'IP Address','',CFMT_STRING,1);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (12,1,'Name','',CFMT_STRING,4);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (12,2,'Last RTT','',CFMT_STRING,2);
INSERT INTO object_tools_table_columns (tool_id,col_number,col_name,col_oid,col_format,col_substr)
	VALUES (12,4,'Average RTT','',CFMT_STRING,3);

INSERT INTO object_tools_acl (tool_id,user_id) VALUES (5,-2147483648);
INSERT INTO object_tools_acl (tool_id,user_id) VALUES (6,-2147483648);
INSERT INTO object_tools_acl (tool_id,user_id) VALUES (7,-2147483648);
INSERT INTO object_tools_acl (tool_id,user_id) VALUES (8,-2147483648);
INSERT INTO object_tools_acl (tool_id,user_id) VALUES (9,-2147483648);
INSERT INTO object_tools_acl (tool_id,user_id) VALUES (10,-2147483648);
INSERT INTO object_tools_acl (tool_id,user_id) VALUES (11,-2147483648);
INSERT INTO object_tools_acl (tool_id,user_id) VALUES (12,-2147483648);


*************
* 31 ==> 32 *
*************

- Added table object_tools:
	CREATE TABLE object_tools
	(
		tool_id integer not null,
		tool_name varchar(255) not null,
		tool_type integer not null,
		tool_data SQL_TEXT,
		description varchar(255),
		flags integer not null,
		PRIMARY KEY(tool_id)
	) TABLE_TYPE;
- Added table object_tools_acl:
	CREATE TABLE object_tools_acl
	(
		tool_id integer not null,
		user_id integer not null,
		PRIMARY KEY(tool_id,user_id)
	) TABLE_TYPE;
- Predefined tools added:
	INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,description)
		VALUES (1,'&Shutdown system',TOOL_TYPE_ACTION,'System.Shutdown',0,'Shutdown target node via NetXMS agent');
	INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,description)
		VALUES (2,'&Restart system',TOOL_TYPE_ACTION,'System.Restart',0,'Restart target node via NetXMS agent');
	INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,description)
		VALUES (3,'&Wakeup node',TOOL_TYPE_INTERNAL,'wakeup',0,'Wakeup node using Wake-On-LAN magic packet');
	INSERT INTO object_tools (tool_id,tool_name,tool_type,tool_data,flags,description)
		VALUES (4,'Restart &agent',TOOL_TYPE_ACTION,'Agent.Restart',0,'Restart NetXMS agent on target node');
	INSERT INTO object_tools_acl (tool_id,user_id) VALUES (1,-2147483648);
	INSERT INTO object_tools_acl (tool_id,user_id) VALUES (2,-2147483648);
	INSERT INTO object_tools_acl (tool_id,user_id) VALUES (3,-2147483648);
	INSERT INTO object_tools_acl (tool_id,user_id) VALUES (4,-2147483648);


*************
* 30 ==> 31 *
*************

- Added configuration parameter NumberOfRoutingTablePollers
- Added configuration parameter RoutingTableUpdateInterval
- Added table vpn_connectors:
	CREATE TABLE vpn_connectors
	(
		id integer not null,
		node_id integer not null,
		peer_gateway integer not null,
		PRIMARY KEY(id)
	) TABLE_TYPE;
- Added table vpn_connector_networks:
	CREATE TABLE vpn_connector_networks
	(
		vpn_id integer not null,
		network_type integer not null,	// 0 == local, 1 == remote
		ip_addr varchar(15),
		ip_netmask varchar(15),
		PRIMARY KEY(vpn_id,ip_addr)
	) TABLE_TYPE;
- New images added:
	INSERT INTO default_images (object_class,image_id)
		VALUES (12, IMG_VPN_CONNECTOR);
	INSERT INTO images (image_id,name,file_name_png,file_hash_png,file_name_ico,file_hash_ico)
		VALUES (IMG_VPN_CONNECTOR,'Obj.VPNConnector','vpnc.png','<invalid_hash>',
                	'vpnc.ico','<invalid_hash>');
