CREATE TABLE IF NOT EXISTS `widget_widgetpages` (
  `widgetId` int(11) NOT NULL,
  `pageId` int(11) NOT NULL,
  `type` enum( 'available', 'unavailable') NOT NULL DEFAULT 'available',
  KEY `widgetId` (`widgetId`),
  KEY `type` (`type`),
  KEY `pageId` (`pageId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `widget_widgets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `block` varchar(255) NOT NULL,
  `layout` varchar(255) NOT NULL,
  `template` varchar(255) NOT NULL,
  `view` varchar(255) NOT NULL,
  `order` int(11) NOT NULL DEFAULT '0',
  `available` enum('all','specific','only') NOT NULL DEFAULT 'all',
  `unavailable` enum( 'none','specific','only' ) NOT NULL DEFAULT 'none',
  `visibility` enum('all','anonymous','users','hide') NOT NULL DEFAULT 'all' ,
  PRIMARY KEY (`id`),
  KEY `block` (`block`),
  KEY `template` (`template`),
  KEY `order` (`order`),
  KEY `loyaut` (`layout`),
  KEY `available` (`available`),
  KEY `unavailable` (`unavailable`),
  KEY `visibility` ( `visibility` )
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `widget_widgets_i18n` (
  `id` int(11) NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `content` text NOT NULL,
  `image` varchar(1024) NOT NULL,
  `locale` varchar(5) NOT NULL DEFAULT 'en_US',
  KEY `id` (`id`),
  KEY `locale` (`locale`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;