						CREATE TABLE IF NOT EXISTS `#__assignments` (
						  `id` int(11) NOT NULL auto_increment,
						  `access_type` varchar(60) NOT NULL,
						  `access_id` text NOT NULL,
						  `role` varchar(60) NOT NULL,
						  PRIMARY KEY  (`id`),
						  KEY `access_type` (`access_type`,`access_id`(60),`role`)
						) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

						CREATE TABLE IF NOT EXISTS `#__downloads_blob` (
						  `id` int NOT NULL auto_increment,
						  `fileid` int NOT NULL default 0,
						  `chunkid` int NOT NULL default 0,
						  `bloblength` int NOT NULL default 0,
						  `datachunk` mediumblob NOT NULL,
							UNIQUE KEY `id` (`id`),
							UNIQUE KEY `filechunk` (`fileid`,`chunkid`),
							KEY `size` (`fileid`,`bloblength`)
						) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

						CREATE TABLE IF NOT EXISTS `#__downloads_classify` (
						  `id` int(11) NOT NULL auto_increment,
						  `sequence` int(11) NOT NULL default '0',
  						  `windowtitle` varchar(255) NOT NULL default '',
						  `keywords` varchar(255) NOT NULL default '',
						  `frequency` int(11) NOT NULL default '0',
						  `published` tinyint(3) unsigned NOT NULL default '0',
						  `hidden` tinyint(3) unsigned NOT NULL default '0',
						  `type` varchar(30) NOT NULL,
						  `name` varchar(100) NOT NULL,
						  `description` text NOT NULL,
						  PRIMARY KEY  (`id`)
						) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

						CREATE TABLE IF NOT EXISTS `#__downloads_file_classify` (
						  `file_id` int(11) NOT NULL default '0',
						  `classify_id` int(11) NOT NULL default '0',
						  PRIMARY KEY  (`file_id`,`classify_id`)
						) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

						CREATE TABLE IF NOT EXISTS `#__downloads_containers` (
						  `id` int(255) NOT NULL auto_increment,
						  `sequence` int(11) NOT NULL default '0',
						  `windowtitle` varchar(255) NOT NULL default '',
						  `keywords` varchar(255) NOT NULL default '',
						  `parentid` smallint(255) NOT NULL default '0',
						  `name` varchar(255) NOT NULL default '',
						  `alias` varchar(255) NOT NULL default '',
						  `filepath` varchar(255) NOT NULL default '',
						  `published` tinyint(1) NOT NULL default '1',
						  `description` text NOT NULL,
						  `filecount` smallint(6) NOT NULL default '0',
						  `foldercount` smallint(6) NOT NULL default '0',
						  `icon` varchar(50) NOT NULL default '',
						  `registered` tinyint(3) unsigned NOT NULL default '2',
						  `userupload` tinyint(3) unsigned NOT NULL default '3',
						  `plaintext` tinyint(3) unsigned NOT NULL default '0',
						  `groupid` smallint(6) NOT NULL default '0',
						  `editgroup` smallint(6) NOT NULL default '0',
						  `adminauto` tinyint(3) unsigned NOT NULL default '0',
						  `userauto` tinyint(3) unsigned NOT NULL default '0',
						  `autogroup` smallint(6) NOT NULL default '0',
						  `userid` int(11) NOT NULL default '0',
						  UNIQUE KEY `id` (`id`),
						  KEY `parentid` (`parentid`,`published`)
						) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

						CREATE TABLE IF NOT EXISTS `#__downloads_credits` (
						  `id` int(11) NOT NULL auto_increment,
						  `userid` int(11) NOT NULL default '0',
						  `credits` int(11) NOT NULL default '0',
						  PRIMARY KEY						  (`id`),
						  UNIQUE KEY `userid` (`userid`)
						) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

						CREATE TABLE IF NOT EXISTS `#__downloads_email` (
						  `id` int(11) NOT NULL auto_increment,
						  `userid` int(11) NOT NULL default '0',
						  `ipaddress` varchar(15) NOT NULL,
						  `role` varchar(60) NOT NULL,
						  `email` varchar(255) NOT NULL,
						  `stamp` datetime NOT NULL,
						  `uniqid` char(32) NOT NULL,
						  PRIMARY KEY						  (`id`),
						  UNIQUE KEY `uniqid` (`uniqid`)
						) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

						CREATE TABLE IF NOT EXISTS `#__downloads_files` (
						  `id` int(11) NOT NULL auto_increment,
						  `sequence` int(11) NOT NULL default '0',
						  `windowtitle` varchar(255) NOT NULL default '',
						  `keywords` varchar(255) NOT NULL default '',
						  `metatype` smallint(6) NOT NULL default '0',
						  `realname` varchar(255) NOT NULL default '',
						  `realwithid` tinyint(3) unsigned NOT NULL default '0',
						  `islocal` tinyint(3) unsigned NOT NULL default '1',
						  `containerid` smallint(6) NOT NULL default '0',
						  `userid` int(11) NOT NULL default '0',
						  `filepath` varchar(255) NOT NULL default '',
						  `filesize` varchar(255) NOT NULL default '',
						  `filetype` varchar(255) NOT NULL default '',
						  `filetitle` varchar(255) NOT NULL default '',
						  `subtitle` text NOT NULL,
						  `description` text NOT NULL,
						  `smalldesc` text NOT NULL,
						  `autoshort` tinyint(3) unsigned NOT NULL default '1',
						  `license` text NOT NULL,
						  `licenseagree` tinyint(3) unsigned NOT NULL default '0',
						  `price` int(11) NOT NULL default '0',
						  `currency` char(3) NOT NULL default '',
						  `downloads` int(11) NOT NULL default '0',
						  `url` varchar(255) NOT NULL default '',
						  `icon` varchar(50) NOT NULL default '',
						  `published` tinyint(3) unsigned NOT NULL default '1',
						  `registered` tinyint(3) unsigned NOT NULL default '2',
						  `userupload` tinyint(3) unsigned NOT NULL default '3',
						  `download_text` text NOT NULL,
						  `recommended` tinyint(3) unsigned NOT NULL default '0',
						  `recommend_text` text NOT NULL,
						  `featured` tinyint(4) NOT NULL default '0',
						  `featured_st_date` date NOT NULL default '0000-00-00',
						  `featured_end_date` date NOT NULL default '0000-00-00',
						  `featured_priority` smallint(6) NOT NULL default '0',
						  `featured_seq` smallint(6) NOT NULL default '0',
						  `featured_text` text NOT NULL,
						  `opsystem` varchar(50) NOT NULL default '',
						  `legaltype` varchar(50) NOT NULL default '',
						  `requirements` text NOT NULL,
						  `company` varchar(255) NOT NULL default '',
						  `releasedate` date NOT NULL default '0000-00-00',
						  `languages` text NOT NULL,
						  `company_URL` varchar(255) NOT NULL default '',
						  `translator` varchar(255) NOT NULL default '',
						  `fileversion` varchar(50) NOT NULL default '',
						  `fileauthor` varchar(100) NOT NULL default '',
						  `author_URL` varchar(255) NOT NULL default '',
						  `publish_id` varchar(50) NOT NULL default '',
						  `publish_date` date NOT NULL default '0000-00-00',
						  `filedate` datetime NOT NULL default '0000-00-00 00:00:00',
						  `filehomepage` varchar(255) NOT NULL default '',
						  `screenurl` varchar(255) NOT NULL default '',
						  `plaintext` tinyint(3) unsigned NOT NULL default '0',
						  `isblob` tinyint(3) unsigned NOT NULL default '0',
						  `chunkcount` int(11) NOT NULL default '0',
						  `groupid` smallint(6) NOT NULL default '0',
						  `editgroup` smallint(6) NOT NULL default '0',
						  `custom_1` varchar(255) NOT NULL default '',
						  `custom_2` varchar(255) NOT NULL default '',
						  `custom_3` text NOT NULL,
						  `custom_4` int(11) NOT NULL default '0',
						  `custom_5` datetime NOT NULL default '0000-00-00 00:00:00',
						  `oldid` int(11) NOT NULL default '0',
						  `submittedby` mediumint(9) NOT NULL default '0',
						  `submitdate` datetime NOT NULL default '0000-00-00 00:00:00',
						  `custom_values` text NOT NULL default '',
						  UNIQUE KEY `id` (`id`),
						  KEY `filetitle` (`filetitle`),
						  KEY `url` (`url`),
						  KEY `containerid` (`containerid`,`published`),
						  KEY `recommended` (`containerid`,`recommended`,`published`),
						  KEY `featured` (`containerid`,`featured`,`published`,`featured_st_date`,`featured_end_date`),
						  KEY `opsystem` (`containerid`,`opsystem`,`published`),
						  FULLTEXT KEY `words` (`filetitle`,`description`,`smalldesc`,`fileauthor`)
						) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

						CREATE TABLE IF NOT EXISTS `#__downloads_log` (
						  `id` int NOT NULL auto_increment,
						  `type` tinyint unsigned NOT NULL default 0,
						  `date` datetime NOT NULL default '0000-00-00',
						  `userid` mediumint NOT NULL default 0,
						  `fileid` int NOT NULL default 0,
						  `value` int NOT NULL default 0,
						  `price` int NOT NULL default 0,
						  `ipaddress` char (15) NOT NULL default '',
							UNIQUE KEY `id` (`id`),
							KEY `userid` (`type`,`userid`),
							KEY `fileid` (`type`,`fileid`),
							KEY `ipaddress` (`type`,`ipaddress`,`date`)
							) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

						CREATE TABLE IF NOT EXISTS `#__permissions` (
						  `id` int(11) NOT NULL auto_increment,
						  `role` varchar(60) NOT NULL,
						  `control` tinyint(3) unsigned NOT NULL default '0',
						  `action` varchar(60) NOT NULL,
						  `subject_type` varchar(60) NOT NULL,
						  `subject_id` text NOT NULL,
						  `system` smallint(5) unsigned NOT NULL default '0',
						  PRIMARY KEY  (`id`),
						  KEY `role_type` (`role`,`action`,`subject_type`,`subject_id`(60)),
						  KEY `subaction` (`subject_type`,`action`,`subject_id`(60))
						) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

						 CREATE TABLE IF NOT EXISTS `#__downloads_repository` (
						  `id` int(11) NOT NULL auto_increment,
						  `name` varchar(255) NOT NULL default '',
						  `alias` varchar(255) NOT NULL default '',
						  `sequence` int(11) NOT NULL default '0',
						  `windowtitle` varchar(255) NOT NULL default '',
						  `keywords` varchar(255) NOT NULL default '',
						  `version` char(10) NOT NULL default '',
						  `Use_Database` smallint(6) NOT NULL default '1',
						  `Main_Page_Title` varchar(100) NOT NULL default '',
						  `tabclass` varchar(255) NOT NULL default 'sectiontableentry2,sectiontableentry1',
						  `tabheader` varchar(255) NOT NULL default 'sectiontableheader',
						  `headerpic` varchar(255) NOT NULL default '$mosConfig_live_site/components/com_remository/images/header.gif',
						  `ExtsOk` varchar(255) NOT NULL default 'txt,exe,tar,gz,rar,zip,png,gif,jpg,pdf,doc',
						  `ExtsDisplay` varchar(255) NOT NULL default '',
						  `ExtsAudio` varchar(255) NOT NULL default '',
						  `ExtsVideo` varchar(255) NOT NULL default '',
						  `Classification_Types` varchar(255) NOT NULL default '',
						  `Scribd` varchar(30) NOT NULL default '',
						  `Down_Path` varchar(255) NOT NULL default '$mosConfig_absolute_path/components/com_remository/downloads',
						  `Up_Path` varchar(255) NOT NULL default '$mosConfig_absolute_path/components/com_remository/uploads',
						  `Large_Text_Len` int(11) NOT NULL default '500',
						  `Small_Text_Len` smallint(6) NOT NULL default '150',
						  `Small_Image_Width` smallint(6) NOT NULL default '100',
						  `Small_Image_Height` smallint(6) NOT NULL default '100',
						  `Large_Image_Width` smallint(6) NOT NULL default '600',
						  `Large_Image_Height` smallint(6) NOT NULL default '600',
						  `MaxSize` int(11) NOT NULL default '5000',
						  `Max_Up_Per_Day` smallint(6) NOT NULL default '5',
						  `Max_Down_Per_Day` smallint(6) NOT NULL default '5',
						  `Max_Down_Reg_Day` smallint(6) NOT NULL default '10',
						  `Max_Down_File_Day` smallint(6) NOT NULL default '2',
						  `Count_Down` tinyint(3) unsigned NOT NULL default '0',
						  `Featured_Number` int(11) unsigned NOT NULL default '0',
						  `Max_Up_Dir_Space` int(11) NOT NULL default '50000',
						  `Favourites_Max` smallint(6) NOT NULL default '5',
						  `Max_Thumbnails` smallint(6) NOT NULL default '0',
						  `Min_Comment_length` smallint(6) NOT NULL default '1',
						  `Make_Auto_Thumbnail` tinyint(3) unsigned NOT NULL default '0',
						  `Default_Version` char(20) NOT NULL default '',
						  `Main_Authors` text NOT NULL,
						  `Author_Threshold` smallint(6) NOT NULL default '0',
						  `Date_Format` char(20) NOT NULL default '',
						  `Set_date_locale` varchar(20) NOT NULL,
						  `Force_Language` varchar(20) NOT NULL,
						  `Show_all_containers` tinyint(3) unsigned NOT NULL default '0',
						  `Anti_Leach` tinyint(3) unsigned NOT NULL default '0',
						  `Allow_Up_Overwrite` tinyint(3) unsigned NOT NULL default '1',
						  `Allow_User_Sub` tinyint(3) unsigned NOT NULL default '1',
						  `Allow_User_Edit` tinyint(3) unsigned NOT NULL default '1',
						  `Allow_User_Delete` tinyint(3) unsigned NOT NULL default '0',
						  `Allow_User_Up` tinyint(3) unsigned NOT NULL default '1',
						  `Enable_Admin_Autoapp` tinyint(3) unsigned NOT NULL default '1',
						  `Enable_User_Autoapp` tinyint(3) unsigned NOT NULL default '0',
						  `Allow_Comments` tinyint(3) unsigned NOT NULL default '1',
						  `Allow_Votes` tinyint(3) unsigned NOT NULL default '1',
						  `Download_Browser_Save` tinyint(3) unsigned NOT NULL default '0',
						  `Allow_Large_Images` tinyint(3) unsigned NOT NULL default '1',
						  `Activate_AEC` tinyint(3) unsigned NOT NULL default '0',
						  `Remository_Pathway` tinyint(3) unsigned NOT NULL default '0',
						  `Enable_List_Download` tinyint(3) unsigned NOT NULL default '0',
						  `Audio_Download` tinyint(3) unsigned NOT NULL default '0',
						  `Video_Download` tinyint(3) unsigned NOT NULL default '0',
						  `User_Remote_Files` tinyint(3) unsigned NOT NULL default '0',
						  `See_Containers_no_download` tinyint(3) unsigned NOT NULL default '1',
						  `See_Files_no_download` tinyint(3) unsigned NOT NULL default '1',
						  `Show_RSS_feeds` tinyint(3) unsigned NOT NULL default '1',
						  `Allow_File_Info` tinyint(3) unsigned NOT NULL default '1',
						  `Show_Footer` tinyint(3) unsigned NOT NULL default '1',
						  `Show_File_Folder_Counts` tinyint(3) unsigned NOT NULL default '1',
						  `Send_Sub_Mail` tinyint(3) unsigned NOT NULL default '1',
						  `Sub_Mail_Alt_Addr` varchar(255) NOT NULL default '',
						  `Sub_Mail_Alt_Name` varchar(100) NOT NULL default '',
						  `Time_Stamp` varchar(15) NOT NULL default '1119386419',
						  `Profile_URI` varchar(255) NOT NULL,
						  `download_text` text NOT NULL,
						  `preamble` text NOT NULL,
						  `Default_Licence` text NOT NULL,
						  `customizer` text NOT NULL,
						  `custom_names` text NOT NULL,
						  `Cron_Timer` int(11) NOT NULL default '0',
						  `Real_With_ID` tinyint(3) unsigned NOT NULL default '1',
						  `Immediate_Download` tinyint(3) unsigned NOT NULL default '0',
						  `Use_CMS_Groups` tinyint(3) unsigned NOT NULL default '0',
						  `template` varchar(25) NOT NULL default 'default',
						  `Show_SubCategories` tinyint(3) unsigned NOT NULL default '0',
						  UNIQUE KEY `id` (`id`)
						) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

						CREATE TABLE IF NOT EXISTS `#__downloads_reviews` (
						  `id` int NOT NULL auto_increment,
						  `sequence` int NOT NULL default 0,
						  `windowtitle` varchar(255) NOT NULL default '',
						  `keywords` varchar(255) NOT NULL default '',
						  `component` varchar (255) NOT NULL default '',
						  `itemid` int NOT NULL default 0,
						  `userid` mediumint NOT NULL default 0,
						  `userURL` varchar(255) NOT NULL default '',
						  `title` varchar (255) NOT NULL default '',
						  `comment` text NOT NULL default '',
						  `fullreview` text NOT NULL default '',
						  `date` datetime NOT NULL default '0000-00-00',
						  UNIQUE KEY `id` (`id`),
						  KEY `userid` (`component`,`itemid`,`userid`)
						)  ENGINE=MyISAM  DEFAULT CHARSET=utf8;

						CREATE TABLE IF NOT EXISTS `#__downloads_text` (
						  `id` int NOT NULL auto_increment,
						  `fileid` int NOT NULL default 0,
						  `filetext` longtext NOT NULL,
						  UNIQUE KEY `id` (`id`),
						  KEY `fileid` (`fileid`),
						  FULLTEXT `words` (`filetext`)
						)  ENGINE=MyISAM  DEFAULT CHARSET=utf8;
