Skip to content

Commit

Permalink
TICKET 0008879: Failure on index creation
Browse files Browse the repository at this point in the history
Two indexes had the same name.
  • Loading branch information
atisne committed Mar 11, 2020
1 parent 2a1bc45 commit 5dad8e9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ CREATE TABLE /*prefix*/baseline_l1l2_context (
end_exec_ts timestamp NOT NULL,
creation_ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id),
UNIQUE KEY udx1 (testplan_id,platform_id,creation_ts)
UNIQUE KEY /*prefix*/udx1_baseline_l1l2_context (testplan_id,platform_id,creation_ts)
) DEFAULT CHARSET=utf8;


Expand All @@ -80,7 +80,7 @@ CREATE TABLE /*prefix*/baseline_l1l2_details (
qty int(10) unsigned NOT NULL DEFAULT '0',
total_tc int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY udx1 (context_id,top_tsuite_id,child_tsuite_id,status)
UNIQUE KEY /*prefix*/udx1_baseline_l1l2_details (context_id,top_tsuite_id,child_tsuite_id,status)
) DEFAULT CHARSET=utf8;

#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ CREATE TABLE /*prefix*/baseline_l1l2_context (
"creation_ts" timestamp NOT NULL DEFAULT now(),
PRIMARY KEY ("id")
);
CREATE UNIQUE INDEX /*prefix*/udx1 ON /*prefix*/baseline_l1l2_context ("testplan_id","platform_id","creation_ts");
CREATE UNIQUE INDEX /*prefix*/baseline_l1l2_context_uidx1 ON /*prefix*/baseline_l1l2_context ("testplan_id","platform_id","creation_ts");


CREATE TABLE /*prefix*/baseline_l1l2_details (
Expand All @@ -55,7 +55,7 @@ CREATE TABLE /*prefix*/baseline_l1l2_details (
"total_tc" INT NOT NULL DEFAULT '0',
PRIMARY KEY ("id")
) ;
CREATE UNIQUE INDEX /*prefix*/udx1
CREATE UNIQUE INDEX /*prefix*/baseline_l1l2_details_uidx1
ON /*prefix*/baseline_l1l2_details ("context_id","top_tsuite_id","child_tsuite_id","status");


Expand Down Expand Up @@ -125,4 +125,4 @@ TO_CHAR(E.execution_ts, 'HH24') AS hour,
E.* FROM /*prefix*/executions E
JOIN /*prefix*/testplans TPL on TPL.id=E.testplan_id
JOIN /*prefix*/nodes_hierarchy NHTPL on NHTPL.id = TPL.id);
-- END
-- END
5 changes: 2 additions & 3 deletions install/sql/mysql/testlink_create_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ CREATE TABLE /*prefix*/baseline_l1l2_context (
end_exec_ts timestamp NOT NULL,
creation_ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id),
UNIQUE KEY udx1 (testplan_id,platform_id,creation_ts)
UNIQUE KEY /*prefix*/udx1_baseline_l1l2_context (testplan_id,platform_id,creation_ts)
) DEFAULT CHARSET=utf8;


Expand All @@ -819,7 +819,7 @@ CREATE TABLE /*prefix*/baseline_l1l2_details (
qty int(10) unsigned NOT NULL DEFAULT '0',
total_tc int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY udx1 (context_id,top_tsuite_id,child_tsuite_id,status)
UNIQUE KEY /*prefix*/udx1_baseline_l1l2_details (context_id,top_tsuite_id,child_tsuite_id,status)
) DEFAULT CHARSET=utf8;


Expand Down Expand Up @@ -959,4 +959,3 @@ DATE_FORMAT(E.execution_ts, '%k') AS hour,
E.* FROM /*prefix*/executions E
JOIN /*prefix*/testplans TPL on TPL.id=E.testplan_id
JOIN /*prefix*/nodes_hierarchy NHTPL on NHTPL.id = TPL.id);

5 changes: 2 additions & 3 deletions install/sql/postgres/testlink_create_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ CREATE TABLE /*prefix*/baseline_l1l2_context (
"creation_ts" timestamp NOT NULL DEFAULT now(),
PRIMARY KEY ("id")
);
CREATE UNIQUE INDEX /*prefix*/udx1 ON /*prefix*/baseline_l1l2_context ("testplan_id","platform_id","creation_ts");
CREATE UNIQUE INDEX /*prefix*/baseline_l1l2_context_uidx1 ON /*prefix*/baseline_l1l2_context ("testplan_id","platform_id","creation_ts");


CREATE TABLE /*prefix*/baseline_l1l2_details (
Expand All @@ -938,7 +938,7 @@ CREATE TABLE /*prefix*/baseline_l1l2_details (
"total_tc" INT unsigned NOT NULL DEFAULT '0',
PRIMARY KEY ("id")
) ;
CREATE UNIQUE INDEX /*prefix*/udx1
CREATE UNIQUE INDEX /*prefix*/baseline_l1l2_details_uidx1
ON /*prefix*/baseline_l1l2_details ("context_id","top_tsuite_id","child_tsuite_id","status");


Expand Down Expand Up @@ -1121,4 +1121,3 @@ TO_CHAR(E.execution_ts, 'HH24') AS hour,
E.* FROM /*prefix*/executions E
JOIN /*prefix*/testplans TPL on TPL.id=E.testplan_id
JOIN /*prefix*/nodes_hierarchy NHTPL on NHTPL.id = TPL.id);

0 comments on commit 5dad8e9

Please sign in to comment.