CREATE TABLE IF NOT EXISTS `#__redirect_sef` (
 `sefid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `namekey` varchar(250) NOT NULL,
 `lgid` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `controller` varchar(100) NOT NULL,
 `task` varchar(100) NOT NULL,
 `eid` int(10) unsigned NOT NULL DEFAULT '0',
 `others` varchar(254) NOT NULL,
 PRIMARY KEY (`sefid`),
 KEY `IX_redirect_sef_all` (`lgid`,`controller`(30),`task`(20),`eid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__layout_trans` (
 `yid` mediumint(8) unsigned NOT NULL,
 `lgid` tinyint(3) unsigned NOT NULL,
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `wname` varchar(255) NOT NULL,
 `wdescription` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `seotitle` varchar(255) NOT NULL,
 `seodescription` text NOT NULL,
 `seokeywords` text NOT NULL,
 PRIMARY KEY (`yid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__widgets_type_trans` (
 `wgtypeid` int(10) unsigned NOT NULL,
 `lgid` smallint(5) unsigned NOT NULL,
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`wgtypeid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__layout_listings` (
 `lid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
 `yid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `sid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `map` varchar(30) NOT NULL,
 `parent` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `type` varchar(100) NOT NULL,
 `ordering` tinyint(3) unsigned NOT NULL DEFAULT '99',
 `hidden` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `level` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '1',
 `publish` tinyint(4) NOT NULL DEFAULT '1',
 `search` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `advsearch` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `advordering` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL,
 `params` text NOT NULL,
 `did` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `ref_wid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `namekey` varchar(100) NOT NULL,
 `fdid` int(10) unsigned NOT NULL DEFAULT '0',
 `parentdft` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `xsvisible` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `xshidden` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `devicevisible` varchar(100) NOT NULL,
 `devicehidden` varchar(100) NOT NULL,
 PRIMARY KEY (`lid`),
 UNIQUE KEY `UK_layout_listings_namekey` (`namekey`),
 KEY `IX_layout_listing_yid_publish_level_rolid_hidden_ordering` (`yid`,`level`,`publish`,`rolid`,`hidden`,`ordering`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__layout_multiformstrans` (
 `fid` mediumint(8) unsigned NOT NULL,
 `lgid` tinyint(3) unsigned NOT NULL,
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`fid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__layout_mlinks` (
 `mid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
 `yid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `type` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `icon` varchar(50) NOT NULL,
 `action` varchar(150) NOT NULL,
 `parent` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `ordering` tinyint(3) unsigned NOT NULL DEFAULT '99',
 `level` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '1',
`ref_wid` tinyint(4) NOT NULL DEFAULT '0',
 `params` text NOT NULL,
 `private` tinyint(4) NOT NULL DEFAULT '0',
 `position` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '1',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `namekey` varchar(100) NOT NULL,
 `faicon` varchar(50) NOT NULL,
 `color` varchar(15) NOT NULL,
 `xsvisible` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `xshidden` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `devicevisible` varchar(100) NOT NULL,
 `devicehidden` varchar(100) NOT NULL,
 PRIMARY KEY (`mid`),
 UNIQUE KEY `UK_layout_menus_namekey` (`namekey`),
 KEY `layout_mlinks_index_yid_publish_level_rolid_ordering` (`yid`,`level`,`publish`,`ordering`,`rolid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;


CREATE TABLE IF NOT EXISTS `#__widgets_trans` (
 `widgetid` int(10) unsigned NOT NULL,
 `lgid` int(10) unsigned NOT NULL,
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`widgetid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__layout_node` (
 `yid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
 `namekey` varchar(100) NOT NULL,
 `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `subtype` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `wid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `sid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `frontend` tinyint(4) NOT NULL DEFAULT '0',
 `menu` tinyint(4) NOT NULL DEFAULT '1',
 `wizard` tinyint(4) NOT NULL DEFAULT '0',
 `form` tinyint(4) NOT NULL DEFAULT '1',
 `dropdown` tinyint(4) NOT NULL DEFAULT '0',
 `pagination` tinyint(4) NOT NULL DEFAULT '0',
 `filters` tinyint(4) NOT NULL DEFAULT '0',
 `level` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '1',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `params` text NOT NULL,
 `core` tinyint(4) NOT NULL DEFAULT '1',
 `private` tinyint(4) NOT NULL DEFAULT '0',
 `icon` varchar(50) NOT NULL,
 `tmid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `alias` varchar(255) NOT NULL,
 `fields` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `parent` varchar(100) NOT NULL,
 `reload` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `widgets` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `faicon` varchar(50) NOT NULL,
 `useredit` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `pnamekey` varchar(100) NOT NULL,
 `custom` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`yid`),
 UNIQUE KEY `UK_layout_node_namekey` (`namekey`),
 KEY `IX_layout_node_wid_type_publish_level_rolid` (`type`,`wid`,`publish`,`level`,`rolid`),
 KEY `IX_layout_node_sid` (`sid`),
 KEY `IX_layout_node_useredit_core` (`useredit`,`core`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__layout_mlinkstrans` (
 `mid` mediumint(8) unsigned NOT NULL,
 `lgid` tinyint(3) unsigned NOT NULL,
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `message` text NOT NULL,
 PRIMARY KEY (`mid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__layout_multiforms` (
 `fid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
 `yid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `sid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `map` varchar(100) NOT NULL,
 `type` varchar(100) NOT NULL,
 `parent` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `ordering` smallint(5) unsigned NOT NULL DEFAULT '99',
 `initial` varchar(255) NOT NULL,
 `readonly` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `hidden` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `required` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `level` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '1',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `params` text NOT NULL,
 `did` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `area` varchar(20) NOT NULL,
 `ref_yid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `frame` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `private` tinyint(4) NOT NULL DEFAULT '0',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `namekey` varchar(100) NOT NULL,
 `fdid` int(10) unsigned NOT NULL DEFAULT '0',
`ref_wid` tinyint(4) NOT NULL DEFAULT '0',
 `parentdft` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `checktype` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `xsvisible` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `xshidden` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `devicevisible` varchar(100) NOT NULL,
 `devicehidden` varchar(100) NOT NULL,
 PRIMARY KEY (`fid`),
 UNIQUE KEY `UK_layout_forms_namekey` (`namekey`),
 KEY `IX_layout_multiform_yid_publish_level_rolid_ordering` (`level`,`publish`,`yid`,`ordering`,`rolid`),
 KEY `IX_layout_multiform_map` (`map`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;


CREATE TABLE IF NOT EXISTS `#__widgets_node` (
 `widgetid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `namekey` varchar(150) NOT NULL,
 `alias` varchar(150) NOT NULL,
 `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `modifiedby` int(10) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `framework_type` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `framework_id` int(10) unsigned NOT NULL DEFAULT '0',
 `catid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `params` text NOT NULL,
 `wid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `wgtypeid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`widgetid`),
 UNIQUE KEY `UK_widgets_node_namekey` (`namekey`),
 KEY `IX_widgets_node_framework_type_publish_core` (`framework_type`,`publish`,`core`),
 KEY `IX_widgets_node_framework_id_rolid` (`framework_id`,`rolid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__message_queue` (
 `mgqid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `mgid` int(10) unsigned NOT NULL DEFAULT '0',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `priority` tinyint(3) unsigned NOT NULL DEFAULT '254',
 `expirationdate` int(10) unsigned NOT NULL DEFAULT '0',
 `repetition` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `params` text NOT NULL,
 `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `content` text NOT NULL,
 `isread` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `title` varchar(255) NOT NULL,
 `subtitle` varchar(255) NOT NULL,
 `link` varchar(254) NOT NULL,
 PRIMARY KEY (`mgqid`),
 KEY `IX_message_queue_uid_read_create` (`uid`,`isread`,`created`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__widgets_type` (
 `wgtypeid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
 `namekey` varchar(100) NOT NULL,
 `alias` varchar(150) NOT NULL,
 `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`wgtypeid`),
 UNIQUE KEY `UK_widgets_type_namekey` (`namekey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__layout_listingstrans` (
 `lid` mediumint(8) unsigned NOT NULL,
 `lgid` tinyint(3) unsigned NOT NULL,
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `textlink` varchar(254) NOT NULL,
 PRIMARY KEY (`lid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__country_states` (
 `stateid` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
 `name` varchar(64) NOT NULL,
 `namekey` varchar(64) NOT NULL,
 `code2` char(2) DEFAULT NULL,
 `code3` char(3) DEFAULT NULL,
 `publish` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `ctyid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `ordering` smallint(5) unsigned NOT NULL DEFAULT '1',
 PRIMARY KEY (`stateid`),
 UNIQUE KEY `UK_code3_ctryid` (`code3`,`ctyid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__country_language` (
 `ctyid` int(10) unsigned NOT NULL,
 `lgid` tinyint(4) unsigned NOT NULL,
 `ordering` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `url` varchar(64) NOT NULL,
 PRIMARY KEY (`ctyid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__country_node` (
 `ctyid` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
 `isocode2` char(2) NOT NULL,
 `namekey` varchar(80) NOT NULL,
 `name` varchar(80) NOT NULL,
 `isocode3` char(3) NOT NULL,
 `numcode` smallint(6) NOT NULL DEFAULT '0',
 `timezone` smallint(6) NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '1',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `ordering` smallint(5) unsigned NOT NULL DEFAULT '1',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `description` text NOT NULL,
 PRIMARY KEY (`ctyid`),
 UNIQUE KEY `UK_country_node_namekey` (`namekey`),
 KEY `IX_country_node_publish_isocode3_ordering` (`publish`,`isocode3`,`ordering`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__currency_country` (
 `curid` int(10) unsigned NOT NULL,
 `ctyid` int(10) unsigned NOT NULL,
 `ordering` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`curid`,`ctyid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__currency_conversion_history` (
 `curhisid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `curid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `curid_ref` smallint(5) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `exchange` decimal(12,6) unsigned NOT NULL DEFAULT '0.000000',
 `alias` varchar(255) NOT NULL,
 `exsiteid` int(10) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`curhisid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__currency_node` (
 `curid` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
 `title` varchar(30) NOT NULL,
 `code` char(255) NOT NULL,
 `number` smallint(5) unsigned NOT NULL DEFAULT '0',
 `symbol` varchar(8) NOT NULL,
 `position` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `cents` varchar(20) NOT NULL,
 `basic` smallint(5) unsigned NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `rate` decimal(10,6) NOT NULL DEFAULT '1.000000',
 `accepted` tinyint(4) NOT NULL DEFAULT '0',
 `ordering` int(10) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '1',
 PRIMARY KEY (`curid`),
 UNIQUE KEY `UK_currency_node_code` (`code`(3)),
 KEY `IX_currency_node_accepted` (`accepted`),
 KEY `IX_currency_node_publish` (`publish`,`ordering`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__currency_conversion` (
 `curid` tinyint(3) unsigned NOT NULL,
 `curid_ref` smallint(5) unsigned NOT NULL,
 `name` varchar(100) NOT NULL,
 `alias` varchar(100) NOT NULL,
 `exchange` decimal(12,6) unsigned NOT NULL DEFAULT '0.000000',
 `rate` decimal(12,6) unsigned NOT NULL DEFAULT '0.000000',
 `fee` decimal(4,2) unsigned NOT NULL DEFAULT '0.00',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `accepted` tinyint(4) NOT NULL DEFAULT '0',
 `ordering` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`curid`,`curid_ref`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__scheduler_trans` (
 `schid` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
 `lgid` tinyint(3) unsigned NOT NULL,
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`schid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__scheduler_url` (
 `schurlid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `name` varchar(50) NOT NULL,
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `description` text NOT NULL,
 `url` varchar(255) NOT NULL,
 `nextdate` int(10) unsigned NOT NULL DEFAULT '0',
 `frequency` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `priority` tinyint(4) NOT NULL DEFAULT '50',
 `attempt` tinyint(2) unsigned NOT NULL DEFAULT '0',
 `lastdate` int(10) unsigned NOT NULL DEFAULT '0',
 `sendreport` tinyint(4) NOT NULL DEFAULT '0',
 `lastreport` text NOT NULL,
 `email` varchar(100) NOT NULL,
 `publish` tinyint(4) NOT NULL DEFAULT '1',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `timeout` tinyint(3) unsigned NOT NULL DEFAULT '50',
 `type` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `lock` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`schurlid`),
 UNIQUE KEY `UK_scheduler_url_url` (`url`(100)),
 KEY `IX_scheduler_url_publish_lock_nextdate_priority` (`publish`,`lock`,`nextdate`,`priority`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__scheduler_processes` (
 `pcsid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `schid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`pcsid`),
 KEY `IX_scheduler_processes_schid` (`schid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__scheduler_node` (
 `schid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `nextdate` int(10) unsigned NOT NULL DEFAULT '0',
 `frequency` int(10) unsigned NOT NULL DEFAULT '0',
 `priority` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `lastdate` int(10) unsigned NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '1',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `params` text NOT NULL,
 `cron` varchar(50) NOT NULL,
 `ptype` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `wid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `namekey` varchar(50) NOT NULL,
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `report` text NOT NULL,
 `maxtime` int(10) unsigned NOT NULL DEFAULT '5',
 `maxprocess` smallint(5) unsigned NOT NULL DEFAULT '1',
 `viewname` varchar(50) NOT NULL,
 PRIMARY KEY (`schid`),
 UNIQUE KEY `UK_namekey_scheduler_node` (`namekey`),
 KEY `IX_scheduler_node_wid` (`wid`),
 KEY `IX_scheduler_node_publish_priority_nextdate` (`publish`,`nextdate`,`priority`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__mailing_node` (
 `mgid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `wid` int(10) unsigned NOT NULL DEFAULT '0',
 `namekey` varchar(100) NOT NULL,
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `type` tinyint(3) unsigned NOT NULL DEFAULT '101',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '1',
 `senddate` int(10) unsigned NOT NULL DEFAULT '0',
 `html` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `alias` varchar(255) NOT NULL,
 `params` text NOT NULL,
 `level` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `tags` text NOT NULL,
 `archive` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `status` tinyint(4) NOT NULL DEFAULT '10',
 `attach` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `publishstart` int(10) unsigned NOT NULL DEFAULT '0',
 `publishend` int(10) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `sms` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `template` tinyint(3) unsigned NOT NULL DEFAULT '3',
 `format` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `notify` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `enddate` int(10) unsigned NOT NULL DEFAULT '0',
 `channel` text NOT NULL,
 PRIMARY KEY (`mgid`),
 UNIQUE KEY `UK_mailing_node_namekey` (`namekey`),
 KEY `IX_mailing_node_archive_publish_status_modified` (`archive`,`publish`,`status`,`modified`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__mailing_type` (
 `mgtypeid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `namekey` varchar(150) NOT NULL,
 `alias` varchar(150) NOT NULL,
 `designation` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `ordering` smallint(5) unsigned NOT NULL DEFAULT '1',
 PRIMARY KEY (`mgtypeid`),
 UNIQUE KEY `UK_mailing_type_namekey` (`namekey`),
 KEY `IX_mailing_type_publish_designation` (`publish`,`designation`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__mailing_statistics_user` (
 `mgid` int(10) unsigned NOT NULL,
 `uid` int(10) unsigned NOT NULL,
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `htmlsent` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `textsent` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `failed` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `bounced` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `smssent` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `hitlinks` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `read` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `readdate` int(10) unsigned NOT NULL DEFAULT '0',
 `mailerid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `sent` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`mgid`,`uid`,`created`),
 KEY `IX_mailing_statistics_user_created` (`created`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__mailing_statistics` (
 `mgid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `sent` int(10) unsigned NOT NULL DEFAULT '0',
 `failed` int(10) unsigned NOT NULL DEFAULT '0',
 `total` int(10) unsigned NOT NULL DEFAULT '0',
 `htmlsent` int(10) unsigned NOT NULL DEFAULT '0',
 `textsent` int(10) unsigned NOT NULL DEFAULT '0',
 `htmlread` int(10) unsigned NOT NULL DEFAULT '0',
 `textread` int(10) unsigned NOT NULL DEFAULT '0',
 `hitlinks` int(10) unsigned NOT NULL DEFAULT '0',
 `bounces` int(10) unsigned NOT NULL DEFAULT '0',
 `smssent` int(10) unsigned NOT NULL DEFAULT '0',
 `read` int(10) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`mgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__mailing_queue` (
 `qid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `mgid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `senddate` int(10) unsigned NOT NULL DEFAULT '0',
 `priority` tinyint(3) unsigned NOT NULL DEFAULT '100',
 `attempt` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '1',
 `params` text NOT NULL,
 `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `cmpgnid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `actid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `status` tinyint(4) NOT NULL DEFAULT '0',
 `lsid` int(10) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`qid`),
 KEY `IX_mailing_queue_publish_priority_senddate` (`publish`,`priority`,`senddate`),
 KEY `IX_mailing_queue_mgid_cmpgnid_uid_lsid_publish` (`mgid`,`cmpgnid`,`uid`,`publish`,`lsid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__mailing_type_trans` (
 `mgtypeid` int(10) unsigned NOT NULL,
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `lgid` int(10) unsigned NOT NULL,
 PRIMARY KEY (`mgtypeid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__mailing_trans` (
 `mgid` int(10) unsigned NOT NULL,
 `lgid` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `name` varchar(255) NOT NULL,
 `ctext` longtext NOT NULL,
 `chtml` longtext NOT NULL,
 `smail` char(100) NOT NULL,
 `sname` char(50) NOT NULL,
 `rmail` varchar(100) NOT NULL,
 `rname` varchar(100) NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `bouncemail` varchar(100) NOT NULL,
 `authorid` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `intro` text NOT NULL,
 `smsmessage` text NOT NULL,
 `title` varchar(255) NOT NULL,
 `subtitle` varchar(255) NOT NULL,
 PRIMARY KEY (`mgid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__mailer_node` (
 `mailerid` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
 `namekey` varchar(150) NOT NULL,
 `alias` varchar(150) NOT NULL,
 `type` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `modifiedby` int(10) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `sendername` varchar(100) NOT NULL,
 `senderemail` varchar(100) NOT NULL,
 `replyname` varchar(100) NOT NULL,
 `replyemail` varchar(100) NOT NULL,
 `bouncebackemail` varchar(100) NOT NULL,
 `embedimages` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `multiplepart` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `encodingformat` varchar(50) NOT NULL,
 `charset` varchar(100) NOT NULL,
 `wordwrapping` int(10) unsigned NOT NULL DEFAULT '0',
 `addnames` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `params` text NOT NULL,
 `premium` tinyint(4) NOT NULL DEFAULT '0',
 `designation` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `ordering` smallint(5) unsigned NOT NULL DEFAULT '9',
 `hostname` varchar(254) NOT NULL,
 PRIMARY KEY (`mailerid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__extension_trans` (
 `lgid` tinyint(3) unsigned NOT NULL,
 `wid` mediumint(8) unsigned NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`lgid`,`wid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__extension_languages` (
 `wid` mediumint(8) unsigned NOT NULL,
 `lgid` tinyint(3) unsigned NOT NULL,
 `available` tinyint(4) NOT NULL DEFAULT '0',
 `translation` tinyint(4) NOT NULL DEFAULT '1',
 `completed` double(5,2) unsigned NOT NULL DEFAULT '0.00',
 `automatic` double(5,2) unsigned NOT NULL DEFAULT '0.00',
 `totalimac` int(10) unsigned NOT NULL DEFAULT '0',
 `manual` double(5,2) unsigned NOT NULL DEFAULT '0.00',
 PRIMARY KEY (`wid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__extension_translation` (
 `wid` int(10) unsigned NOT NULL,
 `lgid` int(10) unsigned NOT NULL,
 `modifiedby` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`wid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__extension_node` (
 `wid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
 `namekey` varchar(100) NOT NULL,
 `folder` varchar(40) NOT NULL,
 `name` varchar(100) NOT NULL,
 `type` smallint(5) unsigned NOT NULL DEFAULT '1',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `status` tinyint(4) NOT NULL DEFAULT '0',
 `params` text NOT NULL,
 `destination` varchar(255) NOT NULL,
 `parent` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `trans` tinyint(4) NOT NULL DEFAULT '0',
 `certify` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `version` int(10) unsigned NOT NULL DEFAULT '0',
 `lversion` int(10) unsigned NOT NULL DEFAULT '0',
 `pref` tinyint(4) NOT NULL DEFAULT '0',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `install` text NOT NULL,
 `ordering` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `reload` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `showconfig` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `framework` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`wid`),
 UNIQUE KEY `UK_extension_node_namekey` (`namekey`),
 KEY `IX_extension_node_publish_certify` (`publish`,`certify`),
 KEY `IX_extension_node_type_modified` (`type`,`modified`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__extension_version` (
 `vsid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `wid` int(10) unsigned NOT NULL DEFAULT '0',
 `version` int(10) unsigned NOT NULL DEFAULT '0',
 `status` tinyint(4) NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `beta` smallint(5) unsigned NOT NULL DEFAULT '0',
 `filid` int(10) unsigned NOT NULL DEFAULT '0',
 `level` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `encoding` varchar(100) NOT NULL,
 `changelog` text NOT NULL,
 `final` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `sha1` varchar(100) NOT NULL,
 `code` char(32) NOT NULL,
 `marketing` varchar(255) NOT NULL,
 PRIMARY KEY (`vsid`),
 UNIQUE KEY `UK_extension_version_wid_version` (`wid`,`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__extension_leveltrans` (
 `lwid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `lgid` tinyint(3) unsigned NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`lwid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__extension_info` (
 `wid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `author` varchar(100) NOT NULL,
 `documentation` varchar(255) NOT NULL,
 `images` varchar(255) NOT NULL,
 `flash` varchar(255) NOT NULL,
 `support` varchar(255) NOT NULL,
 `forum` varchar(255) NOT NULL,
 `homeurl` varchar(200) NOT NULL,
 `feedback` varchar(255) NOT NULL,
 `userversion` varchar(100) NOT NULL,
 `userlversion` varchar(100) NOT NULL,
 `beta` smallint(5) NOT NULL DEFAULT '0',
 `keyword` varchar(200) NOT NULL,
 PRIMARY KEY (`wid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__extension_level` (
 `lwid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `wid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `level` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `status` tinyint(4) NOT NULL DEFAULT '0',
 `namekey` varchar(50) NOT NULL,
 PRIMARY KEY (`lwid`),
 UNIQUE KEY `UK_extension_level_wid_level` (`wid`,`level`),
 UNIQUE KEY `NamekeyExtensionLevel` (`namekey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__extension_dependency` (
 `exdpid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `wid` mediumint(8) unsigned DEFAULT '0',
 `ref_wid` mediumint(8) unsigned DEFAULT '0',
 PRIMARY KEY (`exdpid`),
 UNIQUE KEY `UK_extension_dependency_wid_wid_ref` (`wid`,`ref_wid`),
 KEY `IX_extension_dependency_wid` (`wid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__space_theme` (
 `wsid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `size` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `device` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `tmid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`wsid`,`size`,`device`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__space_node` (
 `wsid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `namekey` varchar(50) NOT NULL,
 `alias` varchar(150) NOT NULL,
 `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `publish` tinyint(4) NOT NULL DEFAULT '1',
 `tmid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `menu` varchar(100) NOT NULL,
 `yid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `catid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `theme` varchar(50) NOT NULL,
 `controller` varchar(150) NOT NULL,
 `restrictuser` tinyint(4) NOT NULL DEFAULT '0',
 `frameworktheme` tinyint(4) NOT NULL DEFAULT '0',
 PRIMARY KEY (`wsid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__space_trans` (
 `lgid` tinyint(4) unsigned NOT NULL,
 `wsid` int(10) unsigned NOT NULL,
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`wsid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__eguillage_roles` (
 `ctrid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `override` tinyint(3) unsigned NOT NULL DEFAULT '1',
 PRIMARY KEY (`ctrid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__eguillage_trans` (
 `ctrid` int(10) unsigned NOT NULL,
 `lgid` tinyint(4) unsigned NOT NULL,
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`ctrid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__eguillage_node` (
 `ctrid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
 `namekey` varchar(100) NOT NULL,
 `app` varchar(100) NOT NULL,
 `task` varchar(100) NOT NULL,
 `premium` tinyint(4) NOT NULL DEFAULT '0',
 `admin` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `yid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `wid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `level` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '1',
 `path` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '1',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `trigger` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `visible` tinyint(3) unsigned NOT NULL DEFAULT '9',
 `checkowner` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `reload` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `checkadminowner` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `pnamekey` varchar(100) NOT NULL,
 `custom` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`ctrid`),
 UNIQUE KEY `UK_controller_app_task_admin` (`app`,`task`,`admin`),
 UNIQUE KEY `UK_controller_namekey` (`namekey`),
 KEY `IX_controller_publish_premium_level` (`publish`,`level`,`premium`),
 KEY `IX_controller_node_wid` (`wid`),
 KEY `IX_controller_node_yid` (`yid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__eguillage_action` (
 `ctr_action_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `ctrid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `actid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `action` varchar(100) NOT NULL,
 `ordering` smallint(5) unsigned NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '1',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `params` text NOT NULL,
 `namekey` varchar(50) NOT NULL,
 PRIMARY KEY (`ctr_action_id`),
 KEY `IX_eguillage_action_ctrid_publish` (`ctrid`,`publish`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__action_node` (
 `actid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
 `namekey` varchar(255) NOT NULL,
 `wid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `folder` varchar(30) NOT NULL,
 `status` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `filter` tinyint(4) NOT NULL DEFAULT '0',
 `params` text NOT NULL,
 `publish` tinyint(4) NOT NULL DEFAULT '1',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `before` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `ordering` smallint(5) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`actid`),
 UNIQUE KEY `UK_action_node_namekey` (`namekey`(100)),
 KEY `IX_action_node_wid_publish` (`wid`,`publish`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__actions_type` (
 `acttyid` smallint(10) unsigned NOT NULL AUTO_INCREMENT,
 `namekey` varchar(150) NOT NULL,
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`acttyid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__model_node` (
 `sid` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
 `dbtid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `path` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `namekey` varchar(255) NOT NULL,
 `folder` varchar(255) NOT NULL,
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `level` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `extended` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `params` text NOT NULL,
 `checkval` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `alias` varchar(255) NOT NULL,
 `ordering` smallint(5) unsigned NOT NULL DEFAULT '0',
 `prefix` varchar(50) NOT NULL,
 `suffix` varchar(50) NOT NULL,
 `extstid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `fields` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `checkout` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `trash` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `audit` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `totalcustom` smallint(5) unsigned NOT NULL DEFAULT '0',
 `reload` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `faicon` varchar(50) NOT NULL,
 `pnamekey` varchar(50) NOT NULL,
 `import` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `export` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `outgoing` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `incoming` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`sid`),
 UNIQUE KEY `UK_model_node_namekey` (`namekey`(100)),
 KEY `IX_model_node_publish_prefix_level` (`publish`,`prefix`,`level`),
 KEY `IX_model_node_dbtid` (`dbtid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
UPDATE `#__model_node` SET `pnamekey` = 'translation.en' WHERE `namekey` LIKE ( 'translation.%' ) AND `namekey` NOT IN ( 'translation.en', 'translation.reference', 'translation.populate' );


CREATE TABLE IF NOT EXISTS `#__fields_trans` (
 `fieldid` int(10) unsigned NOT NULL,
 `lgid` int(10) unsigned NOT NULL,
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`fieldid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__dropset_node` (
 `did` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
 `namekey` varchar(50) NOT NULL,
 `map` varchar(20) NOT NULL,
 `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `outype` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `wid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `ref_sid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `first_value` int(10) unsigned NOT NULL DEFAULT '0',
 `first_all` tinyint(4) NOT NULL DEFAULT '0',
 `lib_ext` tinyint(4) NOT NULL DEFAULT '0',
 `external` varchar(60) NOT NULL,
 `first_caption` varchar(50) NOT NULL,
 `core` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `publish` tinyint(4) NOT NULL DEFAULT '1',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `params` text NOT NULL,
 `mon` tinyint(4) NOT NULL DEFAULT '0',
 `sid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `level` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `reload` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `parent` varchar(50) NOT NULL,
 `isparent` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `allowothers` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `colorstyle` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `alias` varchar(100) NOT NULL,
 PRIMARY KEY (`did`),
 UNIQUE KEY `UK_dropset_node_namekey` (`namekey`),
 KEY `IX_dropset_node_wid_publish_level_rolid` (`publish`,`wid`,`level`,`rolid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__dataset_columns` (
 `dbcid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `dbtid` int(10) unsigned NOT NULL DEFAULT '0',
 `name` varchar(50) NOT NULL,
 `description` text NOT NULL,
 `pkey` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `checkval` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `type` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `attributes` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `mandatory` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `default` varchar(50) NOT NULL,
 `ordering` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `level` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `extra` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `size` decimal(8,1) NOT NULL DEFAULT '0.0',
 `export` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `namekey` varchar(50) NOT NULL,
 `core` tinyint(4) NOT NULL DEFAULT '1',
 `columntype` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `indexed` tinyint(4) NOT NULL DEFAULT '0',
 `noaudit` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `readable` varchar(100) NOT NULL,
 `fieldtype` varchar(50) NOT NULL,
 PRIMARY KEY (`dbcid`),
 UNIQUE KEY `UK_dataset_columns_namekey` (`namekey`),
 UNIQUE KEY `UK_dataset_columns_dbtid_name` (`name`,`dbtid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__dropset_trans` (
 `did` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
 `lgid` tinyint(3) unsigned NOT NULL,
 `name` varchar(100) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`did`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__model_fields` (
 `fdid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `namekey` varchar(150) NOT NULL,
 `fieldid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `sid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `searchable` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `rolid_edit` smallint(5) unsigned NOT NULL DEFAULT '1',
 `params` text NOT NULL,
 `initialvalue` varchar(255) NOT NULL,
 `column` varchar(100) NOT NULL,
 `required` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `ordering` smallint(5) unsigned NOT NULL DEFAULT '999',
 `updateall` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `dbcid` int(10) unsigned NOT NULL DEFAULT '0',
 `translate` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `advsearchable` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `sorting` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`fdid`),
 UNIQUE KEY `UK_namekey_model_fields` (`namekey`),
 KEY `IX_model_fields_publish_rolid` (`publish`,`rolid`),
 KEY `IX_model_fields_sid` (`sid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__dropset_valuestrans` (
 `vid` int(10) unsigned NOT NULL,
 `name` varchar(255) NOT NULL,
 `lgid` tinyint(4) unsigned NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`vid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__model_fields_type` (
 `fdid` int(10) unsigned NOT NULL,
 `typeid` int(10) unsigned NOT NULL,
 PRIMARY KEY (`fdid`,`typeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__model_trans` (
 `sid` smallint(5) unsigned NOT NULL,
 `lgid` tinyint(4) unsigned NOT NULL,
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`sid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__fields_node` (
 `fieldid` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
 `namekey` varchar(150) NOT NULL,
 `alias` varchar(150) NOT NULL,
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `wid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `params` text NOT NULL,
 `listing` varchar(250) NOT NULL,
 `form` varchar(250) NOT NULL,
 `real` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `ordering` mediumint(8) unsigned NOT NULL DEFAULT '69',
 `category` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `visible` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `translate` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`fieldid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__model_fieldstrans` (
 `fdid` int(10) unsigned NOT NULL,
 `lgid` int(10) unsigned NOT NULL,
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`fdid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__layout_fields` (
 `yid` int(10) unsigned NOT NULL,
 `fdid` int(10) unsigned NOT NULL,
 `parent` int(10) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`yid`,`fdid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__dropset_values` (
 `vid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `did` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `ordering` smallint(5) unsigned NOT NULL DEFAULT '1',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `params` text NOT NULL,
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `level` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `rolid` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `value` varchar(100) NOT NULL,
 `valuetxt` varchar(50) NOT NULL,
 `premium` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `namekey` varchar(150) NOT NULL DEFAULT '',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `color` varchar(20) NOT NULL,
 `parent` varchar(100) NOT NULL,
 `inputbox` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`vid`),
 UNIQUE KEY `UK_dropset_values_did_value` (`value`,`did`),
 UNIQUE KEY `UK_dropset_values_namekey` (`namekey`),
 KEY `IX_dropset_values_did_publish_rolid_ordering` (`did`,`publish`,`rolid`,`ordering`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__dataset_foreign` (
 `fkid` smallint(5) NOT NULL AUTO_INCREMENT,
 `dbtid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `ref_dbtid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `ondelete` tinyint(3) unsigned NOT NULL DEFAULT '3',
 `feid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `ref_feid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `namekey` varchar(100) NOT NULL,
 `publish` tinyint(4) NOT NULL DEFAULT '1',
 `map` varchar(50) NOT NULL,
 `map2` varchar(50) NOT NULL,
 `onupdate` tinyint(3) unsigned NOT NULL DEFAULT '3',
 `ordering` tinyint(3) unsigned NOT NULL DEFAULT '99',
 PRIMARY KEY (`fkid`),
 UNIQUE KEY `UK_dataset_foreign_feid_dbtid_red_dbtid` (`feid`,`dbtid`,`ref_dbtid`),
 KEY `IX_dataset_foreign_publish_ref_feid` (`ref_feid`,`publish`),
 KEY `IX_dataset_foreign_dbtid_onupdate_ondelete` (`dbtid`,`onupdate`,`ondelete`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__dataset_tables` (
 `dbtid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
 `dbid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `name` varchar(255) NOT NULL,
 `namekey` varchar(100) NOT NULL,
 `size` decimal(14,0) unsigned NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `rows` int(10) unsigned NOT NULL DEFAULT '0',
 `rows_average_length` decimal(8,0) unsigned NOT NULL DEFAULT '0',
 `data_length` decimal(14,0) unsigned NOT NULL DEFAULT '0',
 `prefix` varchar(255) NOT NULL,
 `version` varchar(50) NOT NULL,
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `level` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `pkey` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `suffix` varchar(255) NOT NULL,
 `group` varchar(255) NOT NULL,
 `domain` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `export` tinyint(3) unsigned NOT NULL DEFAULT '2',
 `exportdelete` tinyint(4) NOT NULL DEFAULT '0',
 `noaudit` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `engine` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`dbtid`),
 UNIQUE KEY `UK_dataset_tables_namekey` (`namekey`),
 UNIQUE KEY `UK_dataset_tables_dbid_name` (`dbid`,`name`(50)),
 KEY `IX_dataset_tables_rolid` (`rolid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__language_node` (
 `lgid` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
 `code` char(10) NOT NULL,
 `name` varchar(100) NOT NULL,
 `main` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `real` varchar(100) NOT NULL,
 `premium` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `rtl` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `availsite` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `availadmin` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `localeconv` text NOT NULL,
 `locale` varchar(255) NOT NULL,
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `automatic` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`lgid`),
 UNIQUE KEY `UK_languages_code` (`code`),
 KEY `IX_languages_main_publish_availadmin_availsite` (`main`,`publish`,`availadmin`,`availsite`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__layout_dropset` (
 `did` mediumint(8) unsigned NOT NULL,
 `yid` mediumint(8) unsigned NOT NULL,
 `ordering` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`did`,`yid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__filters_node` (
 `flid` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
 `bktbefore` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `sid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `map` varchar(20) NOT NULL,
 `condopr` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `bktafter` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `logicopr` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `level` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `params` text NOT NULL,
 `refmap` varchar(30) NOT NULL,
 `ref_sid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `typea` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `typeb` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `namekey` varchar(100) NOT NULL,
 `name` varchar(40) NOT NULL,
 `yid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `ordering` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `requiresvalue` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `requirednode` varchar(100) NOT NULL,
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `isadmin` tinyint(4) NOT NULL DEFAULT '0',
 PRIMARY KEY (`flid`),
 UNIQUE KEY `UK_filters_node_namekey` (`namekey`),
 KEY `IX_filters_node_yid_publish_ordering_level` (`yid`,`ordering`,`publish`,`level`),
 KEY `IX_filters_node_sid` (`sid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__translation_reference` (
 `wid` mediumint(8) unsigned NOT NULL,
 `load` tinyint(4) NOT NULL DEFAULT '0',
 `imac` varchar(255) NOT NULL,
 PRIMARY KEY (`wid`,`imac`(20))
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__dataset_constraints` (
 `ctid` mediumint(5) unsigned NOT NULL AUTO_INCREMENT,
 `dbtid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `namekey` varchar(255) NOT NULL,
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`ctid`),
 UNIQUE KEY `UK_dataset_constraints_namekey` (`namekey`(100)),
 KEY `IX_dataset_constraints_dbtid_type` (`dbtid`,`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__translation_en` (
 `imac` varchar(20) NOT NULL,
 `text` text NOT NULL,
 `auto` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `nbchars` int(10) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`imac`),
 KEY `ix_translation_en_nbchars` (`nbchars`),
 FULLTEXT KEY `FTXT_translation_en_text` (`text`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__dataset_constraintsitems` (
 `ctid` mediumint(5) unsigned NOT NULL,
 `dbcid` smallint(5) unsigned NOT NULL,
 `ordering` tinyint(3) unsigned NOT NULL DEFAULT '5',
 `sort` tinyint(4) NOT NULL DEFAULT '0',
 PRIMARY KEY (`dbcid`,`ctid`),
 KEY `IX_dataset_constraintsitems_ordering` (`ordering`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__file_node` (
 `filid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `name` varchar(254) NOT NULL,
 `path` varchar(255) NOT NULL,
 `type` varchar(20) NOT NULL,
 `md5` varchar(40) NOT NULL DEFAULT '',
 `secure` tinyint(4) NOT NULL DEFAULT '0',
 `thumbnail` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `size` int(10) unsigned NOT NULL DEFAULT '0',
 `width` smallint(6) NOT NULL DEFAULT '0',
 `height` smallint(5) unsigned NOT NULL DEFAULT '0',
 `twidth` smallint(5) unsigned NOT NULL DEFAULT '0',
 `theight` smallint(5) unsigned NOT NULL DEFAULT '0',
 `mime` varchar(40) NOT NULL,
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `modifiedby` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `params` text NOT NULL,
 `alias` varchar(255) NOT NULL,
 `vendid` int(10) unsigned NOT NULL DEFAULT '1',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `storage` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `folder` varchar(254) NOT NULL,
 PRIMARY KEY (`filid`),
 KEY `IX_file_node_path_type_name` (`path`(50),`type`(5),`name`(100)) 
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__translation_populate` (
 `dbcid` int(10) unsigned NOT NULL,
 `eid` int(10) unsigned NOT NULL,
 `imac` varchar(50) NOT NULL,
 `wid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`dbcid`,`eid`),
 KEY `IX_translation_populate_wid` (`wid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__role_node` (
 `rolid` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
 `parent` smallint(5) unsigned NOT NULL DEFAULT '0',
 `lft` smallint(5) unsigned NOT NULL DEFAULT '0',
 `rgt` smallint(5) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `joomla` smallint(5) unsigned NOT NULL DEFAULT '0',
 `j16` int(10) unsigned NOT NULL DEFAULT '1',
 `namekey` varchar(50) NOT NULL DEFAULT '',
 `color` varchar(20) NOT NULL DEFAULT 'black',
 `type` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `depth` smallint(5) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`rolid`),
 UNIQUE KEY `UK_role_node_namekey` (`namekey`),
 KEY `IX_role_node_lft` (`lft`),
 KEY `IX_role_node_rgt` (`rgt`),
 KEY `IX_role_node_type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__role_trans` (
 `rolid` smallint(5) unsigned NOT NULL,
 `lgid` smallint(5) unsigned NOT NULL,
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`rolid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__role_members` (
 `rolid` int(10) unsigned NOT NULL,
 `uid` int(10) unsigned NOT NULL,
 PRIMARY KEY (`uid`,`rolid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__role_joomlacategories` (
 `id` int(11) NOT NULL,
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `introrolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `comment` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`id`,`rolid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__role_joomlacontent` (
 `id` int(11) NOT NULL,
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `introrolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `comment` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `rating_sum` smallint(5) unsigned NOT NULL DEFAULT '0',
 `rating_num` smallint(5) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`id`,`rolid`,`comment`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__tour_members` (
 `trid` int(10) unsigned NOT NULL DEFAULT '0',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `status` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `step` smallint(5) unsigned NOT NULL DEFAULT '1',
 `yid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`trid`,`yid`,`uid`),
 KEY `IX_tour_members_trid_uid` (`trid`,`uid`),
 KEY `IX_tour_members_yid_uid` (`yid`,`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__tour_node` (
 `trid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `namekey` varchar(150) NOT NULL,
 `alias` varchar(150) NOT NULL,
 `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `modifiedby` int(10) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `wid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `isadmin` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`trid`),
 UNIQUE KEY `UK_tour_node_namekey` (`namekey`),
 KEY `IX_tour_node_rolid_isadmin_publish_core` (`rolid`,`isadmin`,`publish`,`core`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__tour_step_trans` (
 `trstid` int(10) unsigned NOT NULL DEFAULT '0',
 `lgid` int(10) unsigned NOT NULL DEFAULT '0',
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(255) NOT NULL DEFAULT '2',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`trstid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__tour_step` (
 `trstid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `trid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `ordering` smallint(5) unsigned NOT NULL DEFAULT '1',
 `onnext` varchar(250) NOT NULL,
 `namekey` varchar(70) NOT NULL,
 `target` varchar(150) NOT NULL,
 PRIMARY KEY (`trstid`),
 KEY `IX_tour_step_trid_publish` (`trid`,`publish`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__tour_trans` (
 `trid` int(10) unsigned NOT NULL DEFAULT '0',
 `lgid` int(10) unsigned NOT NULL DEFAULT '0',
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(255) NOT NULL DEFAULT '2',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`trid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__theme_node` (
 `tmid` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
 `type` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `namekey` varchar(255) NOT NULL,
 `publish` tinyint(4) NOT NULL DEFAULT '1',
 `premium` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(3) NOT NULL DEFAULT '0',
 `wid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `alias` varchar(255) NOT NULL,
 `filid` int(10) unsigned NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `availability` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `folder` varchar(100) NOT NULL,
 `params` text NOT NULL,
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `ordering` smallint(5) unsigned NOT NULL DEFAULT '999',
 `framework` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`tmid`),
 UNIQUE KEY `UK_theme_node_namekey` (`namekey`(100)),
 KEY `IX_theme_node_type_publish_framework_core_premium` (`type`,`publish`,`framework`,`core`,`premium`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__theme_trans` (
 `tmid` smallint(6) NOT NULL,
 `lgid` tinyint(4) unsigned NOT NULL,
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(4) NOT NULL DEFAULT '1',
 `fromlgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`tmid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__members_type` (
 `utypid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `namekey` varchar(150) NOT NULL,
 `alias` varchar(150) NOT NULL,
 `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '1',
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `modifiedby` int(10) unsigned NOT NULL DEFAULT '0',
 `core` tinyint(4) NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `ordering` smallint(5) unsigned NOT NULL DEFAULT '1',
 `params` text NOT NULL,
 `predefined` text NOT NULL,
 `color` varchar(10) NOT NULL,
 `filid` int(10) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`utypid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__members_type_trans` (
 `utypid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `lgid` int(10) unsigned NOT NULL DEFAULT '0',
 `name` varchar(255) NOT NULL,
 `description` text NOT NULL,
 `auto` tinyint(255) NOT NULL DEFAULT '2',
 `fromlgid` tinyint(3) unsigned DEFAULT '0',
 PRIMARY KEY (`utypid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__members_lang` (
 `uid` int(10) unsigned NOT NULL,
 `lgid` tinyint(3) unsigned NOT NULL DEFAULT '1',
 `ordering` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`uid`,`lgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__audit_fields` (
 `auditfldid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `dbcid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `sid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `eid` int(10) unsigned NOT NULL DEFAULT '0',
 `before_value_string` varchar(255) NOT NULL,
 `after_value_string` varchar(255) NOT NULL,
 `before_value_text` text NOT NULL,
 `after_value_text` text NOT NULL,
 PRIMARY KEY (`auditfldid`),
 KEY `IK_audit_fields_uid_created` (`uid`,`created`),
 KEY `IK_audit_fields_sid_created` (`sid`,`created`)
) ENGINE=InnoDB /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci*/;

CREATE TABLE IF NOT EXISTS `#__audit_badwords` (
 `adbdwdid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `alias` varchar(150) NOT NULL,
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `lgid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`adbdwdid`),
 UNIQUE KEY `UK_audit_badwords_lgid_alias` (`lgid`,`alias`),
 KEY `IX_audit_badwords_publish` (`publish`)
) ENGINE=InnoDB /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci*/;

CREATE TABLE IF NOT EXISTS `#__audit_node` (
 `auditid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `dbtid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `sid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `eid` int(10) unsigned NOT NULL DEFAULT '0',
 `before_text` text NOT NULL,
 `after_text` text NOT NULL,
 `namekeyvalue` varchar(254) NOT NULL,
 `action` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`auditid`),
 KEY `IX_audit_node_uid_created` (`created`,`uid`),
 KEY `IX_audit_node_sid_created` (`sid`,`created`)
) ENGINE=InnoDB /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci*/;

CREATE TABLE IF NOT EXISTS `#__activity_pages` (
 `actpgid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `actid` int(10) unsigned NOT NULL DEFAULT '0',
 `pagetile` varchar(100) NOT NULL,
 `pageurl` varchar(254) NOT NULL,
 `ctrid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `wid` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `controller` varchar(200) NOT NULL,
 `task` varchar(200) NOT NULL,
 `eid` int(10) unsigned NOT NULL DEFAULT '0',
 `request` text NOT NULL,
 `login` tinyint(3) unsigned NOT NULL DEFAULT '5',
 PRIMARY KEY (`actpgid`),
 KEY `IX_activity_pages_created` (`created`),
 KEY `IX_activity_pages_actid` (`actid`)
) ENGINE=InnoDB /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci*/;

CREATE TABLE IF NOT EXISTS `#__activity_incident` (
 `incdtid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `url` varchar(255) NOT NULL,
 `actid` int(10) unsigned NOT NULL DEFAULT '0',
 `ip` double unsigned NOT NULL DEFAULT '0',
 `details` text NOT NULL,
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `alias` varchar(255) NOT NULL,
 `publish` tinyint(4) NOT NULL DEFAULT '1',
 `severity` tinyint(4) NOT NULL DEFAULT '0',
 PRIMARY KEY (`incdtid`),
 KEY `IX_activity_incident_created` (`created`),
 KEY `IX_activity_incident_uid` (`uid`),
 KEY `IX_activity_incident_ip` (`ip`)
) ENGINE=InnoDB /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci*/;

CREATE TABLE IF NOT EXISTS `#__ip_blocked` (
 `ipblid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `uid` int(10) unsigned NOT NULL DEFAULT '0',
 `publish` tinyint(4) NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '0',
 `ip` double unsigned NOT NULL DEFAULT '0',
 `modified` int(10) unsigned NOT NULL DEFAULT '0',
 `startdate` int(10) unsigned NOT NULL DEFAULT '0',
 `enddate` int(10) unsigned NOT NULL DEFAULT '0',
 `reason` text NOT NULL,
 `space` smallint(5) unsigned NOT NULL DEFAULT '0',
 `attempt` int(10) unsigned NOT NULL DEFAULT '0',
 `ctyid` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `status` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `reasontype` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `username` varchar(254) NOT NULL,
 `rolid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `message` text NOT NULL,
 `blockedpage` tinyint(3) unsigned NOT NULL DEFAULT '0',
 PRIMARY KEY (`ipblid`),
 KEY `IX_ip_blocked_ip` (`ip`),
 KEY `IX_ip_blocked_username` (`username`),
 KEY `IX_ip_blocked_ctyid` (`ctyid`),
 KEY `IX_ip_blocked_rolid` (`rolid`)
) ENGINE=InnoDB /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci*/;

CREATE TABLE IF NOT EXISTS `#__ip_node` (
 `ipid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `from` double unsigned NOT NULL DEFAULT '0',
 `to` double unsigned NOT NULL DEFAULT '0',
 `ctyid` smallint(5) unsigned NOT NULL DEFAULT '0',
 `created` int(10) unsigned NOT NULL DEFAULT '1456900000',
 PRIMARY KEY (`ipid`),
 KEY `IX_ip_node_to_from` (`to`,`from`)
) ENGINE=InnoDB /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci*/;

CREATE TABLE IF NOT EXISTS `#__ip_blocked_pages` (
 `ipblpgid` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `ipblid` int(10) unsigned NOT NULL DEFAULT '0',
 `page` varchar(254) NOT NULL,
 PRIMARY KEY (`ipblpgid`)
) ENGINE=InnoDB /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci*/;