Skip to content

Commit

Permalink
core to locked: update files
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepereiradasilva committed Nov 27, 2016
1 parent 178f4e2 commit cbd53e0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
-- Add core field to extensions table.
ALTER TABLE `#__extensions` MODIFY `protected` tinyint(3) NOT NULL DEFAULT 0 COMMENT 'Flag to indicate if the extension can be enabled/disabled.';
ALTER TABLE `#__extensions` ADD COLUMN `core` tinyint(3) NOT NULL DEFAULT 0 COMMENT 'Flag to indicate if is a Joomla core extension. Core extensions can not be uninstalled.';
-- Add locked field to extensions table.
ALTER TABLE `#__extensions` MODIFY `protected` tinyint(3) NOT NULL DEFAULT 0 COMMENT 'Flag to indicate if the extension is protected. Protected extensions cannot be disabled.';
ALTER TABLE `#__extensions` ADD COLUMN `locked` tinyint(3) NOT NULL DEFAULT 0 COMMENT 'Flag to indicate if is the extension is locked. Locked extensions cannot be uninstalled.';

-- Set all core extensions as core 1 and unprotected them.
-- Set all core extensions as locked extensions and unprotected them.
UPDATE `#__extensions`
SET `core` = 1, `protected` = 0
SET `locked` = 1, `protected` = 0
WHERE (`type` = 'component' AND `element` IN (
'com_mailto',
'com_wrapper',
Expand Down Expand Up @@ -104,7 +104,7 @@ OR (`type` = 'language' AND `element` IN ('en-GB'))
OR (`type` = 'file' AND `element` IN ('joomla'))
OR (`type` = 'package' AND `element` IN ('pkg_en-GB'));

-- Now protect from disabling essential extensions.
-- Now protect from disabling essential core extensions.
UPDATE `#__extensions`
SET `protected` = 1
WHERE (`type` = 'component' AND `element` IN (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-- Add core field to extensions table.
ALTER TABLE "#__extensions" ADD COLUMN "core" smallint DEFAULT 0 NOT NULL;
-- Add locked field to extensions table.
ALTER TABLE "#__extensions" ADD COLUMN "locked" smallint DEFAULT 0 NOT NULL;

COMMENT ON COLUMN "#__extensions"."protected" IS 'Flag to indicate if the extension can be enabled/disabled.';
COMMENT ON COLUMN "#__extensions"."core" IS 'Flag to indicate if is a Joomla core extension. Core extensions can not be uninstalled.';
COMMENT ON COLUMN "#__extensions"."protected" IS 'Flag to indicate if the extension is protected. Protected extensions cannot be disabled.';
COMMENT ON COLUMN "#__extensions"."locked" IS 'Flag to indicate if is the extension is locked. Locked extensions cannot be uninstalled.';

-- Set all core extensions as core 1 and unprotected them.
-- Set all core extensions as locked extensions and unprotected them.
UPDATE "#__extensions"
SET "core" = 1, "protected" = 0
SET "locked" = 1, "protected" = 0
WHERE ("type" = 'component' AND "element" IN (
'com_mailto',
'com_wrapper',
Expand Down Expand Up @@ -106,7 +106,7 @@ OR ("type" = 'language' AND "element" IN ('en-GB'))
OR ("type" = 'file' AND "element" IN ('joomla'))
OR ("type" = 'package' AND "element" IN ('pkg_en-GB'));

-- Now protect from disabling essential extensions.
-- Now protect from disabling essential core extensions.
UPDATE "#__extensions"
SET "protected" = 1
WHERE ("type" = 'component' AND "element" IN (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
-- Add core field to extensions table.
ALTER TABLE [#__extensions] ADD [core] [smallint] NOT NULL DEFAULT 0;
-- Add locked field to extensions table.
ALTER TABLE [#__extensions] ADD [locked] [smallint] NOT NULL DEFAULT 0;

-- Set all core extensions as core 1 and unprotected them.
-- Set all core extensions as locked extensions and unprotected them.
UPDATE [#__extensions]
SET [core] = 1, [protected] = 0
SET [locked] = 1, [protected] = 0
WHERE ([type] = 'component' AND [element] IN (
'com_mailto',
'com_wrapper',
Expand Down Expand Up @@ -103,7 +103,7 @@ OR ([type] = 'language' AND [element] IN ('en-GB'))
OR ([type] = 'file' AND [element] IN ('joomla'))
OR ([type] = 'package' AND [element] IN ('pkg_en-GB'));

-- Now protect from disabling essential extensions.
-- Now protect from disabling essential core extensions.
UPDATE [#__extensions]
SET [protected] = 1
WHERE ([type] = 'component' AND [element] IN (
Expand Down

0 comments on commit cbd53e0

Please sign in to comment.