CREATE TABLE `easy_cms_infos` (
  `version` varchar(15) NOT NULL default '',
  `released` date NOT NULL default '0000-00-00',
  `installed` date NOT NULL default '0000-00-00',
  `codename` varchar(255) NOT NULL default ''
);

CREATE TABLE `easy_cms_directories` (
  `id` int(11) NOT NULL default '0',
  `name_id` int(11) NOT NULL default '0',
  `parent_id` int(11) NOT NULL default '0',
  `deleted` tinyint(1) NOT NULL default '0',
  `acl_id` int(4) NOT NULL default '0',
	PRIMARY KEY (`id`)
);

CREATE TABLE `easy_cms_files` (
	`id` int(11) NOT NULL auto_increment,
	`name_id` int(11) NOT NULL,
	`creation_date` date NOT NULL,
	`user_id` int(4) NOT NULL,
	`directory_id` int(11) NOT NULL,
	`original_name` varchar(255) NOT NULL,
	`deleted` tinyint(1) NOT NULL,
	`acl_id` int(4) NOT NULL,
	PRIMARY KEY (`id`)
);

CREATE TABLE `easy_cms_acl` (
  `id` int(4) NOT NULL auto_increment,
  `deleted` tinyint(1) default '0',
  PRIMARY KEY  (`id`)
);

CREATE TABLE `easy_cms_acl_groups` (
  `acl_id` int(4) NOT NULL default '0',
  `group_id` int(4) NOT NULL default '0',
  `view` tinyint(1) default '0',
  `edit` tinyint(1) default '0',
  `publish` tinyint(1) default '0',
  `remove` tinyint(1) default '0',
  `admin` tinyint(1) default '0',
  PRIMARY KEY  (`acl_id`,`group_id`)
);

CREATE TABLE `easy_cms_acl_users` (
  `acl_id` int(4) NOT NULL default '0',
  `user_id` int(4) NOT NULL default '0',
  `view` tinyint(1) default '0',
  `edit` tinyint(1) default '0',
  `publish` tinyint(1) default '0',
  `remove` tinyint(1) default '0',
  `admin` tinyint(1) default '0',
  PRIMARY KEY  (`acl_id`,`user_id`)
);

CREATE TABLE `easy_cms_container_contents` (
  `container_id` int(11) NOT NULL default '0',
  `content_id` int(11) NOT NULL default '0',
  `index` int(11) default '0',
  PRIMARY KEY  (`container_id`,`content_id`)
);

CREATE TABLE `easy_cms_containers` (
  `id` int(11) NOT NULL auto_increment,
  `type` int(11) default '0',
  `repository` blob,
  `name_id` int(11) default '0',
  `type_name` varchar(255) NOT NULL,
  `template_id` int(11) default '0',
  `sorting_type` tinyint(4) NOT NULL default '1',
  `sort_field` varchar(255) NOT NULL,
  `sort_order` tinyint(4) NOT NULL default '1',
  `shown_from` int(11) default '0',
  `count_shown` int(11) default '0',
  `clone_id` int(11) default '0',
  `deleted` tinyint(1) default '0',
  `published` tinyint(1) default '0',
  `acl_id` int(11) NOT NULL default '1',
  PRIMARY KEY  (`id`)
);

CREATE TABLE `easy_cms_containers_lists` (
  `id` int(11) NOT NULL auto_increment,
  `sorting_type` tinyint(4) NOT NULL default '1',
  `sort_field` varchar(255) NOT NULL ,
  `sort_order` tinyint(4) NOT NULL default '1',
  `count_shown` int(11) default '0',
  `clone_id` int(11) default '0',
  `deleted` tinyint(1) default '0',
  `published` tinyint(1) default '0',
  `acl_id` int(11) NOT NULL default '1',
  PRIMARY KEY  (`id`)
);

CREATE TABLE `easy_cms_containers_lists_containers` (
  `containers_list_id` int(11) NOT NULL default '0',
  `container_id` int(11) NOT NULL default '0',
  `index` int(11) default '0',
  PRIMARY KEY  (`containers_list_id`,`container_id`)
);

