Skip to content

Commit

Permalink
[4.0] Remove display widths for integer data types from SQL scripts f…
Browse files Browse the repository at this point in the history
…or MySQL and MariaDB databases (#32608)
  • Loading branch information
richard67 committed May 2, 2021
1 parent c590711 commit b9ae1ca
Show file tree
Hide file tree
Showing 20 changed files with 507 additions and 507 deletions.
Expand Up @@ -3,20 +3,20 @@
--

CREATE TABLE IF NOT EXISTS `#__workflows` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`asset_id` int(10) DEFAULT 0,
`published` tinyint(1) NOT NULL DEFAULT 0,
`id` int NOT NULL AUTO_INCREMENT,
`asset_id` int DEFAULT 0,
`published` tinyint NOT NULL DEFAULT 0,
`title` varchar(255) NOT NULL,
`description` text NOT NULL,
`extension` varchar(50) NOT NULL,
`default` tinyint(1) NOT NULL DEFAULT 0,
`ordering` int(11) NOT NULL DEFAULT 0,
`default` tinyint NOT NULL DEFAULT 0,
`ordering` int NOT NULL DEFAULT 0,
`created` datetime NOT NULL,
`created_by` int(10) NOT NULL DEFAULT 0,
`created_by` int NOT NULL DEFAULT 0,
`modified` datetime NOT NULL,
`modified_by` int(10) NOT NULL DEFAULT 0,
`modified_by` int NOT NULL DEFAULT 0,
`checked_out_time` datetime,
`checked_out` int(10) NOT NULL DEFAULT 0,
`checked_out` int NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `idx_asset_id` (`asset_id`),
KEY `idx_title` (`title`(191)),
Expand All @@ -41,8 +41,8 @@ INSERT INTO `#__workflows` (`id`, `asset_id`, `published`, `title`, `description
--

CREATE TABLE IF NOT EXISTS `#__workflow_associations` (
`item_id` int(10) NOT NULL DEFAULT 0 COMMENT 'Extension table id value',
`stage_id` int(10) NOT NULL COMMENT 'Foreign Key to #__workflow_stages.id',
`item_id` int NOT NULL DEFAULT 0 COMMENT 'Extension table id value',
`stage_id` int NOT NULL COMMENT 'Foreign Key to #__workflow_stages.id',
`extension` varchar(50) NOT NULL,
PRIMARY KEY (`item_id`, `extension`),
KEY `idx_item_stage_extension` (`item_id`, `stage_id`, `extension`),
Expand All @@ -56,16 +56,16 @@ CREATE TABLE IF NOT EXISTS `#__workflow_associations` (
--

CREATE TABLE IF NOT EXISTS `#__workflow_stages` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`asset_id` int(10) DEFAULT 0,
`ordering` int(11) NOT NULL DEFAULT 0,
`workflow_id` int(10) NOT NULL,
`published` tinyint(1) NOT NULL DEFAULT 0,
`id` int NOT NULL AUTO_INCREMENT,
`asset_id` int DEFAULT 0,
`ordering` int NOT NULL DEFAULT 0,
`workflow_id` int NOT NULL,
`published` tinyint NOT NULL DEFAULT 0,
`title` varchar(255) NOT NULL,
`description` text NOT NULL,
`default` tinyint(1) NOT NULL DEFAULT 0,
`default` tinyint NOT NULL DEFAULT 0,
`checked_out_time` datetime,
`checked_out` int(10) NOT NULL DEFAULT 0,
`checked_out` int NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `idx_workflow_id` (`workflow_id`),
KEY `idx_checked_out` (`checked_out`),
Expand All @@ -86,18 +86,18 @@ INSERT INTO `#__workflow_stages` (`id`, `asset_id`, `ordering`, `workflow_id`, `
--

CREATE TABLE IF NOT EXISTS `#__workflow_transitions` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`asset_id` int(10) DEFAULT 0,
`ordering` int(11) NOT NULL DEFAULT 0,
`workflow_id` int(10) NOT NULL,
`published` tinyint(1) NOT NULL DEFAULT 0,
`id` int NOT NULL AUTO_INCREMENT,
`asset_id` int DEFAULT 0,
`ordering` int NOT NULL DEFAULT 0,
`workflow_id` int NOT NULL,
`published` tinyint NOT NULL DEFAULT 0,
`title` varchar(255) NOT NULL,
`description` text NOT NULL,
`from_stage_id` int(10) NOT NULL,
`to_stage_id` int(10) NOT NULL,
`from_stage_id` int NOT NULL,
`to_stage_id` int NOT NULL,
`options` text NOT NULL,
`checked_out_time` datetime,
`checked_out` int(10) NOT NULL DEFAULT 0,
`checked_out` int NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `idx_title` (`title`(191)),
KEY `idx_asset_id` (`asset_id`),
Expand Down
Expand Up @@ -3,14 +3,14 @@
--

CREATE TABLE IF NOT EXISTS `#__csp` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id` int NOT NULL AUTO_INCREMENT,
`document_uri` varchar(500) NOT NULL DEFAULT '',
`blocked_uri` varchar(500) NOT NULL DEFAULT '',
`directive` varchar(500) NOT NULL DEFAULT '',
`client` varchar(500) NOT NULL DEFAULT '',
`created` datetime NOT NULL,
`modified` datetime NOT NULL,
`published` tinyint(1) NOT NULL DEFAULT 0,
`published` tinyint NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

Expand Down
@@ -1 +1 @@
ALTER TABLE `#__user_notes` CHANGE `modified_user_id` `modified_user_id` int(10) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `#__user_notes` CHANGE `modified_user_id` `modified_user_id` int unsigned NOT NULL DEFAULT 0;
@@ -1,11 +1,11 @@
CREATE TABLE IF NOT EXISTS `#__template_overrides` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id` int unsigned NOT NULL AUTO_INCREMENT,
`template` varchar(50) NOT NULL DEFAULT '',
`hash_id` varchar(255) NOT NULL DEFAULT '',
`extension_id` int(11) DEFAULT 0,
`state` tinyint(1) NOT NULL DEFAULT 0,
`extension_id` int DEFAULT 0,
`state` tinyint NOT NULL DEFAULT 0,
`action` varchar(50) NOT NULL DEFAULT '',
`client_id` tinyint(1) unsigned NOT NULL DEFAULT 0,
`client_id` tinyint unsigned NOT NULL DEFAULT 0,
`created_date` datetime NOT NULL,
`modified_date` datetime,
PRIMARY KEY (`id`),
Expand Down
Expand Up @@ -2,7 +2,7 @@ INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`,
(0, 'plg_extension_finder', 'plugin', 'finder', 'extension', 0, 1, 1, 0, '', '', '', 0, '0000-00-00 00:00:00', 0, 0);

TRUNCATE TABLE `#__finder_filters`;
ALTER TABLE `#__finder_filters` MODIFY `created_by` int(10) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `#__finder_filters` MODIFY `created_by` int unsigned NOT NULL DEFAULT 0;
ALTER TABLE `#__finder_filters` MODIFY `created_by_alias` varchar(255) NOT NULL DEFAULT '';
ALTER TABLE `#__finder_filters` MODIFY `created` datetime NOT NULL;
ALTER TABLE `#__finder_filters` MODIFY `modified` datetime NOT NULL;
Expand All @@ -13,8 +13,8 @@ ALTER TABLE `#__finder_filters` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_un
TRUNCATE TABLE `#__finder_links`;
ALTER TABLE `#__finder_links` CHANGE `route` `route` varchar(400);
ALTER TABLE `#__finder_links` CHANGE `language` `language` CHAR(7) NOT NULL DEFAULT '' AFTER `access`;
ALTER TABLE `#__finder_links` MODIFY `state` int(5) NOT NULL DEFAULT 1;
ALTER TABLE `#__finder_links` MODIFY `access` int(5) NOT NULL DEFAULT 0;
ALTER TABLE `#__finder_links` MODIFY `state` int NOT NULL DEFAULT 1;
ALTER TABLE `#__finder_links` MODIFY `access` int NOT NULL DEFAULT 0;
ALTER TABLE `#__finder_links` MODIFY `indexdate` datetime NOT NULL;
ALTER TABLE `#__finder_links` MODIFY `publish_start_date` datetime NULL DEFAULT NULL;
ALTER TABLE `#__finder_links` MODIFY `publish_end_date` datetime NULL DEFAULT NULL;
Expand All @@ -25,8 +25,8 @@ ALTER TABLE `#__finder_links` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_u
ALTER TABLE `#__finder_links` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

CREATE TABLE `#__finder_links_terms` (
`link_id` INT(10) UNSIGNED NOT NULL,
`term_id` INT(10) UNSIGNED NOT NULL,
`link_id` INT UNSIGNED NOT NULL,
`term_id` INT UNSIGNED NOT NULL,
`weight` FLOAT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`link_id`, `term_id`),
INDEX `idx_term_weight` (`term_id`, `weight`),
Expand Down Expand Up @@ -54,8 +54,8 @@ CREATE TABLE IF NOT EXISTS `#__finder_logging` (
`searchterm` VARCHAR(255) NOT NULL DEFAULT '',
`md5sum` VARCHAR(32) NOT NULL DEFAULT '',
`query` BLOB NOT NULL,
`hits` INT(11) NOT NULL DEFAULT 1,
`results` INT(11) NOT NULL DEFAULT 0,
`hits` INT NOT NULL DEFAULT 1,
`results` INT NOT NULL DEFAULT 0,
PRIMARY KEY (`md5sum`),
INDEX `searchterm` (`searchterm`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
Expand All @@ -64,16 +64,16 @@ ALTER TABLE `#__finder_logging` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_un

DROP TABLE `#__finder_taxonomy`;
CREATE TABLE IF NOT EXISTS `#__finder_taxonomy` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`parent_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`lft` INT(11) NOT NULL DEFAULT '0',
`rgt` INT(11) NOT NULL DEFAULT '0',
`level` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`parent_id` INT UNSIGNED NOT NULL DEFAULT '0',
`lft` INT NOT NULL DEFAULT '0',
`rgt` INT NOT NULL DEFAULT '0',
`level` INT UNSIGNED NOT NULL DEFAULT '0',
`path` VARCHAR(400) NOT NULL DEFAULT '',
`title` VARCHAR(255) NOT NULL DEFAULT '',
`alias` VARCHAR(400) NOT NULL DEFAULT '',
`state` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
`access` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
`state` TINYINT UNSIGNED NOT NULL DEFAULT '1',
`access` TINYINT UNSIGNED NOT NULL DEFAULT '1',
`language` CHAR(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
INDEX `idx_state` (`state`),
Expand Down Expand Up @@ -107,7 +107,7 @@ DROP TABLE IF EXISTS `#__finder_terms_common`;
CREATE TABLE `#__finder_terms_common` (
`term` varchar(75) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
`language` char(7) NOT NULL DEFAULT '',
`custom` int(11) NOT NULL DEFAULT '0',
`custom` int NOT NULL DEFAULT '0',
UNIQUE KEY `idx_term_language` (`term`,`language`),
KEY `idx_lang` (`language`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
Expand Down
@@ -1,2 +1,2 @@
ALTER TABLE `#__update_sites` ADD COLUMN `checked_out` int(10) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `#__update_sites` ADD COLUMN `checked_out` int unsigned NOT NULL DEFAULT 0;
ALTER TABLE `#__update_sites` ADD COLUMN `checked_out_time` datetime NULL DEFAULT NULL;
@@ -1,6 +1,6 @@
-- 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 the extension is locked. Locked extensions cannot be uninstalled.';
ALTER TABLE `#__extensions` MODIFY `protected` tinyint 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 NOT NULL DEFAULT 0 COMMENT 'Flag to indicate if the extension is locked. Locked extensions cannot be uninstalled.';

-- Set all core extensions as locked extensions and unprotected them.
UPDATE `#__extensions`
Expand Down
@@ -1,22 +1,22 @@
ALTER TABLE `#__extensions` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__menu` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__modules` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__tags` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__update_sites` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__user_notes` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__workflows` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__workflow_stages` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__workflow_transitions` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__banners` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__banner_clients` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__contact_details` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__content` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__finder_filters` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__newsfeeds` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__categories` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__fields` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__fields_groups` MODIFY `checked_out` INT(10) UNSIGNED;
ALTER TABLE `#__ucm_content` MODIFY `core_checked_out_user_id` INT(10) UNSIGNED;
ALTER TABLE `#__extensions` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__menu` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__modules` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__tags` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__update_sites` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__user_notes` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__workflows` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__workflow_stages` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__workflow_transitions` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__banners` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__banner_clients` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__contact_details` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__content` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__finder_filters` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__newsfeeds` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__categories` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__fields` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__fields_groups` MODIFY `checked_out` INT UNSIGNED;
ALTER TABLE `#__ucm_content` MODIFY `core_checked_out_user_id` INT UNSIGNED;

UPDATE `#__extensions` SET `checked_out` = null WHERE `checked_out` = 0;
UPDATE `#__menu` SET `checked_out` = null WHERE `checked_out` = 0;
Expand Down
@@ -1 +1 @@
ALTER TABLE `#__fields` ADD COLUMN `only_use_in_subform` tinyint(1) NOT NULL DEFAULT 0;
ALTER TABLE `#__fields` ADD COLUMN `only_use_in_subform` tinyint NOT NULL DEFAULT 0;
56 changes: 28 additions & 28 deletions administrator/components/com_banners/sql/install.mysql.utf8.sql
Expand Up @@ -3,40 +3,40 @@
--

CREATE TABLE IF NOT EXISTS `#__banners` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`cid` int(11) NOT NULL DEFAULT 0,
`type` int(11) NOT NULL DEFAULT 0,
`id` int NOT NULL AUTO_INCREMENT,
`cid` int NOT NULL DEFAULT 0,
`type` int NOT NULL DEFAULT 0,
`name` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
`imptotal` int(11) NOT NULL DEFAULT 0,
`impmade` int(11) NOT NULL DEFAULT 0,
`clicks` int(11) NOT NULL DEFAULT 0,
`imptotal` int NOT NULL DEFAULT 0,
`impmade` int NOT NULL DEFAULT 0,
`clicks` int NOT NULL DEFAULT 0,
`clickurl` varchar(200) NOT NULL DEFAULT '',
`state` tinyint(3) NOT NULL DEFAULT 0,
`catid` int(10) unsigned NOT NULL DEFAULT 0,
`state` tinyint NOT NULL DEFAULT 0,
`catid` int unsigned NOT NULL DEFAULT 0,
`description` text NOT NULL,
`custombannercode` varchar(2048) NOT NULL,
`sticky` tinyint(1) unsigned NOT NULL DEFAULT 0,
`ordering` int(11) NOT NULL DEFAULT 0,
`sticky` tinyint unsigned NOT NULL DEFAULT 0,
`ordering` int NOT NULL DEFAULT 0,
`metakey` text NOT NULL,
`params` text NOT NULL,
`own_prefix` tinyint(1) NOT NULL DEFAULT 0,
`own_prefix` tinyint NOT NULL DEFAULT 0,
`metakey_prefix` varchar(400) NOT NULL DEFAULT '',
`purchase_type` tinyint(4) NOT NULL DEFAULT -1,
`track_clicks` tinyint(4) NOT NULL DEFAULT -1,
`track_impressions` tinyint(4) NOT NULL DEFAULT -1,
`checked_out` int(10) unsigned NOT NULL DEFAULT 0,
`purchase_type` tinyint NOT NULL DEFAULT -1,
`track_clicks` tinyint NOT NULL DEFAULT -1,
`track_impressions` tinyint NOT NULL DEFAULT -1,
`checked_out` int unsigned NOT NULL DEFAULT 0,
`checked_out_time` datetime,
`publish_up` datetime,
`publish_down` datetime,
`reset` datetime,
`created` datetime NOT NULL,
`language` char(7) NOT NULL DEFAULT '',
`created_by` int(10) unsigned NOT NULL DEFAULT 0,
`created_by` int unsigned NOT NULL DEFAULT 0,
`created_by_alias` varchar(255) NOT NULL DEFAULT '',
`modified` datetime NOT NULL,
`modified_by` int(10) unsigned NOT NULL DEFAULT 0,
`version` int(10) unsigned NOT NULL DEFAULT 1,
`modified_by` int unsigned NOT NULL DEFAULT 0,
`version` int unsigned NOT NULL DEFAULT 1,
PRIMARY KEY (`id`),
KEY `idx_state` (`state`),
KEY `idx_own_prefix` (`own_prefix`),
Expand All @@ -50,20 +50,20 @@ CREATE TABLE IF NOT EXISTS `#__banners` (
--

CREATE TABLE IF NOT EXISTS `#__banner_clients` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`contact` varchar(255) NOT NULL DEFAULT '',
`email` varchar(255) NOT NULL DEFAULT '',
`extrainfo` text NOT NULL,
`state` tinyint(3) NOT NULL DEFAULT 0,
`checked_out` int(10) unsigned NOT NULL DEFAULT 0,
`state` tinyint NOT NULL DEFAULT 0,
`checked_out` int unsigned NOT NULL DEFAULT 0,
`checked_out_time` datetime,
`metakey` text NOT NULL,
`own_prefix` tinyint(4) NOT NULL DEFAULT 0,
`own_prefix` tinyint NOT NULL DEFAULT 0,
`metakey_prefix` varchar(400) NOT NULL DEFAULT '',
`purchase_type` tinyint(4) NOT NULL DEFAULT -1,
`track_clicks` tinyint(4) NOT NULL DEFAULT -1,
`track_impressions` tinyint(4) NOT NULL DEFAULT -1,
`purchase_type` tinyint NOT NULL DEFAULT -1,
`track_clicks` tinyint NOT NULL DEFAULT -1,
`track_impressions` tinyint NOT NULL DEFAULT -1,
PRIMARY KEY (`id`),
KEY `idx_own_prefix` (`own_prefix`),
KEY `idx_metakey_prefix` (`metakey_prefix`(100))
Expand All @@ -75,9 +75,9 @@ CREATE TABLE IF NOT EXISTS `#__banner_clients` (

CREATE TABLE IF NOT EXISTS `#__banner_tracks` (
`track_date` datetime NOT NULL,
`track_type` int(10) unsigned NOT NULL,
`banner_id` int(10) unsigned NOT NULL,
`count` int(10) unsigned NOT NULL DEFAULT 0,
`track_type` int unsigned NOT NULL,
`banner_id` int unsigned NOT NULL,
`count` int unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`track_date`,`track_type`,`banner_id`),
KEY `idx_track_date` (`track_date`),
KEY `idx_track_type` (`track_type`),
Expand Down

0 comments on commit b9ae1ca

Please sign in to comment.