Added sql to the uninstall sql to remove changes made to the assets table on uninstall of a component. resolved gh-616

This commit is contained in:
Llewellyn van der Merwe 2020-12-01 06:02:33 +02:00
parent bbee45ccab
commit 4339ca00b3
Signed by untrusted user: Llewellyn
GPG Key ID: EFC0C720A240551C
7 changed files with 92 additions and 18 deletions

View File

@ -144,11 +144,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 30th November, 2020
+ *Last Build*: 1st December, 2020
+ *Version*: 2.11.7
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **284720**
+ *Line count*: **284731**
+ *Field count*: **1537**
+ *File count*: **1799**
+ *Folder count*: **304**

View File

@ -144,11 +144,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 30th November, 2020
+ *Last Build*: 1st December, 2020
+ *Version*: 2.11.7
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **284720**
+ *Line count*: **284731**
+ *Field count*: **1537**
+ *File count*: **1799**
+ *Folder count*: **304**

View File

@ -1,11 +1 @@
###INSTALL###
--
-- Always insure this column rules is large enough for all the access control values.
--
ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control.';
--
-- Always insure this column name is large enough for long component and view names.
--
ALTER TABLE `#__assets` CHANGE `name` `name` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The unique name for the asset.';

View File

@ -10509,6 +10509,40 @@ class Interpretation extends Fields
unset($this->customScriptBuilder['sql']);
}
// check if this component needs larger rules
// also check if the developer will allow this
// TODO still adding to GUI the needed switches and code
if (1)
{
$db .= PHP_EOL;
$db .= PHP_EOL . '--';
$db .= PHP_EOL
. '--' . $this->setLine(
__LINE__
)
. ' Always insure this column rules is large enough for all the access control values.';
$db .= PHP_EOL . '--';
$db .= PHP_EOL
. "ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control.';";
}
// check if this component needs larger names
// also check if the developer will allow this
// TODO still adding to GUI the needed switches and code
if (1)
{
$db .= PHP_EOL;
$db .= PHP_EOL . '--';
$db .= PHP_EOL
. '--' . $this->setLine(
__LINE__
)
. ' Always insure this column name is large enough for long component and view names.';
$db .= PHP_EOL . '--';
$db .= PHP_EOL
. "ALTER TABLE `#__assets` CHANGE `name` `name` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The unique name for the asset.';";
}
return $db;
}
@ -10541,6 +10575,44 @@ class Interpretation extends Fields
unset($this->customScriptBuilder['sql_uninstall']);
}
// check if this component used larger rules
// now revert them back on uninstall
// TODO still adding to GUI the needed switches and code
if (1)
{
// https://github.com/joomla/joomla-cms/blob/3.10.0-alpha3/installation/sql/mysql/joomla.sql#L22
// Checked 1st December 2020
$db .= PHP_EOL;
$db .= PHP_EOL . '--';
$db .= PHP_EOL
. '--' . $this->setLine(
__LINE__
)
. ' Always insure this column rules is reversed to Joomla defaults on uninstall. (as on 1st Dec 2020)';
$db .= PHP_EOL . '--';
$db .= PHP_EOL
. "ALTER TABLE `#__assets` CHANGE `rules` `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.';";
}
// check if this component used larger rules
// now revert them back on uninstall
// TODO still adding to GUI the needed switches and code
if (1)
{
// https://github.com/joomla/joomla-cms/blob/3.10.0-alpha3/installation/sql/mysql/joomla.sql#L20
// Checked 1st December 2020
$db .= PHP_EOL;
$db .= PHP_EOL . '--';
$db .= PHP_EOL
. '--' . $this->setLine(
__LINE__
)
. ' Always insure this column name is reversed to Joomla defaults on uninstall. (as on 1st Dec 2020).';
$db .= PHP_EOL . '--';
$db .= PHP_EOL
. "ALTER TABLE `#__assets` CHANGE `name` `name` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The unique name for the asset.';";
}
return $db;
}
@ -17660,7 +17732,9 @@ class Interpretation extends Fields
. "protected function getThe" . $filter['function']
. "Selections()";
$function[] = $this->_t(1) . "{";
$function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
$function[] = $this->_t(2) . "//" . $this->setLine(
__LINE__
)
. " Get a db connection.";
}
else
@ -17763,7 +17837,6 @@ class Interpretation extends Fields
. $filter['code'] . ")";
$function[] = $this->_t(3) . "{";
// check if translated value is used
if ($translation)
{

View File

@ -47,3 +47,14 @@ DROP TABLE IF EXISTS `#__componentbuilder_joomla_plugin_updates`;
DROP TABLE IF EXISTS `#__componentbuilder_joomla_plugin_files_folders_urls`;
DROP TABLE IF EXISTS `#__componentbuilder_external_code`;
--
-- Always insure this column rules is reversed to Joomla defaults on uninstall. (as on 1st Dec 2020)
--
ALTER TABLE `#__assets` CHANGE `rules` `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.';
--
-- Always insure this column name is reversed to Joomla defaults on uninstall. (as on 1st Dec 2020).
--
ALTER TABLE `#__assets` CHANGE `name` `name` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The unique name for the asset.';

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>30th November, 2020</creationDate>
<creationDate>1st December, 2020</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>