CREATE TABLE `easy_cms_frame_containers` (
  `page_id` int(11) NOT NULL default '0',
  `frame_id` int(11) NOT NULL default '0',
  `container_name` varchar(255) NOT NULL ,
  `container_id` int(11) NOT NULL default '0',
  PRIMARY KEY  (`frame_id`,`container_name`,`container_id`,`page_id`)
);

CREATE TABLE `easy_cms_frame_containers_lists` (
  `page_id` int(11) NOT NULL default '0',
  `frame_id` int(11) NOT NULL default '0',
  `containers_list_id` int(11) NOT NULL default '0',
  `containers_list_name` varchar(255) NOT NULL ,
  PRIMARY KEY  (`frame_id`,`containers_list_id`,`containers_list_name`,`page_id`)
);

CREATE TABLE `easy_cms_frame_menus` (
  `frame_id` int(11) NOT NULL default '0',
  `menu_name` varchar(255) NOT NULL ,
  `menu_id` int(11) NOT NULL default '0',
  PRIMARY KEY  (`frame_id`,`menu_name`,`menu_id`)
);

CREATE TABLE `easy_cms_frame_scripts` (
  `frame_id` int(11) NOT NULL default '0',
  `script_id` int(11) NOT NULL default '0',
  PRIMARY KEY  (`frame_id`,`script_id`)
);

CREATE TABLE `easy_cms_frame_styles` (
  `frame_id` int(11) NOT NULL default '0',
  `style_id` int(11) NOT NULL default '0',
  PRIMARY KEY  (`frame_id`,`style_id`)
);

CREATE TABLE `easy_cms_frames` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL ,
  `file` mediumtext NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `name` (`name`)
);

CREATE TABLE `easy_cms_users` (
  `id` int(4) NOT NULL auto_increment,
  `login` varchar(255) NOT NULL ,
  `password` varchar(32) NOT NULL ,
  `firstname` varchar(50),
  `lastname` varchar(50),
  `email` varchar(255),
  `lang_id` int(4) default '1',
  `home_page_id` blob,
  `disabled` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`id`)
);

CREATE TABLE `easy_cms_groups` (
  `id` int(4) NOT NULL auto_increment,
  `name` varchar(50) NOT NULL,
  `description` varchar(255) NOT NULL,
  `disabled` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`id`)
);

CREATE TABLE `easy_cms_group_users` (
  `group_id` int(11) NOT NULL default '0',
  `user_id` int(11) NOT NULL default '0',
  PRIMARY KEY  (`group_id`,`user_id`)
);

CREATE TABLE `easy_cms_labels` (
  `id` int(11) NOT NULL auto_increment,
  `lang_id` int(4) NOT NULL default '0',
  `value` mediumtext NOT NULL,
  PRIMARY KEY  (`id`,`lang_id`)
);

CREATE TABLE `easy_cms_languages` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL ,
  `short` varchar(4) NOT NULL ,
  PRIMARY KEY  (`id`)
);

CREATE TABLE `easy_cms_menus` (
  `id` int(11) NOT NULL auto_increment,
  `root_page_id` int(11) default '0',
  `name_id` int(11) default '0',
  `template_id` int(11) default '0',
  `sorting_type` tinyint(4) NOT NULL default '0',
  `sort_field` varchar(255) NOT NULL ,
  `sort_order` tinyint(4) default '0',
  `count_shown` int(11) default '0',
  `max_level` int(11) NOT NULL default '0',
  `deleted` tinyint(1) NOT NULL default '0',
  `published` tinyint(1) default '0',
  `acl_id` int(11) NOT NULL default '1',
  PRIMARY KEY  (`id`)
);

CREATE TABLE `easy_cms_menu_nodes` (
  `id` int(11) NOT NULL auto_increment,
  `menu_id` int(11) NOT NULL default '0',
  `page_id` int(11) NOT NULL default '0',
  `parent_node_id` int(11) NOT NULL default '0',
  `index` int(11) default '0',
  `deleted` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`id`)
);

