DROP TABLE IF EXISTS `{pref}_media`;
DROP TABLE IF EXISTS `{pref}_media_categories`;
DROP TABLE IF EXISTS `{pref}_media_poolchec`;

  CREATE TABLE `{pref}_media` (
  `lid` int(11) NOT NULL auto_increment,
  `cid` int(11) NOT NULL default '0',
  `title` varchar(100) NOT NULL default '',
  `description` text NOT NULL,
  `url` varchar(100) NOT NULL default '',
  `date` datetime default NULL,
  `size` varchar(50) NOT NULL default '0',
  `roles` varchar(255) NOT NULL default '',
  `name` varchar(100) NOT NULL default '',
  `album` varchar(100) NOT NULL default '',
  `year` int(11) NOT NULL default '0',
  `lang` varchar(100) NOT NULL default '',
  `format` varchar(100) NOT NULL default '',
  `quality` varchar(100) NOT NULL default '',
  `links` text NOT NULL,
  `time` varchar(100) NOT NULL default '',
  `director` varchar(100) NOT NULL default '',
  `ip_sender` varchar(60) default NULL,
  `votes` int(11) NOT NULL default '0',
  `totalvotes` int(11) NOT NULL default '0',
  `totalcomments` int(11) NOT NULL default '0',
  `hits` int(11) NOT NULL default '0',
  `status` int(1) NOT NULL default '0',
  PRIMARY KEY  (`lid`),
  KEY `cid` (`cid`),
  KEY `title` (`title`)
) TYPE=MyISAM;

CREATE TABLE `{pref}_media_categories` (
  `cid` int(11) NOT NULL auto_increment,
  `title` varchar(50) NOT NULL default '',
  `cdescription` text NOT NULL,
  `cimg` varchar(100) NOT NULL default '',
  `parentid` int(11) NOT NULL default '0',
  PRIMARY KEY  (`cid`),
  KEY `title` (`title`)
) TYPE=MyISAM;

CREATE TABLE `{pref}_media_poolchec` (
  `lid` int(11) NOT NULL default '0',
  `time` varchar(14) NOT NULL default '',
  `host_addr` varchar(48) NOT NULL default '',
  PRIMARY KEY  (`time`)
) TYPE=MyISAM;
