Small fix on data/storage/mysql and data/sorage/postgres

This commit is contained in:
TeoV
2017-09-15 18:01:51 +03:00
parent d8f3931b7f
commit 9188aad445
2 changed files with 8 additions and 8 deletions

View File

@@ -399,8 +399,8 @@ DROP TABLE IF EXISTS tp_resources;
CREATE TABLE tp_resources (
`pk` int(11) NOT NULL AUTO_INCREMENT,
`tpid` varchar(64) NOT NULL,
`id` varchar(64) NOT NULL,
`tenant` varchar(64) NOT NULL,
`id` varchar(64) NOT NULL,
`filter_type` varchar(16) NOT NULL,
`filter_field_name` varchar(64) NOT NULL,
`filter_field_values` varchar(256) NOT NULL,
@@ -415,7 +415,7 @@ CREATE TABLE tp_resources (
`created_at` TIMESTAMP,
PRIMARY KEY (`pk`),
KEY `tpid` (`tpid`),
UNIQUE KEY `unique_tp_resource` (`tpid`, `id`, `filter_type`, `filter_field_name`)
UNIQUE KEY `unique_tp_resource` (`tpid`,`tenant`, `id`, `filter_type`, `filter_field_name`)
);
--
@@ -424,9 +424,9 @@ CREATE TABLE tp_resources (
DROP TABLE IF EXISTS tp_stats;
CREATE TABLE tp_stats (
`tenant` varchar(64) NOT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
`tpid` varchar(64) NOT NULL,
`tenant` varchar(64) NOT NULL,
`tag` varchar(64) NOT NULL,
`filter_type` varchar(16) NOT NULL,
`filter_field_name` varchar(64) NOT NULL,
@@ -442,7 +442,7 @@ CREATE TABLE tp_stats (
`created_at` TIMESTAMP,
PRIMARY KEY (`id`),
KEY `tpid` (`tpid`),
UNIQUE KEY `unique_tp_stats` (`tpid`, `tag`, `filter_type`, `filter_field_name`)
UNIQUE KEY `unique_tp_stats` (`tpid`, `tenant`, `tag`, `filter_type`, `filter_field_name`)
);
--

View File

@@ -395,8 +395,8 @@ DROP TABLE IF EXISTS tp_resources;
CREATE TABLE tp_resources (
"pk" SERIAL PRIMARY KEY,
"tpid" varchar(64) NOT NULL,
"id" varchar(64) NOT NULL,
"tenant"varchar(64) NOT NULL,
"id" varchar(64) NOT NULL,
"filter_type" varchar(16) NOT NULL,
"filter_field_name" varchar(64) NOT NULL,
"filter_field_values" varchar(256) NOT NULL,
@@ -411,7 +411,7 @@ CREATE TABLE tp_resources (
"created_at" TIMESTAMP WITH TIME ZONE
);
CREATE INDEX tp_resources_idx ON tp_resources (tpid);
CREATE INDEX tp_resources_unique ON tp_resources ("tpid", "id", "filter_type", "filter_field_name");
CREATE INDEX tp_resources_unique ON tp_resources ("tpid", "tenant", "id", "filter_type", "filter_field_name");
--
@@ -420,9 +420,9 @@ CREATE INDEX tp_resources_unique ON tp_resources ("tpid", "id", "filter_type",
DROP TABLE IF EXISTS tp_stats;
CREATE TABLE tp_stats (
"tenant"varchar(64) NOT NULL,
"id" SERIAL PRIMARY KEY,
"tpid" varchar(64) NOT NULL,
"tenant"varchar(64) NOT NULL,
"tag" varchar(64) NOT NULL,
"filter_type" varchar(16) NOT NULL,
"filter_field_name" varchar(64) NOT NULL,
@@ -438,7 +438,7 @@ CREATE TABLE tp_stats (
"created_at" TIMESTAMP WITH TIME ZONE
);
CREATE INDEX tp_stats_idx ON tp_stats (tpid);
CREATE INDEX tp_stats_unique ON tp_stats ("tpid", "tag", "filter_type", "filter_field_name");
CREATE INDEX tp_stats_unique ON tp_stats ("tpid","tenant", "tag", "filter_type", "filter_field_name");
--
-- Table structure for table `tp_threshold_cfgs`