schema-related information (like schema version, DB syntax, etc.) moved from "config...
[public/netxms.git] / sql / metadata.in
1 /*
2 ** Metadata
3 **
4 ** ex: syntax=sql
5 */
6
7 INSERT INTO metadata (var_name,var_value)
8 VALUES ('SchemaVersion',DB_FORMAT_VERSION);
9 INSERT INTO metadata (var_name,var_value)
10 VALUES ('Syntax',DB_SYNTAX);
11 INSERT INTO metadata (var_name,var_value)
12 VALUES ('IDataTableCreationCommand','CREATE TABLE idata_%d (item_id integer not null,idata_timestamp integer not null,idata_value varchar(255) not null)');
13 INSERT INTO metadata (var_name,var_value)
14 VALUES ('IDataIndexCreationCommand_0','CREATE INDEX idx_idata_%d_item_id ON idata_%d(item_id)');
15 #if defined(DB_MYSQL)
16 INSERT INTO metadata (var_name,var_value)
17 VALUES ('IDataIndexCreationCommand_1','CREATE INDEX idx_idata_%d_id_timestamp ON idata_%d(item_id,idata_timestamp)');
18 #elif defined(DB_POSTGRESQL)
19 INSERT INTO metadata (var_name,var_value)
20 VALUES ('IDataIndexCreationCommand_1','CREATE INDEX idx_idata_%d_timestamp_id ON idata_%d(idata_timestamp,item_id)');
21 #elif defined(DB_MSSQL)
22 INSERT INTO metadata (var_name,var_value)
23 VALUES ('IDataIndexCreationCommand_1','CREATE CLUSTERED INDEX idx_idata_%d_id_timestamp ON idata_%d(item_id,idata_timestamp)');
24 #endif