CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_module` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
	`abstract_class_helper_code` MEDIUMTEXT NOT NULL,
	`abstract_class_helper_header` TEXT NOT NULL,
	`add_abstract_class_helper` TINYINT(1) NOT NULL DEFAULT 0,
	`add_custom_abstract_class_helper_header` TINYINT(1) NOT NULL DEFAULT 0,
	`add_php_method_uninstall` TINYINT(1) NOT NULL DEFAULT 0,
	`add_php_postflight_install` TINYINT(1) NOT NULL DEFAULT 0,
	`add_php_postflight_update` TINYINT(1) NOT NULL DEFAULT 0,
	`add_php_preflight_install` TINYINT(1) NOT NULL DEFAULT 0,
	`add_php_preflight_uninstall` TINYINT(1) NOT NULL DEFAULT 0,
	`add_php_preflight_update` TINYINT(1) NOT NULL DEFAULT 0,
	`add_php_script_construct` TINYINT(1) NOT NULL DEFAULT 0,
	`add_sales_server` TINYINT(1) NOT NULL DEFAULT 0,
	`add_sql` TINYINT(1) NOT NULL DEFAULT 0,
	`add_sql_uninstall` TINYINT(1) NOT NULL DEFAULT 0,
	`add_update_server` TINYINT(1) NOT NULL DEFAULT 0,
	`addreadme` TINYINT(1) NOT NULL DEFAULT 0,
	`custom_get` TEXT NOT NULL,
	`default` TEXT NOT NULL,
	`description` TEXT NOT NULL,
	`fields` TEXT NOT NULL,
	`libraries` TEXT NOT NULL,
	`module_version` CHAR(64) NOT NULL DEFAULT '',
	`name` VARCHAR(255) NOT NULL DEFAULT '',
	`php_method_uninstall` MEDIUMTEXT NOT NULL,
	`php_postflight_install` MEDIUMTEXT NOT NULL,
	`php_postflight_update` MEDIUMTEXT NOT NULL,
	`php_preflight_install` MEDIUMTEXT NOT NULL,
	`php_preflight_uninstall` MEDIUMTEXT NOT NULL,
	`php_preflight_update` MEDIUMTEXT NOT NULL,
	`php_script_construct` MEDIUMTEXT NOT NULL,
	`readme` TEXT NOT NULL,
	`sales_server` INT(11) NOT NULL DEFAULT 0,
	`snippet_one` TEXT NOT NULL,
	`snippet_two` INT(11) NOT NULL DEFAULT 0,
	`sql` MEDIUMTEXT NOT NULL,
	`sql_uninstall` MEDIUMTEXT NOT NULL,
	`system_name` VARCHAR(255) NOT NULL DEFAULT '',
	`update_server` INT(11) NOT NULL DEFAULT 0,
	`update_server_target` TINYINT(1) NOT NULL DEFAULT 0,
	`update_server_url` VARCHAR(255) NOT NULL DEFAULT '',
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_system_name` (`system_name`),
	KEY `idx_add_sales_server` (`add_sales_server`),
	KEY `idx_add_php_preflight_uninstall` (`add_php_preflight_uninstall`),
	KEY `idx_add_php_postflight_install` (`add_php_postflight_install`),
	KEY `idx_add_php_postflight_update` (`add_php_postflight_update`),
	KEY `idx_add_php_method_uninstall` (`add_php_method_uninstall`),
	KEY `idx_add_sql` (`add_sql`),
	KEY `idx_add_sql_uninstall` (`add_sql_uninstall`),
	KEY `idx_addreadme` (`addreadme`),
	KEY `idx_add_php_script_construct` (`add_php_script_construct`),
	KEY `idx_add_update_server` (`add_update_server`),
	KEY `idx_update_server_target` (`update_server_target`),
	KEY `idx_add_php_preflight_install` (`add_php_preflight_install`),
	KEY `idx_add_php_preflight_update` (`add_php_preflight_update`),
	KEY `idx_name` (`name`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_module_updates` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
	`joomla_module` INT(11) NOT NULL DEFAULT 0,
	`version_update` TEXT NOT NULL,
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_joomla_module` (`joomla_module`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_module_files_folders_urls` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
	`addfiles` TEXT NOT NULL,
	`addfilesfullpath` TEXT NOT NULL,
	`addfolders` TEXT NOT NULL,
	`addfoldersfullpath` TEXT NOT NULL,
	`addurls` TEXT NOT NULL,
	`joomla_module` INT(11) NOT NULL DEFAULT 0,
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_joomla_module` (`joomla_module`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
