From 62515d1b34281e62c494f65ed37b0427c9a9b384 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Sun, 4 May 2014 16:50:19 -0500 Subject: [PATCH 1/2] Remove pulls table on uninstall --- .../components/com_patchtester/install/sql/mysql/uninstall.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/administrator/components/com_patchtester/install/sql/mysql/uninstall.sql b/administrator/components/com_patchtester/install/sql/mysql/uninstall.sql index 129486f..3c1bf05 100644 --- a/administrator/components/com_patchtester/install/sql/mysql/uninstall.sql +++ b/administrator/components/com_patchtester/install/sql/mysql/uninstall.sql @@ -1 +1,2 @@ +DROP TABLE IF EXISTS `#__patchtester_pulls`; DROP TABLE IF EXISTS `#__patchtester_tests`; From fdebf8b6b2ad46189ce2b0ff180c466e11dee4a7 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Sun, 4 May 2014 16:55:06 -0500 Subject: [PATCH 2/2] Update schema for non-MySQL databases --- .../install/sql/postgresql/install.sql | 10 ++++++ .../install/sql/postgresql/uninstall.sql | 1 + .../install/sql/sqlsrv/install.sql | 35 +++++++++++++------ .../install/sql/sqlsrv/uninstall.sql | 1 + 4 files changed, 36 insertions(+), 11 deletions(-) diff --git a/administrator/components/com_patchtester/install/sql/postgresql/install.sql b/administrator/components/com_patchtester/install/sql/postgresql/install.sql index af95464..55bbfa5 100644 --- a/administrator/components/com_patchtester/install/sql/postgresql/install.sql +++ b/administrator/components/com_patchtester/install/sql/postgresql/install.sql @@ -1,3 +1,13 @@ +CREATE TABLE IF NOT EXISTS "#__patchtester_pulls" ( + "id" serial NOT NULL, + "pull_id" bigint NOT NULL, + "title" character varying(100) NOT NULL, + "description" character varying(5000) DEFAULT '' NOT NULL, + "pull_url" character varying(255) NOT NULL, + "joomlacode_id" character varying(255) DEFAULT '' NOT NULL, + PRIMARY KEY ("id") +); + CREATE TABLE "#__patchtester_tests" ( "id" serial NOT NULL, "pull_id" bigint NOT NULL, diff --git a/administrator/components/com_patchtester/install/sql/postgresql/uninstall.sql b/administrator/components/com_patchtester/install/sql/postgresql/uninstall.sql index ef04792..9fcc3f6 100644 --- a/administrator/components/com_patchtester/install/sql/postgresql/uninstall.sql +++ b/administrator/components/com_patchtester/install/sql/postgresql/uninstall.sql @@ -1 +1,2 @@ +DROP TABLE IF EXISTS "#__patchtester_pulls"; DROP TABLE IF EXISTS "#__patchtester_tests"; diff --git a/administrator/components/com_patchtester/install/sql/sqlsrv/install.sql b/administrator/components/com_patchtester/install/sql/sqlsrv/install.sql index 421ea34..60618fe 100644 --- a/administrator/components/com_patchtester/install/sql/sqlsrv/install.sql +++ b/administrator/components/com_patchtester/install/sql/sqlsrv/install.sql @@ -1,14 +1,27 @@ -CREATE TABLE [#__patchtester_tests]( - [id] [bigint] IDENTITY(1,1) NOT NULL, - [pull_id] [bigint] NOT NULL, - [data] [nvarchar](MAX) NULL, - [patched_by] [bigint] NOT NULL, - [applied] [bigint] NOT NULL, - [applied_version] [nvarchar](25) NOT NULL, - [rating] [bigint] NOT NULL, - [comments] [nvarchar](255) NOT NULL DEFAULT '', - CONSTRAINT [PK_#__patchtester_tests] PRIMARY KEY CLUSTERED +CREATE TABLE IF NOT EXISTS [#__patchtester_pulls] ( + [id] [bigint] IDENTITY(1,1) NOT NULL, + [pull_id] [bigint] NOT NULL, + [title] [nvarchar](100) NOT NULL, + [description] [nvarchar](5000) NOT NULL DEFAULT '', + [pull_url] [nvarchar](255) NOT NULL, + [joomlacode_id] [nvarchar](255) NOT NULL DEFAULT '', + CONSTRAINT [PK_#__patchtester_pulls] PRIMARY KEY CLUSTERED ( - [id] ASC + [id] ASC +) WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF) +); + +CREATE TABLE [#__patchtester_tests]( + [id] [bigint] IDENTITY(1,1) NOT NULL, + [pull_id] [bigint] NOT NULL, + [data] [nvarchar](MAX) NULL, + [patched_by] [bigint] NOT NULL, + [applied] [bigint] NOT NULL, + [applied_version] [nvarchar](25) NOT NULL, + [rating] [bigint] NOT NULL, + [comments] [nvarchar](255) NOT NULL DEFAULT '', + CONSTRAINT [PK_#__patchtester_tests] PRIMARY KEY CLUSTERED +( + [id] ASC ) WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF) ); diff --git a/administrator/components/com_patchtester/install/sql/sqlsrv/uninstall.sql b/administrator/components/com_patchtester/install/sql/sqlsrv/uninstall.sql index 790d920..f396275 100644 --- a/administrator/components/com_patchtester/install/sql/sqlsrv/uninstall.sql +++ b/administrator/components/com_patchtester/install/sql/sqlsrv/uninstall.sql @@ -1 +1,2 @@ +DROP TABLE [#__patchtester_pulls]; DROP TABLE [#__patchtester_tests];