Raw DCI values saved in history along with corresponding transformed values
[public/netxms.git] / sql / metadata.in
1 /*
2 ** Metadata
3 **
4 ** ex: syntax=sql
5 */
6
7 INSERT INTO metadata (var_name,var_value) VALUES ('SchemaVersion',DB_LEGACY_SCHEMA_VERSION);
8 INSERT INTO metadata (var_name,var_value) VALUES ('SchemaVersionMajor',DB_SCHEMA_VERSION_MAJOR);
9 INSERT INTO metadata (var_name,var_value) VALUES ('SchemaVersionMinor',DB_SCHEMA_VERSION_MINOR);
10 INSERT INTO metadata (var_name,var_value) VALUES ('Syntax',DB_SYNTAX);
11
12 INSERT INTO metadata (var_name,var_value)
13 VALUES ('IDataTableCreationCommand','CREATE TABLE idata_%d (item_id integer not null,idata_timestamp integer not null,idata_value varchar(255) null,raw_value varchar(255) null)');
14 #if defined(DB_MSSQL)
15 INSERT INTO metadata (var_name,var_value)
16 VALUES ('IDataIndexCreationCommand_0','CREATE CLUSTERED INDEX idx_idata_%d_id_timestamp ON idata_%d(item_id,idata_timestamp)');
17 #else
18 INSERT INTO metadata (var_name,var_value)
19 VALUES ('IDataIndexCreationCommand_0','CREATE INDEX idx_idata_%d_id_timestamp ON idata_%d(item_id,idata_timestamp DESC)');
20 #endif
21
22 INSERT INTO metadata (var_name,var_value)
23 VALUES ('TDataTableCreationCommand_0','CREATE TABLE tdata_%d (item_id integer not null,tdata_timestamp integer not null,tdata_value ' CONCAT SQL_TEXT_TEXT CONCAT ' null)');
24 #if defined(DB_MSSQL)
25 INSERT INTO metadata (var_name,var_value)
26 VALUES ('TDataIndexCreationCommand_0','CREATE CLUSTERED INDEX idx_tdata_%d ON tdata_%d(item_id,tdata_timestamp)');
27 #else
28 INSERT INTO metadata (var_name,var_value)
29 VALUES ('TDataIndexCreationCommand_0','CREATE INDEX idx_tdata_%d ON tdata_%d(item_id,tdata_timestamp)');
30 #endif
31
32 INSERT INTO metadata (var_name,var_value)
33 VALUES ('LocationHistory','CREATE TABLE gps_history_%d (latitude varchar(20), longitude varchar(20), accuracy integer not null, start_timestamp integer not null, end_timestamp integer not null, PRIMARY KEY(start_timestamp))');