From c114ee22548160d7b38a415a19cd9ddb598a4d80 Mon Sep 17 00:00:00 2001 From: Christian BUFFIN Date: Mon, 3 Feb 2020 10:46:27 +0100 Subject: [PATCH 1/3] Fix MySQL data type for platforms.enable_on_design and platforms.enable_on_execution in install/sql/alter_tables/1.9.20/mysql/DB.1.9.20/step1/db_schema_update.sql with respect to install/sql/mysql/testlink_create_tables.sql --- .../1.9.20/mysql/DB.1.9.20/step1/db_schema_update.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install/sql/alter_tables/1.9.20/mysql/DB.1.9.20/step1/db_schema_update.sql b/install/sql/alter_tables/1.9.20/mysql/DB.1.9.20/step1/db_schema_update.sql index 304b4517e1..b59ce37eb2 100644 --- a/install/sql/alter_tables/1.9.20/mysql/DB.1.9.20/step1/db_schema_update.sql +++ b/install/sql/alter_tables/1.9.20/mysql/DB.1.9.20/step1/db_schema_update.sql @@ -32,6 +32,9 @@ ALTER TABLE /*prefix*/testcase_keywords ADD INDEX /*prefix*/idx02_testcase_keywo ALTER TABLE /*prefix*/milestones MODIFY target_date date NOT NULL; ALTER TABLE /*prefix*/milestones MODIFY start_date date DEFAULT NULL; +ALTER TABLE /*prefix*/platforms MODIFY enable_on_design tinyint(1) unsigned NOT NULL default '0'; +ALTER TABLE /*prefix*/platforms MODIFY enable_on_execution tinyint(1) unsigned NOT NULL default '1'; + -- CREATE TABLE /*prefix*/execution_tcsteps_wip ( id int(10) unsigned NOT NULL auto_increment, From 493ccb49e22d093025f8187082811003165b52ef Mon Sep 17 00:00:00 2001 From: Christian BUFFIN Date: Mon, 3 Feb 2020 10:49:58 +0100 Subject: [PATCH 2/3] Fix unique index names (that must be unique database-wide) on tables baseline_l1l2_context and baseline_l1l2_details, fix unsigned type not available in PostgreSQL in file install/sql/postgres/testlink_create_tables.sql. --- install/sql/postgres/testlink_create_tables.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install/sql/postgres/testlink_create_tables.sql b/install/sql/postgres/testlink_create_tables.sql index 3bf2ea25fb..be7714a224 100644 --- a/install/sql/postgres/testlink_create_tables.sql +++ b/install/sql/postgres/testlink_create_tables.sql @@ -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*/udx1_baseline_l1l2_context ON /*prefix*/baseline_l1l2_context ("testplan_id","platform_id","creation_ts"); CREATE TABLE /*prefix*/baseline_l1l2_details ( @@ -934,11 +934,11 @@ CREATE TABLE /*prefix*/baseline_l1l2_details ( "top_tsuite_id" BIGINT NOT NULL DEFAULT '0' REFERENCES /*prefix*/testsuites (id), "child_tsuite_id" BIGINT NOT NULL DEFAULT '0' REFERENCES /*prefix*/testsuites (id), "status" char(1) DEFAULT NULL, - "qty" INT unsigned NOT NULL DEFAULT '0', - "total_tc" INT unsigned NOT NULL DEFAULT '0', + "qty" INT NOT NULL DEFAULT '0', + "total_tc" INT NOT NULL DEFAULT '0', PRIMARY KEY ("id") ) ; -CREATE UNIQUE INDEX /*prefix*/udx1 +CREATE UNIQUE INDEX /*prefix*/udx1_baseline_l1l2_details ON /*prefix*/baseline_l1l2_details ("context_id","top_tsuite_id","child_tsuite_id","status"); From fe27cca530ead912619b8529c91b2cf2286da4cd Mon Sep 17 00:00:00 2001 From: Christian BUFFIN Date: Mon, 3 Feb 2020 10:52:43 +0100 Subject: [PATCH 3/3] Fix missing table execution_tcsteps_wip in install/sql/alter_tables/1.9.20/postgres/DB.1.9.20/step1/db_schema_update.sql with respect to install/sql/postgres/testlink_create_tables.sql, fix unique index names (that should be unique database-wide in PostgreSQL) for tables baseline_l1l2_context and udx1_baseline_l1l2_details. --- .../DB.1.9.20/step1/db_schema_update.sql | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/install/sql/alter_tables/1.9.20/postgres/DB.1.9.20/step1/db_schema_update.sql b/install/sql/alter_tables/1.9.20/postgres/DB.1.9.20/step1/db_schema_update.sql index 0400b0ba21..1ae70d2b60 100644 --- a/install/sql/alter_tables/1.9.20/postgres/DB.1.9.20/step1/db_schema_update.sql +++ b/install/sql/alter_tables/1.9.20/postgres/DB.1.9.20/step1/db_schema_update.sql @@ -20,6 +20,23 @@ ALTER TABLE /*prefix*/testplan_platforms ADD COLUMN active INT2 NOT NULL DEFAULT ALTER TABLE /*prefix*/platforms ADD COLUMN enable_on_design INT2 NOT NULL DEFAULT '0'; ALTER TABLE /*prefix*/platforms ADD COLUMN enable_on_execution INT2 NOT NULL DEFAULT '1'; +-- +-- Table structure for table "execution_tcsteps_wip" +-- +CREATE TABLE /*prefix*/execution_tcsteps_wip ( + "id" BIGSERIAL NOT NULL , + "tcstep_id" INTEGER NOT NULL DEFAULT '0' REFERENCES /*prefix*/tcsteps (id), + "testplan_id" INTEGER NOT NULL DEFAULT '0' REFERENCES /*prefix*/testplans (id), + "platform_id" INTEGER NOT NULL DEFAULT '0', + "build_id" INTEGER NOT NULL DEFAULT '0', + "tester_id" BIGINT NULL DEFAULT NULL, + "creation_ts" TIMESTAMP NOT NULL DEFAULT now(), + "notes" TEXT NULL DEFAULT NULL, + "status" CHAR(1) NULL DEFAULT NULL, + PRIMARY KEY ("id") +); +CREATE UNIQUE INDEX /*prefix*/execution_tcsteps_wip_uidx1 ON /*prefix*/execution_tcsteps_wip ("tcstep_id","testplan_id","platform_id","build_id"); + -- -- Table structure for table "testcase_platforms" -- @@ -42,7 +59,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*/udx1_baseline_l1l2_context ON /*prefix*/baseline_l1l2_context ("testplan_id","platform_id","creation_ts"); CREATE TABLE /*prefix*/baseline_l1l2_details ( @@ -55,7 +72,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*/udx1_baseline_l1l2_details ON /*prefix*/baseline_l1l2_details ("context_id","top_tsuite_id","child_tsuite_id","status");