Raw DCI values saved in history along with corresponding transformed values
[public/netxms.git] / sql / metadata.in
CommitLineData
28f5b9a4
VK
1/*
2** Metadata
3**
4** ex: syntax=sql
5*/
6
da4b354a
VK
7INSERT INTO metadata (var_name,var_value) VALUES ('SchemaVersion',DB_LEGACY_SCHEMA_VERSION);
8INSERT INTO metadata (var_name,var_value) VALUES ('SchemaVersionMajor',DB_SCHEMA_VERSION_MAJOR);
9INSERT INTO metadata (var_name,var_value) VALUES ('SchemaVersionMinor',DB_SCHEMA_VERSION_MINOR);
10INSERT INTO metadata (var_name,var_value) VALUES ('Syntax',DB_SYNTAX);
d6124fa0 11
28f5b9a4 12INSERT INTO metadata (var_name,var_value)
7cf72a57 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)');
d140955e 14#if defined(DB_MSSQL)
28f5b9a4 15INSERT INTO metadata (var_name,var_value)
4161f620
VK
16 VALUES ('IDataIndexCreationCommand_0','CREATE CLUSTERED INDEX idx_idata_%d_id_timestamp ON idata_%d(item_id,idata_timestamp)');
17#else
18INSERT INTO metadata (var_name,var_value)
d140955e 19 VALUES ('IDataIndexCreationCommand_0','CREATE INDEX idx_idata_%d_id_timestamp ON idata_%d(item_id,idata_timestamp DESC)');
28f5b9a4 20#endif
d6124fa0
VK
21
22INSERT INTO metadata (var_name,var_value)
89e5f052
VK
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)
d6124fa0 25INSERT INTO metadata (var_name,var_value)
63604cda 26 VALUES ('TDataIndexCreationCommand_0','CREATE CLUSTERED INDEX idx_tdata_%d ON tdata_%d(item_id,tdata_timestamp)');
d6124fa0
VK
27#else
28INSERT INTO metadata (var_name,var_value)
63604cda 29 VALUES ('TDataIndexCreationCommand_0','CREATE INDEX idx_tdata_%d ON tdata_%d(item_id,tdata_timestamp)');
d6124fa0 30#endif
4899db4d 31
32INSERT 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))');