From 68b29fcf24708d0fa5cadcbafb75d778316a6c0c Mon Sep 17 00:00:00 2001 From: Richard Fath Date: Sat, 8 Feb 2020 14:13:17 +0100 Subject: [PATCH 1/5] Allow empty metakey values in database tables --- .../sql/updates/mysql/4.0.0-2020-02-08.sql | 7 +++++++ .../sql/updates/postgresql/4.0.0-2020-02-08.sql | 7 +++++++ installation/sql/mysql/joomla.sql | 14 +++++++------- installation/sql/postgresql/joomla.sql | 14 +++++++------- 4 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql create mode 100644 administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql new file mode 100644 index 0000000000000..4b99f1b4ab8a0 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql @@ -0,0 +1,7 @@ +ALTER TABLE `#__banners` MODIFY `metakey` text NOT NULL DEFAULT ''; +ALTER TABLE `#__banner_clients` MODIFY `metakey` text NOT NULL DEFAULT ''; +ALTER TABLE `#__contact_details` MODIFY `metakey` text NOT NULL DEFAULT ''; +ALTER TABLE `#__content` MODIFY `metakey` text NOT NULL DEFAULT ''; +ALTER TABLE `#__languages` MODIFY `metakey` text NOT NULL DEFAULT ''; +ALTER TABLE `#__newsfeeds` MODIFY `metakey` text NOT NULL DEFAULT ''; +ALTER TABLE `#__tags` MODIFY `metakey` text NOT NULL DEFAULT ''; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql new file mode 100644 index 0000000000000..f199ed3050ee0 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql @@ -0,0 +1,7 @@ +ALTER TABLE "#__banners" ALTER COLUMN "metakey" SET DEFAULT ''; +ALTER TABLE "#__banner_clients" ALTER COLUMN "metakey" SET DEFAULT ''; +ALTER TABLE "#__contact_details" ALTER COLUMN "metakey" SET DEFAULT ''; +ALTER TABLE "#__content" ALTER COLUMN "metakey" SET DEFAULT ''; +ALTER TABLE "#__languages" ALTER COLUMN "metakey" SET DEFAULT ''; +ALTER TABLE "#__newsfeeds" ALTER COLUMN "metakey" SET DEFAULT ''; +ALTER TABLE "#__tags" ALTER COLUMN "metakey" SET DEFAULT ''; diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index 3c00b56f770c7..92c048acafbca 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -146,7 +146,7 @@ CREATE TABLE IF NOT EXISTS `#__banners` ( `custombannercode` varchar(2048) NOT NULL, `sticky` tinyint(1) unsigned NOT NULL DEFAULT 0, `ordering` int(11) NOT NULL DEFAULT 0, - `metakey` text NOT NULL, + `metakey` text NOT NULL DEFAULT '', `params` text NOT NULL, `own_prefix` tinyint(1) NOT NULL DEFAULT 0, `metakey_prefix` varchar(400) NOT NULL DEFAULT '', @@ -188,7 +188,7 @@ CREATE TABLE IF NOT EXISTS `#__banner_clients` ( `state` tinyint(3) NOT NULL DEFAULT 0, `checked_out` int(10) unsigned NOT NULL DEFAULT 0, `checked_out_time` datetime, - `metakey` text NOT NULL, + `metakey` text NOT NULL DEFAULT '', `own_prefix` tinyint(4) NOT NULL DEFAULT 0, `metakey_prefix` varchar(400) NOT NULL DEFAULT '', `purchase_type` tinyint(4) NOT NULL DEFAULT -1, @@ -313,7 +313,7 @@ CREATE TABLE IF NOT EXISTS `#__contact_details` ( `created_by_alias` varchar(255) NOT NULL DEFAULT '', `modified` datetime NOT NULL, `modified_by` int(10) unsigned NOT NULL DEFAULT 0, - `metakey` text NOT NULL, + `metakey` text NOT NULL DEFAULT '', `metadesc` text NOT NULL, `metadata` text NOT NULL, `featured` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT 'Set if contact is featured.', @@ -360,7 +360,7 @@ CREATE TABLE IF NOT EXISTS `#__content` ( `attribs` varchar(5120) NOT NULL, `version` int(10) unsigned NOT NULL DEFAULT 1, `ordering` int(11) NOT NULL DEFAULT 0, - `metakey` text NOT NULL, + `metakey` text NOT NULL DEFAULT '', `metadesc` text NOT NULL, `access` int(10) unsigned NOT NULL DEFAULT 0, `hits` int(10) unsigned NOT NULL DEFAULT 0, @@ -1258,7 +1258,7 @@ CREATE TABLE IF NOT EXISTS `#__languages` ( `sef` varchar(50) NOT NULL, `image` varchar(50) NOT NULL, `description` varchar(512) NOT NULL, - `metakey` text NOT NULL, + `metakey` text NOT NULL DEFAULT '', `metadesc` text NOT NULL, `sitename` varchar(1024) NOT NULL DEFAULT '', `published` int(11) NOT NULL DEFAULT 0, @@ -1580,7 +1580,7 @@ CREATE TABLE IF NOT EXISTS `#__newsfeeds` ( `created_by_alias` varchar(255) NOT NULL DEFAULT '', `modified` datetime NOT NULL, `modified_by` int(10) unsigned NOT NULL DEFAULT 0, - `metakey` text NOT NULL, + `metakey` text NOT NULL DEFAULT '', `metadesc` text NOT NULL, `metadata` text NOT NULL, `publish_up` datetime, @@ -1763,7 +1763,7 @@ CREATE TABLE IF NOT EXISTS `#__tags` ( `access` int(10) unsigned NOT NULL DEFAULT 0, `params` text NOT NULL, `metadesc` varchar(1024) NOT NULL COMMENT 'The meta description for the page.', - `metakey` varchar(1024) NOT NULL COMMENT 'The meta keywords for the page.', + `metakey` varchar(1024) NOT NULL DEFAULT '' COMMENT 'The meta keywords for the page.', `metadata` varchar(2048) NOT NULL COMMENT 'JSON encoded metadata properties.', `created_user_id` int(10) unsigned NOT NULL DEFAULT 0, `created_time` datetime NOT NULL, diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index 965e7a986602a..88edfafa5f125 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -152,7 +152,7 @@ CREATE TABLE IF NOT EXISTS "#__banners" ( "custombannercode" varchar(2048) NOT NULL, "sticky" smallint DEFAULT 0 NOT NULL, "ordering" bigint DEFAULT 0 NOT NULL, - "metakey" text NOT NULL, + "metakey" text DEFAULT '' NOT NULL, "params" text NOT NULL, "own_prefix" smallint DEFAULT 0 NOT NULL, "metakey_prefix" varchar(255) DEFAULT '' NOT NULL, @@ -192,7 +192,7 @@ CREATE TABLE IF NOT EXISTS "#__banner_clients" ( "state" smallint DEFAULT 0 NOT NULL, "checked_out" bigint DEFAULT 0 NOT NULL, "checked_out_time" timestamp without time zone, - "metakey" text NOT NULL, + "metakey" text DEFAULT '' NOT NULL, "own_prefix" smallint DEFAULT 0 NOT NULL, "metakey_prefix" varchar(255) DEFAULT '' NOT NULL, "purchase_type" smallint DEFAULT -1 NOT NULL, @@ -318,7 +318,7 @@ CREATE TABLE IF NOT EXISTS "#__contact_details" ( "created_by_alias" varchar(255) NOT NULL DEFAULT '', "modified" timestamp without time zone NOT NULL, "modified_by" integer NOT NULL DEFAULT 0, - "metakey" text NOT NULL, + "metakey" text DEFAULT '' NOT NULL, "metadesc" text NOT NULL, "metadata" text NOT NULL, "featured" smallint NOT NULL DEFAULT 0, @@ -365,7 +365,7 @@ CREATE TABLE IF NOT EXISTS "#__content" ( "attribs" varchar(5120) NOT NULL, "version" bigint DEFAULT 1 NOT NULL, "ordering" bigint DEFAULT 0 NOT NULL, - "metakey" text NOT NULL, + "metakey" text DEFAULT '' NOT NULL, "metadesc" text NOT NULL, "access" bigint DEFAULT 0 NOT NULL, "hits" bigint DEFAULT 0 NOT NULL, @@ -1240,7 +1240,7 @@ CREATE TABLE IF NOT EXISTS "#__languages" ( "sef" varchar(50) NOT NULL, "image" varchar(50) NOT NULL, "description" varchar(512) NOT NULL, - "metakey" text NOT NULL, + "metakey" text DEFAULT '' NOT NULL, "metadesc" text NOT NULL, "sitename" varchar(1024) DEFAULT '' NOT NULL, "published" bigint DEFAULT 0 NOT NULL, @@ -1577,7 +1577,7 @@ CREATE TABLE IF NOT EXISTS "#__newsfeeds" ( "created_by_alias" varchar(255) DEFAULT '' NOT NULL, "modified" timestamp without time zone NOT NULL, "modified_by" integer DEFAULT 0 NOT NULL, - "metakey" text NOT NULL, + "metakey" text DEFAULT '' NOT NULL, "metadesc" text NOT NULL, "metadata" text NOT NULL, "publish_up" timestamp without time zone, @@ -1758,7 +1758,7 @@ CREATE TABLE IF NOT EXISTS "#__tags" ( "access" bigint DEFAULT 0 NOT NULL, "params" text NOT NULL, "metadesc" varchar(1024) NOT NULL, - "metakey" varchar(1024) NOT NULL, + "metakey" varchar(1024) DEFAULT '' NOT NULL, "metadata" varchar(2048) NOT NULL, "created_user_id" integer DEFAULT 0 NOT NULL, "created_time" timestamp without time zone NOT NULL, From 2723a32b1806d081bbf6b3c18bb588f392ecafa3 Mon Sep 17 00:00:00 2001 From: Richard Fath Date: Sat, 8 Feb 2020 15:00:09 +0100 Subject: [PATCH 2/5] Remove meta from keywords in comments --- installation/sql/mysql/joomla.sql | 4 ++-- installation/sql/postgresql/joomla.sql | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index 92c048acafbca..0c8727725c54f 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -241,7 +241,7 @@ CREATE TABLE IF NOT EXISTS `#__categories` ( `access` int(10) unsigned NOT NULL DEFAULT 0, `params` text NOT NULL DEFAULT '', `metadesc` varchar(1024) NOT NULL DEFAULT '' COMMENT 'The meta description for the page.', - `metakey` varchar(1024) NOT NULL DEFAULT '' COMMENT 'The meta keywords for the page.', + `metakey` varchar(1024) NOT NULL DEFAULT '' COMMENT 'The keywords for the page.', `metadata` varchar(2048) NOT NULL DEFAULT '' COMMENT 'JSON encoded metadata properties.', `created_user_id` int(10) unsigned NOT NULL DEFAULT 0, `created_time` datetime NOT NULL, @@ -1763,7 +1763,7 @@ CREATE TABLE IF NOT EXISTS `#__tags` ( `access` int(10) unsigned NOT NULL DEFAULT 0, `params` text NOT NULL, `metadesc` varchar(1024) NOT NULL COMMENT 'The meta description for the page.', - `metakey` varchar(1024) NOT NULL DEFAULT '' COMMENT 'The meta keywords for the page.', + `metakey` varchar(1024) NOT NULL DEFAULT '' COMMENT 'The keywords for the page.', `metadata` varchar(2048) NOT NULL COMMENT 'JSON encoded metadata properties.', `created_user_id` int(10) unsigned NOT NULL DEFAULT 0, `created_time` datetime NOT NULL, diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index 88edfafa5f125..a6e302c15ce83 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -262,7 +262,7 @@ CREATE INDEX "#__categories_idx_language" ON "#__categories" ("language"); COMMENT ON COLUMN "#__categories"."asset_id" IS 'FK to the #__assets table.'; COMMENT ON COLUMN "#__categories"."metadesc" IS 'The meta description for the page.'; -COMMENT ON COLUMN "#__categories"."metakey" IS 'The meta keywords for the page.'; +COMMENT ON COLUMN "#__categories"."metakey" IS 'The keywords for the page.'; COMMENT ON COLUMN "#__categories"."metadata" IS 'JSON encoded metadata properties.'; -- From 58532e934c39b5bcb0181befd217686f90172800 Mon Sep 17 00:00:00 2001 From: Richard Fath Date: Sun, 9 Feb 2020 11:52:26 +0100 Subject: [PATCH 3/5] Use null instead empty string for empty metakey --- .../sql/updates/mysql/4.0.0-2020-02-08.sql | 15 ++++++------ .../updates/postgresql/4.0.0-2020-02-08.sql | 24 +++++++++++++------ installation/sql/mysql/joomla.sql | 16 ++++++------- installation/sql/postgresql/joomla.sql | 16 ++++++------- 4 files changed, 41 insertions(+), 30 deletions(-) diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql index 4b99f1b4ab8a0..b21b951c84fc8 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql @@ -1,7 +1,8 @@ -ALTER TABLE `#__banners` MODIFY `metakey` text NOT NULL DEFAULT ''; -ALTER TABLE `#__banner_clients` MODIFY `metakey` text NOT NULL DEFAULT ''; -ALTER TABLE `#__contact_details` MODIFY `metakey` text NOT NULL DEFAULT ''; -ALTER TABLE `#__content` MODIFY `metakey` text NOT NULL DEFAULT ''; -ALTER TABLE `#__languages` MODIFY `metakey` text NOT NULL DEFAULT ''; -ALTER TABLE `#__newsfeeds` MODIFY `metakey` text NOT NULL DEFAULT ''; -ALTER TABLE `#__tags` MODIFY `metakey` text NOT NULL DEFAULT ''; +ALTER TABLE `#__banners` MODIFY `metakey` text; +ALTER TABLE `#__banner_clients` MODIFY `metakey` text; +ALTER TABLE `#__categories` MODIFY `metakey` varchar(1024), +ALTER TABLE `#__contact_details` MODIFY `metakey` text; +ALTER TABLE `#__content` MODIFY `metakey` text; +ALTER TABLE `#__languages` MODIFY `metakey` text; +ALTER TABLE `#__newsfeeds` MODIFY `metakey` text; +ALTER TABLE `#__tags` MODIFY `metakey` varchar(1024); diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql index f199ed3050ee0..9eec88d7e1dea 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql @@ -1,7 +1,17 @@ -ALTER TABLE "#__banners" ALTER COLUMN "metakey" SET DEFAULT ''; -ALTER TABLE "#__banner_clients" ALTER COLUMN "metakey" SET DEFAULT ''; -ALTER TABLE "#__contact_details" ALTER COLUMN "metakey" SET DEFAULT ''; -ALTER TABLE "#__content" ALTER COLUMN "metakey" SET DEFAULT ''; -ALTER TABLE "#__languages" ALTER COLUMN "metakey" SET DEFAULT ''; -ALTER TABLE "#__newsfeeds" ALTER COLUMN "metakey" SET DEFAULT ''; -ALTER TABLE "#__tags" ALTER COLUMN "metakey" SET DEFAULT ''; +ALTER TABLE "#__banners" ALTER COLUMN "metakey" DROP NOT NULL; + +ALTER TABLE "#__banner_clients" ALTER COLUMN "metakey" DROP NOT NULL; + +ALTER TABLE "#__categories" ALTER COLUMN "metakey" DROP NOT NULL; +ALTER TABLE "#__categories" ALTER COLUMN "metakey" DROP DEFAULT; + +ALTER TABLE "#__contact_details" ALTER COLUMN "metakey" DROP NOT NULL; + +ALTER TABLE "#__content" ALTER COLUMN "metakey" DROP NOT NULL; + +ALTER TABLE "#__languages" ALTER COLUMN "metakey" DROP NOT NULL; + +ALTER TABLE "#__newsfeeds" ALTER COLUMN "metakey" DROP NOT NULL; + +ALTER TABLE "#__tags" ALTER COLUMN "metakey" DROP NOT NULL; +ALTER TABLE "#__tags" ALTER COLUMN "metakey" DROP DEFAULT; diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index 0c8727725c54f..e22ee1877c73b 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -146,7 +146,7 @@ CREATE TABLE IF NOT EXISTS `#__banners` ( `custombannercode` varchar(2048) NOT NULL, `sticky` tinyint(1) unsigned NOT NULL DEFAULT 0, `ordering` int(11) NOT NULL DEFAULT 0, - `metakey` text NOT NULL DEFAULT '', + `metakey` text, `params` text NOT NULL, `own_prefix` tinyint(1) NOT NULL DEFAULT 0, `metakey_prefix` varchar(400) NOT NULL DEFAULT '', @@ -188,7 +188,7 @@ CREATE TABLE IF NOT EXISTS `#__banner_clients` ( `state` tinyint(3) NOT NULL DEFAULT 0, `checked_out` int(10) unsigned NOT NULL DEFAULT 0, `checked_out_time` datetime, - `metakey` text NOT NULL DEFAULT '', + `metakey` text, `own_prefix` tinyint(4) NOT NULL DEFAULT 0, `metakey_prefix` varchar(400) NOT NULL DEFAULT '', `purchase_type` tinyint(4) NOT NULL DEFAULT -1, @@ -241,7 +241,7 @@ CREATE TABLE IF NOT EXISTS `#__categories` ( `access` int(10) unsigned NOT NULL DEFAULT 0, `params` text NOT NULL DEFAULT '', `metadesc` varchar(1024) NOT NULL DEFAULT '' COMMENT 'The meta description for the page.', - `metakey` varchar(1024) NOT NULL DEFAULT '' COMMENT 'The keywords for the page.', + `metakey` varchar(1024) COMMENT 'The keywords for the page.', `metadata` varchar(2048) NOT NULL DEFAULT '' COMMENT 'JSON encoded metadata properties.', `created_user_id` int(10) unsigned NOT NULL DEFAULT 0, `created_time` datetime NOT NULL, @@ -313,7 +313,7 @@ CREATE TABLE IF NOT EXISTS `#__contact_details` ( `created_by_alias` varchar(255) NOT NULL DEFAULT '', `modified` datetime NOT NULL, `modified_by` int(10) unsigned NOT NULL DEFAULT 0, - `metakey` text NOT NULL DEFAULT '', + `metakey` text, `metadesc` text NOT NULL, `metadata` text NOT NULL, `featured` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT 'Set if contact is featured.', @@ -360,7 +360,7 @@ CREATE TABLE IF NOT EXISTS `#__content` ( `attribs` varchar(5120) NOT NULL, `version` int(10) unsigned NOT NULL DEFAULT 1, `ordering` int(11) NOT NULL DEFAULT 0, - `metakey` text NOT NULL DEFAULT '', + `metakey` text, `metadesc` text NOT NULL, `access` int(10) unsigned NOT NULL DEFAULT 0, `hits` int(10) unsigned NOT NULL DEFAULT 0, @@ -1258,7 +1258,7 @@ CREATE TABLE IF NOT EXISTS `#__languages` ( `sef` varchar(50) NOT NULL, `image` varchar(50) NOT NULL, `description` varchar(512) NOT NULL, - `metakey` text NOT NULL DEFAULT '', + `metakey` text, `metadesc` text NOT NULL, `sitename` varchar(1024) NOT NULL DEFAULT '', `published` int(11) NOT NULL DEFAULT 0, @@ -1580,7 +1580,7 @@ CREATE TABLE IF NOT EXISTS `#__newsfeeds` ( `created_by_alias` varchar(255) NOT NULL DEFAULT '', `modified` datetime NOT NULL, `modified_by` int(10) unsigned NOT NULL DEFAULT 0, - `metakey` text NOT NULL DEFAULT '', + `metakey` text, `metadesc` text NOT NULL, `metadata` text NOT NULL, `publish_up` datetime, @@ -1763,7 +1763,7 @@ CREATE TABLE IF NOT EXISTS `#__tags` ( `access` int(10) unsigned NOT NULL DEFAULT 0, `params` text NOT NULL, `metadesc` varchar(1024) NOT NULL COMMENT 'The meta description for the page.', - `metakey` varchar(1024) NOT NULL DEFAULT '' COMMENT 'The keywords for the page.', + `metakey` varchar(1024) COMMENT 'The keywords for the page.', `metadata` varchar(2048) NOT NULL COMMENT 'JSON encoded metadata properties.', `created_user_id` int(10) unsigned NOT NULL DEFAULT 0, `created_time` datetime NOT NULL, diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index a6e302c15ce83..103c4702a4fd9 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -152,7 +152,7 @@ CREATE TABLE IF NOT EXISTS "#__banners" ( "custombannercode" varchar(2048) NOT NULL, "sticky" smallint DEFAULT 0 NOT NULL, "ordering" bigint DEFAULT 0 NOT NULL, - "metakey" text DEFAULT '' NOT NULL, + "metakey" text, "params" text NOT NULL, "own_prefix" smallint DEFAULT 0 NOT NULL, "metakey_prefix" varchar(255) DEFAULT '' NOT NULL, @@ -192,7 +192,7 @@ CREATE TABLE IF NOT EXISTS "#__banner_clients" ( "state" smallint DEFAULT 0 NOT NULL, "checked_out" bigint DEFAULT 0 NOT NULL, "checked_out_time" timestamp without time zone, - "metakey" text DEFAULT '' NOT NULL, + "metakey" text, "own_prefix" smallint DEFAULT 0 NOT NULL, "metakey_prefix" varchar(255) DEFAULT '' NOT NULL, "purchase_type" smallint DEFAULT -1 NOT NULL, @@ -241,7 +241,7 @@ CREATE TABLE IF NOT EXISTS "#__categories" ( "access" bigint DEFAULT 0 NOT NULL, "params" text DEFAULT '' NOT NULL, "metadesc" varchar(1024) DEFAULT '' NOT NULL, - "metakey" varchar(1024) DEFAULT '' NOT NULL, + "metakey" varchar(1024), "metadata" varchar(2048) DEFAULT '' NOT NULL, "created_user_id" integer DEFAULT 0 NOT NULL, "created_time" timestamp without time zone NOT NULL, @@ -318,7 +318,7 @@ CREATE TABLE IF NOT EXISTS "#__contact_details" ( "created_by_alias" varchar(255) NOT NULL DEFAULT '', "modified" timestamp without time zone NOT NULL, "modified_by" integer NOT NULL DEFAULT 0, - "metakey" text DEFAULT '' NOT NULL, + "metakey" text, "metadesc" text NOT NULL, "metadata" text NOT NULL, "featured" smallint NOT NULL DEFAULT 0, @@ -365,7 +365,7 @@ CREATE TABLE IF NOT EXISTS "#__content" ( "attribs" varchar(5120) NOT NULL, "version" bigint DEFAULT 1 NOT NULL, "ordering" bigint DEFAULT 0 NOT NULL, - "metakey" text DEFAULT '' NOT NULL, + "metakey" text, "metadesc" text NOT NULL, "access" bigint DEFAULT 0 NOT NULL, "hits" bigint DEFAULT 0 NOT NULL, @@ -1240,7 +1240,7 @@ CREATE TABLE IF NOT EXISTS "#__languages" ( "sef" varchar(50) NOT NULL, "image" varchar(50) NOT NULL, "description" varchar(512) NOT NULL, - "metakey" text DEFAULT '' NOT NULL, + "metakey" text, "metadesc" text NOT NULL, "sitename" varchar(1024) DEFAULT '' NOT NULL, "published" bigint DEFAULT 0 NOT NULL, @@ -1577,7 +1577,7 @@ CREATE TABLE IF NOT EXISTS "#__newsfeeds" ( "created_by_alias" varchar(255) DEFAULT '' NOT NULL, "modified" timestamp without time zone NOT NULL, "modified_by" integer DEFAULT 0 NOT NULL, - "metakey" text DEFAULT '' NOT NULL, + "metakey" text, "metadesc" text NOT NULL, "metadata" text NOT NULL, "publish_up" timestamp without time zone, @@ -1758,7 +1758,7 @@ CREATE TABLE IF NOT EXISTS "#__tags" ( "access" bigint DEFAULT 0 NOT NULL, "params" text NOT NULL, "metadesc" varchar(1024) NOT NULL, - "metakey" varchar(1024) DEFAULT '' NOT NULL, + "metakey" varchar(1024), "metadata" varchar(2048) NOT NULL, "created_user_id" integer DEFAULT 0 NOT NULL, "created_time" timestamp without time zone NOT NULL, From 421b191f93e71c35c683c352669d938d16a002ef Mon Sep 17 00:00:00 2001 From: Richard Fath Date: Sun, 9 Feb 2020 11:58:30 +0100 Subject: [PATCH 4/5] Roll back unnecessary change for categories --- .../com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql | 1 - .../sql/updates/postgresql/4.0.0-2020-02-08.sql | 10 ---------- installation/sql/mysql/joomla.sql | 2 +- installation/sql/postgresql/joomla.sql | 2 +- 4 files changed, 2 insertions(+), 13 deletions(-) diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql index b21b951c84fc8..f72105f16ec57 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql @@ -1,6 +1,5 @@ ALTER TABLE `#__banners` MODIFY `metakey` text; ALTER TABLE `#__banner_clients` MODIFY `metakey` text; -ALTER TABLE `#__categories` MODIFY `metakey` varchar(1024), ALTER TABLE `#__contact_details` MODIFY `metakey` text; ALTER TABLE `#__content` MODIFY `metakey` text; ALTER TABLE `#__languages` MODIFY `metakey` text; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql index 9eec88d7e1dea..bc7036081e825 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql @@ -1,17 +1,7 @@ ALTER TABLE "#__banners" ALTER COLUMN "metakey" DROP NOT NULL; - ALTER TABLE "#__banner_clients" ALTER COLUMN "metakey" DROP NOT NULL; - -ALTER TABLE "#__categories" ALTER COLUMN "metakey" DROP NOT NULL; -ALTER TABLE "#__categories" ALTER COLUMN "metakey" DROP DEFAULT; - ALTER TABLE "#__contact_details" ALTER COLUMN "metakey" DROP NOT NULL; - ALTER TABLE "#__content" ALTER COLUMN "metakey" DROP NOT NULL; - ALTER TABLE "#__languages" ALTER COLUMN "metakey" DROP NOT NULL; - ALTER TABLE "#__newsfeeds" ALTER COLUMN "metakey" DROP NOT NULL; - ALTER TABLE "#__tags" ALTER COLUMN "metakey" DROP NOT NULL; -ALTER TABLE "#__tags" ALTER COLUMN "metakey" DROP DEFAULT; diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index e22ee1877c73b..ed2af7bcefe99 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -241,7 +241,7 @@ CREATE TABLE IF NOT EXISTS `#__categories` ( `access` int(10) unsigned NOT NULL DEFAULT 0, `params` text NOT NULL DEFAULT '', `metadesc` varchar(1024) NOT NULL DEFAULT '' COMMENT 'The meta description for the page.', - `metakey` varchar(1024) COMMENT 'The keywords for the page.', + `metakey` varchar(1024) NOT NULL DEFAULT '' COMMENT 'The keywords for the page.', `metadata` varchar(2048) NOT NULL DEFAULT '' COMMENT 'JSON encoded metadata properties.', `created_user_id` int(10) unsigned NOT NULL DEFAULT 0, `created_time` datetime NOT NULL, diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index 103c4702a4fd9..14bd72d20abfc 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -241,7 +241,7 @@ CREATE TABLE IF NOT EXISTS "#__categories" ( "access" bigint DEFAULT 0 NOT NULL, "params" text DEFAULT '' NOT NULL, "metadesc" varchar(1024) DEFAULT '' NOT NULL, - "metakey" varchar(1024), + "metakey" varchar(1024) DEFAULT '' NOT NULL, "metadata" varchar(2048) DEFAULT '' NOT NULL, "created_user_id" integer DEFAULT 0 NOT NULL, "created_time" timestamp without time zone NOT NULL, From f08bcf414fd063ada5d95ac593c406a1694c39bc Mon Sep 17 00:00:00 2001 From: Richard Fath Date: Sun, 9 Feb 2020 12:07:49 +0100 Subject: [PATCH 5/5] For tags do like for categories because varchar not null in past --- .../components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql | 2 +- .../com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql | 2 +- installation/sql/mysql/joomla.sql | 2 +- installation/sql/postgresql/joomla.sql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql index f72105f16ec57..9a9f44d20b6e1 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-02-08.sql @@ -4,4 +4,4 @@ ALTER TABLE `#__contact_details` MODIFY `metakey` text; ALTER TABLE `#__content` MODIFY `metakey` text; ALTER TABLE `#__languages` MODIFY `metakey` text; ALTER TABLE `#__newsfeeds` MODIFY `metakey` text; -ALTER TABLE `#__tags` MODIFY `metakey` varchar(1024); +ALTER TABLE `#__tags` MODIFY `metakey` varchar(1024) NOT NULL DEFAULT ''; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql index bc7036081e825..6652ac8d6945d 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-02-08.sql @@ -4,4 +4,4 @@ ALTER TABLE "#__contact_details" ALTER COLUMN "metakey" DROP NOT NULL; ALTER TABLE "#__content" ALTER COLUMN "metakey" DROP NOT NULL; ALTER TABLE "#__languages" ALTER COLUMN "metakey" DROP NOT NULL; ALTER TABLE "#__newsfeeds" ALTER COLUMN "metakey" DROP NOT NULL; -ALTER TABLE "#__tags" ALTER COLUMN "metakey" DROP NOT NULL; +ALTER TABLE "#__tags" ALTER COLUMN "metakey" SET DEFAULT ''; diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index ed2af7bcefe99..8fbbaab161426 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -1763,7 +1763,7 @@ CREATE TABLE IF NOT EXISTS `#__tags` ( `access` int(10) unsigned NOT NULL DEFAULT 0, `params` text NOT NULL, `metadesc` varchar(1024) NOT NULL COMMENT 'The meta description for the page.', - `metakey` varchar(1024) COMMENT 'The keywords for the page.', + `metakey` varchar(1024) NOT NULL DEFAULT '' COMMENT 'The keywords for the page.', `metadata` varchar(2048) NOT NULL COMMENT 'JSON encoded metadata properties.', `created_user_id` int(10) unsigned NOT NULL DEFAULT 0, `created_time` datetime NOT NULL, diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index 14bd72d20abfc..fc232f85d902e 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -1758,7 +1758,7 @@ CREATE TABLE IF NOT EXISTS "#__tags" ( "access" bigint DEFAULT 0 NOT NULL, "params" text NOT NULL, "metadesc" varchar(1024) NOT NULL, - "metakey" varchar(1024), + "metakey" varchar(1024) DEFAULT '' NOT NULL, "metadata" varchar(2048) NOT NULL, "created_user_id" integer DEFAULT 0 NOT NULL, "created_time" timestamp without time zone NOT NULL,