CREATE TABLE `easy_cms_pages` (
  `id` int(11) NOT NULL auto_increment,
  `parent_id` int(11) default '0',
  `name_id` int(11) default '0',
  `alias_id` int(11) default '0',
  `title_id` int(11) default '0',
  `description_id` int(11) default '0',
  `keywords_id` int(11) default '0',
  `frame_id` int(11) default '0',
  `link` blob,
  `cache` tinyint(1) default '0',
  `deleted` tinyint(1) default '0',
  `published` tinyint(1) default '0',
  `acl_id` int(11) NOT NULL default '1',
  PRIMARY KEY  (`id`)
);

CREATE TABLE `easy_cms_scripts` (
  `id` int(11) NOT NULL auto_increment,
  `file` mediumtext NOT NULL,
  PRIMARY KEY  (`id`)
);

CREATE TABLE `easy_cms_styles` (
  `id` int(11) NOT NULL auto_increment,
  `file` mediumtext NOT NULL,
  PRIMARY KEY  (`id`)
);

CREATE TABLE `easy_cms_templates` (
  `id` int(11) NOT NULL auto_increment,
  `type` varchar(255) NOT NULL ,
  `name` varchar(255) NOT NULL ,
  `xsl` longtext NOT NULL,
  PRIMARY KEY  (`id`)
);

CREATE TABLE `easy_cms_versions` (
  `id` int(5) unsigned NOT NULL auto_increment,
  `content_id` int(5) unsigned default '0',
  `date` datetime NOT NULL,
  `type_name` varchar(255) NOT NULL,
  `user_id` int(4) unsigned default '0',
  PRIMARY KEY  (`id`)
);

CREATE TABLE `easy_cms_mailing_queue` (
  `id` int(11) NOT NULL auto_increment,
  `message_id` int(11) NOT NULL default '0',
  `subscriber_id` int(11) NOT NULL default '0',
  `date_in` date NOT NULL default '0000-00-00',
  `date_out` date NOT NULL default '0000-00-00',
  PRIMARY KEY  (`id`)
);

CREATE TABLE `easy_cms_content_type_gallery_photo` (
  `id` int(11) NOT NULL auto_increment,
  `lang_id` int(4) NOT NULL default '1',
  `acl_id` int(11) NOT NULL default '1',
  `author_id` int(11) default '0',
  `published` tinyint(1) default '0',
  `deleted` tinyint(1) default '0',
  `date` date NOT NULL,
  `title` varchar(255) NOT NULL ,
  `image` tinyblob NOT NULL ,
  `comment` text NOT NULL,
  PRIMARY KEY  (`id`,`lang_id`)
);

CREATE TABLE `easy_cms_content_type_article` (
  `id` int(11) NOT NULL auto_increment,
  `lang_id` int(4) NOT NULL default '1',
  `acl_id` int(11) NOT NULL default '1',
  `author_id` int(11) default '0',
  `published` tinyint(1) default '0',
  `deleted` tinyint(1) default '0',
  `date` date NOT NULL,
  `title` varchar(255) NOT NULL ,
  `subtitle` varchar(255) NOT NULL ,
  `content` longtext NOT NULL,
  PRIMARY KEY  (`id`,`lang_id`)
);

CREATE TABLE `easy_cms_content_type_simple_link` (
  `id` int(11) NOT NULL auto_increment,
  `lang_id` int(4) NOT NULL default '1',
  `acl_id` int(11) NOT NULL default '1',
  `author_id` int(11) default '0',
  `published` tinyint(1) default '0',
  `deleted` tinyint(1) default '0',
  `title` varchar(255) NOT NULL,
  `link` blob NOT NULL,
  PRIMARY KEY  (`id`,`lang_id`)
);

CREATE TABLE `easy_cms_content_type_mailing_list` (
  `id` int(11) NOT NULL auto_increment,
  `lang_id` int(4) NOT NULL default '0',
  `acl_id` int(11) NOT NULL default '0',
  `author_id` int(11) default '0',
  `published` tinyint(1) NOT NULL default '0',
  `deleted` tinyint(1) NOT NULL default '0',
  `name` varchar(255) NOT NULL default '',
  `description` text NOT NULL,
  PRIMARY KEY  (`id`,`lang_id`)
);

CREATE TABLE `easy_cms_content_type_mailing_message` (
  `id` int(11) NOT NULL auto_increment,
  `lang_id` int(4) NOT NULL default '0',
  `acl_id` int(11) NOT NULL default '0',
  `author_id` int(11) default '0',
  `published` tinyint(1) NOT NULL default '0',
  `deleted` tinyint(1) NOT NULL default '0',
  `mailing_list_id` int(11) NOT NULL default '0',
  `sent` tinyint(1) NOT NULL default '0',
  `date` date NOT NULL default '0000-00-00',
  `subject` varchar(255) NOT NULL default '',
  `body` longtext NOT NULL,
  PRIMARY KEY  (`id`,`lang_id`)
);

CREATE TABLE `easy_cms_content_type_mailing_subscriber` (
  `id` int(11) NOT NULL auto_increment,
  `lang_id` int(4) NOT NULL default '0',
  `acl_id` int(11) NOT NULL default '0',
  `author_id` int(11) default '0',
  `published` tinyint(1) NOT NULL default '0',
  `deleted` tinyint(1) NOT NULL default '0',
  `mailing_list_id` int(11) NOT NULL default '0',
  `firstname` varchar(255) NOT NULL default '',
  `lastname` varchar(255) NOT NULL default '',
  `email` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`,`lang_id`)
);

CREATE TABLE `easy_cms_engines` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `last_run` int(11) NOT NULL default '0',
  PRIMARY KEY  (id)
);

CREATE TABLE `easy_mlm` (
  `id` int(11) NOT NULL auto_increment,
  `list_id` int(11) NOT NULL default '1',
  `first_name` varchar(255) NOT NULL default '',
  `last_name` varchar(255) NOT NULL default '',
  `email` varchar(255) NOT NULL default '',
  `send` tinyint(1) NOT NULL default '0',
  `remove` tinyint(1) NOT NULL default '0',
  `code` varchar(32) NOT NULL default '',
  `gender` char(1) NOT NULL default '',
  `position` varchar(255) NOT NULL,
  `about` varchar(255) NOT NULL,
  `lang` varchar(50) NOT NULL default '',
  `country` varchar(50) NOT NULL default '',
  `organisation` varchar(50) NOT NULL default '',
  PRIMARY KEY  (id)
);

INSERT INTO `easy_cms_infos` VALUES ('2.0.0rc1', '2008-08-27', '0000-00-00', 'limache');
INSERT INTO `easy_cms_acl` VALUES (1, 0);
INSERT INTO `easy_cms_acl_groups` VALUES (1, 1, 1, 1, 1, 1, 1);
INSERT INTO `easy_cms_acl_users` VALUES (1, 1, 1, 1, 1, 1, 1);
INSERT INTO `easy_cms_acl_users` VALUES (1, 2, 1, 1, 1, 1, 1);
INSERT INTO `easy_cms_acl_users` VALUES (1, 3, 1, 0, 0, 0, 0);
INSERT INTO `easy_cms_users` VALUES (1, 'ROOT', '21232f297a57a5a743894a0e4a801fc3', '', '', '', 1, '?pid=1', 0);
INSERT INTO `easy_cms_users` VALUES (2, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'C&eacute;dric', 'Fran&ccedil;oys', '', 1, '?pid=1', 0);
INSERT INTO `easy_cms_users` VALUES (3, 'GUEST', '084e0343a0486ff05530df6c705c8bb4', '', '', '', 1, '?pid=1', 0);
INSERT INTO `easy_cms_groups` VALUES (1, 'ADMINISTRATORS', '', 0);
INSERT INTO `easy_cms_groups` VALUES (2, 'EVERYONE', '', 0);
INSERT INTO `easy_cms_group_users` VALUES (1, 1);
INSERT INTO `easy_cms_group_users` VALUES (1, 2);
INSERT INTO `easy_cms_group_users` VALUES (2, 3);
INSERT INTO `easy_cms_languages` VALUES (1, 'english', 'en');