--
-- Host: localhost    Database: sc_2
-- ------------------------------------------------------


--
-- Table structure for table `_ad_outbuster`
--

CREATE TABLE `_ad_outbuster` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(250) DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=TokuDB AUTO_INCREMENT=230 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `_sc_feed_new`
--

CREATE TABLE `_sc_feed_new` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `user_id_scout` int(10) unsigned DEFAULT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `collection_id` int(10) unsigned DEFAULT NULL,
  `type_id` tinyint(3) unsigned DEFAULT NULL,
  `subtype_id` tinyint(3) unsigned DEFAULT NULL,
  `rating` tinyint(3) unsigned DEFAULT NULL,
  `is_shopping_list` tinyint(3) unsigned DEFAULT NULL,
  `is_wish_list` tinyint(3) unsigned DEFAULT NULL,
  `is_wish_list_bis` tinyint(3) unsigned DEFAULT NULL,
  `is_recommend` tinyint(3) unsigned DEFAULT NULL,
  `is_review` tinyint(3) unsigned DEFAULT NULL,
  `is_current` tinyint(3) unsigned DEFAULT NULL,
  `list_id_product` varchar(100) DEFAULT NULL,
  `list_id_list` int(10) unsigned DEFAULT NULL,
  `is_like` tinyint(3) unsigned DEFAULT NULL,
  `is_comment_list` tinyint(3) unsigned DEFAULT NULL,
  `is_comment_review` tinyint(3) unsigned DEFAULT NULL,
  `feed_id_related` int(10) unsigned DEFAULT NULL,
  `format_id` int(10) unsigned DEFAULT NULL,
  `badge_id` int(10) unsigned DEFAULT NULL,
  `param_index_id_trailer` int(10) unsigned DEFAULT NULL,
  `message_id` int(10) unsigned DEFAULT NULL,
  `shout_id` int(10) unsigned DEFAULT NULL,
  `forum_topic_id` int(10) unsigned DEFAULT NULL,
  `is_archive` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `application_id` int(10) unsigned DEFAULT NULL,
  `gen_like_count` int(10) unsigned DEFAULT NULL,
  `gen_comment_count` int(10) unsigned DEFAULT NULL,
  `gen_message_topic_id` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `flag_gen` tinyint(3) NOT NULL DEFAULT '0',
  `host` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`,`is_archive`),
  KEY `idx_product` (`product_id`,`date_creation`) USING BTREE,
  KEY `idx_product_user` (`product_id`,`user_id`,`date_creation`) USING BTREE,
  KEY `idx_user_product` (`user_id`,`product_id`,`date_creation`) USING BTREE,
  KEY `idx_user_id` (`user_id`,`date_creation`) USING BTREE,
  KEY `idx_shout_id` (`shout_id`) USING BTREE,
  KEY `idx_contact_id` (`contact_id`),
  KEY `idx_product_2` (`product_id`,`date_last_update`),
  KEY `product_id` (`product_id`,`user_id`,`date_last_update`),
  KEY `idx_flag_gen` (`flag_gen`,`is_archive`,`host`,`date_last_update`),
  KEY `idx_user_id_is_archive` (`user_id`,`is_archive`,`date_last_update`),
  KEY `date_last_update` (`date_last_update`)
) ENGINE=TokuDB AUTO_INCREMENT=106634912 DEFAULT CHARSET=utf8 `compression`='tokudb_small'
/*!50100 PARTITION BY LIST (is_archive)
(PARTITION ARCHIVED VALUES IN (1) ENGINE = TokuDB,
 PARTITION LIVE VALUES IN (0) ENGINE = TokuDB) */;

--
-- Table structure for table `_sc_geopostcode`
--

CREATE TABLE `_sc_geopostcode` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `country` varchar(2) NOT NULL,
  `language` varchar(2) NOT NULL,
  `ref` bigint(20) NOT NULL,
  `iso2` varchar(6) NOT NULL,
  `region1` varchar(60) NOT NULL,
  `region2` varchar(60) NOT NULL,
  `region3` varchar(60) NOT NULL,
  `region4` varchar(60) NOT NULL,
  `zip` varchar(10) NOT NULL,
  `city` varchar(60) NOT NULL,
  `area1` varchar(80) NOT NULL,
  `area2` varchar(80) NOT NULL,
  `lat` double NOT NULL,
  `lng` double NOT NULL,
  `tz` varchar(30) NOT NULL,
  `utc` varchar(10) NOT NULL,
  `dst` varchar(1) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_geopostcode__country` (`country`)
) ENGINE=TokuDB AUTO_INCREMENT=2656445 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `_test_`
--

CREATE TABLE `_test_` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `_tmp_fix_date_done`
--

CREATE TABLE `_tmp_fix_date_done` (
  `id` int(11) unsigned NOT NULL,
  `product_id` int(11) unsigned NOT NULL,
  `user_id` int(11) NOT NULL,
  `date_done` date DEFAULT NULL,
  `date_creation` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `product_id` (`product_id`,`user_id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `_tmp_fresh_likes`
--

CREATE TABLE `_tmp_fresh_likes` (
  `user_id` int(11) unsigned NOT NULL DEFAULT '0',
  `nb_likes` decimal(48,0) DEFAULT NULL,
  PRIMARY KEY (`user_id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `_tmp_fresh_reviews`
--

CREATE TABLE `_tmp_fresh_reviews` (
  `id` int(10) unsigned NOT NULL DEFAULT '0',
  `product_id` int(10) unsigned NOT NULL,
  `gen_type_id` tinyint(3) unsigned NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `rating` tinyint(3) unsigned DEFAULT NULL,
  `review_date_creation` datetime DEFAULT NULL,
  `gen_review_like_count` int(10) unsigned NOT NULL DEFAULT '0',
  `gen_review_like_positive_count` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`user_id`,`product_id`,`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `_tmp_reviews_logged_fresh`
--

CREATE TABLE `_tmp_reviews_logged_fresh` (
  `user_id` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `id` int(10) unsigned NOT NULL DEFAULT '0',
  `type_id` tinyint(3) unsigned NOT NULL,
  PRIMARY KEY (`user_id`,`product_id`,`id`),
  UNIQUE KEY `ix_id` (`id`),
  KEY `ix_user_id` (`user_id`,`product_id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `_tmp_works_1788676`
--

CREATE TABLE `_tmp_works_1788676` (
  `product_id` int(10) unsigned NOT NULL,
  UNIQUE KEY `ix_pid` (`product_id`)
) ENGINE=MEMORY DEFAULT CHARSET=utf8;

--
-- Table structure for table `api_contact`
--

CREATE TABLE `api_contact` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `reference` varchar(50) DEFAULT NULL,
  `label` varchar(100) NOT NULL DEFAULT '',
  `state` tinyint(4) DEFAULT '1',
  `sc_contact_id` int(10) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=294 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `api_index`
--

CREATE TABLE `api_index` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `apns_message`
--

CREATE TABLE `apns_message` (
  `pid` int(9) unsigned NOT NULL AUTO_INCREMENT,
  `clientid` varchar(64) NOT NULL,
  `fk_device` int(9) unsigned NOT NULL,
  `message` varchar(255) NOT NULL,
  `delivery` datetime NOT NULL,
  `status` enum('queued','delivered','failed') CHARACTER SET latin1 NOT NULL DEFAULT 'queued',
  `created` datetime NOT NULL,
  `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`pid`),
  KEY `clientid` (`clientid`),
  KEY `fk_device` (`fk_device`),
  KEY `status` (`status`),
  KEY `created` (`created`),
  KEY `modified` (`modified`),
  KEY `message` (`message`),
  KEY `delivery` (`delivery`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `canal_product`
--

CREATE TABLE `canal_product` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `canal_ref_item` int(10) unsigned DEFAULT NULL,
  `allocine_ref_id` int(11) DEFAULT NULL,
  `sc_product_id` int(10) unsigned DEFAULT NULL,
  `title` varchar(200) NOT NULL,
  `original_title` varchar(200) NOT NULL,
  `director` varchar(200) DEFAULT NULL,
  `year_of_production` smallint(5) DEFAULT NULL,
  `catch_all` varchar(255) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_canal_ref_item` (`canal_ref_item`),
  KEY `idx_sc_product_id` (`sc_product_id`),
  KEY `allocine_ref_id` (`allocine_ref_id`)
) ENGINE=TokuDB AUTO_INCREMENT=6348 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `canal_product_modality`
--

CREATE TABLE `canal_product_modality` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `canal_ref_product` int(10) unsigned NOT NULL,
  `canal_ref_modality` int(10) unsigned NOT NULL,
  `canal_ref_modality_url` varchar(200) DEFAULT NULL,
  `price` varchar(5) DEFAULT NULL,
  `format_audio` varchar(15) DEFAULT NULL,
  `contract_format` varchar(15) DEFAULT NULL,
  `rental_duration` smallint(5) unsigned DEFAULT NULL,
  `date_start` timestamp NULL DEFAULT NULL,
  `date_end` timestamp NULL DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_canal_ref_modality` (`canal_ref_modality`),
  KEY `idx_canal_ref_product` (`canal_ref_product`)
) ENGINE=TokuDB AUTO_INCREMENT=1688 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `canalplay_similarity`
--

CREATE TABLE `canalplay_similarity` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `sc_product_id` int(10) unsigned NOT NULL,
  `sc_product_id_canalplay` int(10) unsigned NOT NULL,
  `url_canalplay` varchar(300) DEFAULT NULL,
  `weight` int(10) unsigned DEFAULT NULL,
  `sc_contact_ids` varchar(300) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_unique` (`sc_product_id`,`sc_product_id_canalplay`) USING BTREE,
  KEY `idx_product_weight` (`sc_product_id`,`weight`)
) ENGINE=TokuDB AUTO_INCREMENT=282036 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `cron_gen_priority`
--

CREATE TABLE `cron_gen_priority` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `product_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) DEFAULT NULL,
  `collection_count` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_count` (`collection_count`),
  KEY `idx_product` (`product_id`,`collection_count`),
  KEY `idx_contact` (`contact_id`,`collection_count`)
) ENGINE=TokuDB AUTO_INCREMENT=8162951 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `cron_script`
--

CREATE TABLE `cron_script` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `host` varchar(30) NOT NULL DEFAULT '',
  `class` varchar(100) NOT NULL DEFAULT '',
  `method` varchar(100) NOT NULL DEFAULT '',
  `arguments` varchar(100) DEFAULT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `cycle` int(10) NOT NULL DEFAULT '0',
  `sleep` int(10) unsigned NOT NULL DEFAULT '5',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=157 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `csat_similarity`
--

CREATE TABLE `csat_similarity` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `sc_product_id` int(10) unsigned NOT NULL,
  `sc_product_id_csat` int(10) unsigned NOT NULL,
  `weight` int(10) unsigned DEFAULT NULL,
  `sc_contact_ids` varchar(300) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_unique` (`sc_product_id`,`sc_product_id_csat`) USING BTREE,
  KEY `idx_product_weight` (`sc_product_id`,`weight`)
) ENGINE=TokuDB AUTO_INCREMENT=173306 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `filmo_product`
--

CREATE TABLE `filmo_product` (
  `sc_product` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`sc_product`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `filmo_product_buffer`
--

CREATE TABLE `filmo_product_buffer` (
  `filmo_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `sc_product` int(11) DEFAULT NULL,
  `filmo_url` varchar(500) DEFAULT NULL,
  PRIMARY KEY (`filmo_id`),
  KEY `sc_product` (`sc_product`)
) ENGINE=TokuDB AUTO_INCREMENT=9518 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `giantbomb`
--

CREATE TABLE `giantbomb` (
  `id` int(11) NOT NULL,
  `sc_product_id` int(11) DEFAULT NULL,
  `name` varchar(250) DEFAULT NULL,
  `aliases` varchar(500) DEFAULT NULL,
  `date_added` datetime DEFAULT NULL,
  `date_last_updated` datetime DEFAULT NULL,
  `deck` text,
  `description` mediumtext,
  `expected_release_day` int(11) DEFAULT NULL,
  `expected_release_month` int(11) DEFAULT NULL,
  `expected_release_quarter` int(11) DEFAULT NULL,
  `expected_release_year` int(11) DEFAULT NULL,
  `image` text,
  `original_game_rating` text,
  `original_release_date` datetime DEFAULT NULL,
  `platforms` text,
  `site_detail_url` varchar(150) DEFAULT NULL,
  `state_validation` tinyint(4) DEFAULT '0',
  `catchall` varchar(500) DEFAULT NULL,
  `keep_sc_title` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `ix_id` (`id`),
  KEY `ix_name` (`name`) USING BTREE,
  KEY `ix_catchall` (`catchall`(255)),
  KEY `ix_aliases` (`aliases`(255))
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `mbz_mbid_index`
--

CREATE TABLE `mbz_mbid_index` (
  `gid` char(36) NOT NULL,
  `target_type_id` int(11) unsigned DEFAULT NULL,
  `target_subtype_id` int(11) unsigned DEFAULT NULL,
  `target_id` int(11) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `id_auto` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id_auto`),
  UNIQUE KEY `gid` (`gid`),
  KEY `idx_date_update` (`date_last_update`),
  KEY `idx_target_id_type_id` (`target_id`,`target_type_id`)
) ENGINE=TokuDB AUTO_INCREMENT=18749945 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `mubi_product`
--

CREATE TABLE `mubi_product` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(11) DEFAULT NULL,
  `ref_mubi` int(11) NOT NULL,
  `date_start` datetime DEFAULT NULL,
  `date_end` datetime DEFAULT NULL,
  `url` varchar(600) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `date_start` (`date_start`),
  KEY `date_end` (`date_end`)
) ENGINE=TokuDB AUTO_INCREMENT=129 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `nolim_product`
--

CREATE TABLE `nolim_product` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `sc_product_id` int(11) DEFAULT NULL,
  `ref_nolim_id` varchar(100) NOT NULL DEFAULT '',
  `subtype_id` smallint(6) DEFAULT NULL,
  `title` varchar(200) NOT NULL DEFAULT '',
  `original_title` varchar(200) DEFAULT NULL,
  `year_of_production` int(4) DEFAULT NULL,
  `director` varchar(200) DEFAULT NULL,
  `catchall` varchar(500) DEFAULT NULL,
  `date_start` datetime DEFAULT NULL,
  `date_end` datetime DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `catchall` (`catchall`)
) ENGINE=TokuDB AUTO_INCREMENT=1798 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `nolim_product_stage`
--

CREATE TABLE `nolim_product_stage` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `sc_product_id` int(11) DEFAULT NULL,
  `ref_nolim_id` varchar(100) NOT NULL DEFAULT '',
  `subtype_id` smallint(6) DEFAULT NULL,
  `title` varchar(200) NOT NULL DEFAULT '',
  `original_title` varchar(200) DEFAULT NULL,
  `year_of_production` int(4) DEFAULT NULL,
  `director` varchar(200) DEFAULT NULL,
  `catchall` varchar(500) DEFAULT NULL,
  `date_start` datetime DEFAULT NULL,
  `date_end` datetime DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `catchall` (`catchall`)
) ENGINE=TokuDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `oauth_scope`
--

CREATE TABLE `oauth_scope` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `description` varchar(2000) NOT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_name` (`name`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `plurimedia_product`
--

CREATE TABLE `plurimedia_product` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `plurimedia_ref` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `gen_type_id` tinyint(3) unsigned NOT NULL,
  `subtype_id` tinyint(3) unsigned NOT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_multilingual` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_close_captioned` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_subtitled` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_hd` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_unseen` tinyint(3) unsigned NOT NULL,
  `audience_restriction` varchar(40) DEFAULT NULL,
  `length` smallint(5) unsigned DEFAULT NULL,
  `title` varchar(200) DEFAULT NULL,
  `alt_title` varchar(200) DEFAULT NULL,
  `original_title` varchar(200) DEFAULT NULL,
  `original_alt_title` varchar(200) DEFAULT NULL,
  `director` varchar(100) DEFAULT NULL,
  `year_of_production` smallint(5) unsigned DEFAULT NULL,
  `episode` smallint(5) unsigned DEFAULT NULL,
  `season` smallint(5) DEFAULT NULL,
  `episode_count` smallint(5) DEFAULT NULL,
  `plurimedia_ref_season` int(10) DEFAULT NULL,
  `plurimedia_ref_tv_show` int(10) DEFAULT NULL,
  `catch_all` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ix_pm_ref` (`plurimedia_ref`) USING BTREE,
  KEY `idx_product_id` (`product_id`)
) ENGINE=TokuDB AUTO_INCREMENT=796828 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT `compression`='tokudb_small';

--
-- Table structure for table `plurimedia_product_theater`
--

CREATE TABLE `plurimedia_product_theater` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(10) unsigned DEFAULT NULL,
  `plurimedia_ref` varchar(10) NOT NULL,
  `type_id` tinyint(4) DEFAULT NULL,
  `subtype_id` tinyint(4) DEFAULT NULL,
  `title` varchar(255) NOT NULL,
  `director` varchar(255) DEFAULT NULL,
  `year_realisation` int(11) DEFAULT NULL,
  `catch_all` varchar(500) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ix_plurimedia_ref` (`plurimedia_ref`),
  KEY `ix_catchall` (`catch_all`(255)) USING HASH
) ENGINE=TokuDB AUTO_INCREMENT=132440 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `plurimedia_state_reference`
--

CREATE TABLE `plurimedia_state_reference` (
  `id` tinyint(4) NOT NULL,
  `label` varchar(40) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_ab`
--

CREATE TABLE `sc_ab` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_ab_action`
--

CREATE TABLE `sc_ab_action` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_ab_case`
--

CREATE TABLE `sc_ab_case` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ab_id` int(10) unsigned NOT NULL,
  `label` varchar(1000) NOT NULL DEFAULT '',
  `json` text,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `_old_id` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_ab_case` (`ab_id`)
) ENGINE=TokuDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_ab_mailer`
--

CREATE TABLE `sc_ab_mailer` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ab_id` int(10) unsigned DEFAULT NULL,
  `label` varchar(255) DEFAULT NULL,
  `from_mail` varchar(100) DEFAULT NULL,
  `from_label` varchar(100) DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `template` varchar(200) DEFAULT NULL,
  `json_template` text,
  `status` tinyint(3) NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_ab_user`
--

CREATE TABLE `sc_ab_user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `version` int(10) NOT NULL,
  `register_origin` varchar(100) DEFAULT '',
  `register_block` varchar(100) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=18977 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_ad_campaign`
--

CREATE TABLE `sc_ad_campaign` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `slug` varchar(100) NOT NULL DEFAULT '',
  `state` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0/ Pending. 1/ Active.',
  `product_id` int(10) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=306 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_ad_contest`
--

CREATE TABLE `sc_ad_contest` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ad_campaign_id` int(10) unsigned NOT NULL,
  `label` varchar(100) NOT NULL DEFAULT '',
  `max_user` int(10) unsigned DEFAULT NULL,
  `json` mediumtext,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `date_end` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=381 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_ad_contest_invitation`
--

CREATE TABLE `sc_ad_contest_invitation` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `guest_user_1_id` int(10) unsigned NOT NULL,
  `guest_user_2_id` int(10) unsigned NOT NULL,
  `guest_user_3_id` int(10) unsigned NOT NULL,
  `guest_user_4_id` int(10) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '	',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_product_user` (`product_id`,`user_id`) USING BTREE,
  KEY `idx_guest_user_1` (`guest_user_1_id`) USING BTREE,
  KEY `idx_guest_user_2` (`guest_user_2_id`) USING BTREE,
  KEY `idx_guest_user_3` (`guest_user_3_id`) USING BTREE,
  KEY `idx_guest_user_4` (`guest_user_4_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_ad_contest_user`
--

CREATE TABLE `sc_ad_contest_user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ad_contest_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `state` tinyint(4) NOT NULL,
  `position` int(10) unsigned NOT NULL,
  `first_name` varchar(128) DEFAULT NULL,
  `last_name` varchar(128) DEFAULT NULL,
  `email` varchar(128) NOT NULL DEFAULT '',
  `adress` text NOT NULL,
  `zip_code_id` int(10) unsigned DEFAULT NULL,
  `zip` varchar(8) DEFAULT NULL,
  `city` varchar(128) NOT NULL DEFAULT '',
  `country_id` int(10) unsigned DEFAULT NULL,
  `extra_field` varchar(250) DEFAULT NULL,
  `json` mediumtext,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_contest_id_user_id` (`ad_contest_id`,`user_id`)
) ENGINE=TokuDB AUTO_INCREMENT=119218 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_ad_event`
--

CREATE TABLE `sc_ad_event` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `user_action_id` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_ad_sponsored_feed`
--

CREATE TABLE `sc_ad_sponsored_feed` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `campaign_id` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `capping_per_action` int(10) unsigned NOT NULL DEFAULT '0',
  `force` int(10) unsigned NOT NULL DEFAULT '1',
  `json` text NOT NULL,
  `date_start` timestamp NULL DEFAULT NULL,
  `date_end` timestamp NULL DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `product_id` (`product_id`),
  KEY `date_start` (`date_start`),
  KEY `date_end` (`date_end`),
  KEY `campaign_id` (`campaign_id`)
) ENGINE=TokuDB AUTO_INCREMENT=223 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_admin_query`
--

CREATE TABLE `sc_admin_query` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `admin_query_template_id` int(10) unsigned DEFAULT NULL,
  `ad_campaign_id` int(10) unsigned DEFAULT NULL,
  `label` varchar(200) NOT NULL DEFAULT '',
  `description` varchar(500) DEFAULT NULL,
  `query` text NOT NULL,
  `json` text,
  `last_execution` timestamp NULL DEFAULT NULL,
  `frequence` tinyint(4) NOT NULL DEFAULT '0',
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=689 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_admin_query_return_type`
--

CREATE TABLE `sc_admin_query_return_type` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_admin_query_template`
--

CREATE TABLE `sc_admin_query_template` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL,
  `function_tag` varchar(50) NOT NULL,
  `admin_query_return_type_id` int(10) NOT NULL,
  `json` text,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_adserver`
--

CREATE TABLE `sc_adserver` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ab_id` int(10) unsigned DEFAULT NULL,
  `label` varchar(100) NOT NULL DEFAULT '',
  `json_rules` text,
  `template` varchar(100) DEFAULT NULL,
  `user_type` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `priority` int(10) unsigned NOT NULL DEFAULT '0',
  `max_per_session` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `frequency` tinyint(3) unsigned NOT NULL DEFAULT '100',
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_state` (`state`,`priority`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_api`
--

CREATE TABLE `sc_api` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(21) NOT NULL DEFAULT '' COMMENT 'Label de l''API (Imdb, Spotify…)',
  `liability` tinyint(3) unsigned NOT NULL DEFAULT '100' COMMENT 'Indice de fiabilité (priorité, le plus haut est le plus fort)',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8 COMMENT='API référencées' `compression`='tokudb_small';

--
-- Table structure for table `sc_api_account_friend`
--

CREATE TABLE `sc_api_account_friend` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `gen_api_id` int(10) unsigned NOT NULL,
  `api_account_id` int(10) unsigned NOT NULL,
  `api_account_id_related` int(10) unsigned NOT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_api_accounts` (`api_account_id`,`api_account_id_related`)
) ENGINE=TokuDB AUTO_INCREMENT=138950759 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_api_action`
--

CREATE TABLE `sc_api_action` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(255) NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_api_product`
--

CREATE TABLE `sc_api_product` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `api_id` int(10) unsigned NOT NULL,
  `reference` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `title` varchar(300) NOT NULL DEFAULT '',
  `title_original` varchar(300) DEFAULT NULL,
  `director` varchar(500) DEFAULT NULL,
  `year_of_production` smallint(5) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `digest` varchar(600) DEFAULT NULL,
  `date_airing_from` timestamp NULL DEFAULT NULL,
  `date_airing_to` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_api_reference` (`api_id`,`reference`) USING BTREE,
  KEY `idx_product` (`product_id`)
) ENGINE=TokuDB AUTO_INCREMENT=2394 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_api_request`
--

CREATE TABLE `sc_api_request` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `api_id` int(10) NOT NULL,
  `request_id` varchar(100) NOT NULL,
  `request_type_id` tinyint(4) unsigned NOT NULL,
  `user_id` int(10) DEFAULT NULL,
  `state` tinyint(4) unsigned NOT NULL DEFAULT '0',
  `related_api_account_id` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_api_id_req_id` (`api_id`,`request_id`,`request_type_id`),
  KEY `idx_related_api_account_id` (`related_api_account_id`) USING BTREE,
  KEY `idx_user_id` (`user_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=67095 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_api_request_type`
--

CREATE TABLE `sc_api_request_type` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_api_stack`
--

CREATE TABLE `sc_api_stack` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `md5` varchar(32) NOT NULL,
  `api_id` int(10) unsigned NOT NULL,
  `api_ref` varchar(50) NOT NULL,
  `sc_id` bigint(20) unsigned DEFAULT NULL,
  `param_id` int(10) unsigned NOT NULL,
  `param_value` varchar(600) DEFAULT NULL,
  `param_ref` varchar(50) DEFAULT NULL,
  `rank` int(10) unsigned DEFAULT NULL,
  `alt_ranking` int(10) unsigned DEFAULT NULL,
  `alt_ranking_label` varchar(50) DEFAULT NULL,
  `is_favorite` tinyint(1) unsigned DEFAULT NULL,
  `date_api` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `i18n_id` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `md5` (`md5`,`api_ref`,`api_id`),
  KEY `idx_sc_api_stack__api_ref` (`api_ref`) USING BTREE,
  KEY `idx_sc_api_stack__sc_id` (`sc_id`) USING BTREE,
  KEY `fk_api_stack__sc_api__id` (`api_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=22730212 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_api_user_action_right`
--

CREATE TABLE `sc_api_user_action_right` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `user_action_id` int(10) unsigned NOT NULL,
  `subtype_id` tinyint(3) unsigned DEFAULT NULL,
  `api_id` int(10) unsigned NOT NULL,
  `value` varchar(100) NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`,`user_action_id`,`subtype_id`,`api_id`)
) ENGINE=TokuDB AUTO_INCREMENT=7791741 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_article`
--

CREATE TABLE `sc_article` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `subtype_id` int(10) unsigned NOT NULL,
  `type_id_related` int(10) unsigned DEFAULT NULL,
  `title` varchar(400) NOT NULL DEFAULT '' COMMENT 'Titre de l''article.',
  `content` text COMMENT 'Article',
  `link` varchar(500) DEFAULT NULL,
  `state` tinyint(4) DEFAULT '0' COMMENT '0/ Not published. 1/ Published.',
  `list_id` int(10) unsigned DEFAULT NULL,
  `hits` int(10) NOT NULL DEFAULT '0',
  `gen_comment_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Number of comments. Generated from sc_comment.',
  `gen_like_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Number of comments. Generated from sc_comment.',
  `user_id_creation` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `user_id_last_update` int(10) unsigned DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id_publication` int(10) unsigned DEFAULT NULL,
  `date_publication` timestamp NULL DEFAULT NULL COMMENT 'Date de publication. Dépend de ''status''.',
  `user_id_validation` int(10) unsigned DEFAULT NULL,
  `date_validation` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_user_id_publication` (`user_id_publication`) USING BTREE,
  KEY `fk_user_id_validation` (`user_id_validation`) USING BTREE,
  KEY `fk_user_id_last_update` (`user_id_last_update`) USING BTREE,
  KEY `fk_user_id_creation` (`user_id_creation`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=680 DEFAULT CHARSET=utf8 COMMENT='Articles du blog.' `compression`='tokudb_small';

--
-- Table structure for table `sc_award`
--

CREATE TABLE `sc_award` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(60) NOT NULL,
  `description` varchar(300) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_award_category`
--

CREATE TABLE `sc_award_category` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `award_id` int(10) unsigned NOT NULL,
  `label` varchar(50) NOT NULL,
  `description` varchar(300) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_award_product`
--

CREATE TABLE `sc_award_product` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `sc_award_category_id` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `year` smallint(5) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_product_id` (`product_id`) USING BTREE
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_badge`
--

CREATE TABLE `sc_badge` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `parent_id` int(10) unsigned DEFAULT NULL,
  `subtype_id` int(10) unsigned NOT NULL,
  `label` varchar(100) DEFAULT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `stage` tinyint(4) DEFAULT NULL,
  `algo` varchar(30) DEFAULT NULL,
  `frequence` tinyint(4) NOT NULL DEFAULT '0',
  `last_execution` timestamp NULL DEFAULT NULL,
  `gen_count` int(10) unsigned NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `json` text,
  `related_poll_id` int(10) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `related_poll_id` (`related_poll_id`)
) ENGINE=TokuDB AUTO_INCREMENT=1442 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_badge_user`
--

CREATE TABLE `sc_badge_user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `badge_id` int(10) unsigned NOT NULL,
  `position` tinyint(3) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_badge` (`user_id`,`badge_id`) USING BTREE,
  KEY `idx_badge_user__date_creation` (`date_creation`),
  KEY `idx_badge_id` (`badge_id`)
) ENGINE=TokuDB AUTO_INCREMENT=2731439 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_banned_email`
--

CREATE TABLE `sc_banned_email` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(128) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_email` (`email`)
) ENGINE=TokuDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_books_catchall`
--

CREATE TABLE `sc_books_catchall` (
  `product_id` int(11) NOT NULL,
  `catchall` varchar(500) DEFAULT NULL,
  PRIMARY KEY (`product_id`),
  KEY `ix_catchall` (`catchall`(255)) USING HASH
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_broadcast`
--

CREATE TABLE `sc_broadcast` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(10) unsigned NOT NULL,
  `contact_id` int(10) unsigned NOT NULL,
  `language_type` tinyint(3) unsigned DEFAULT NULL,
  `is_3d` tinyint(3) DEFAULT NULL,
  `gen_subtype_id` tinyint(3) unsigned NOT NULL,
  `gen_type_id` tinyint(3) unsigned NOT NULL,
  `date_start` timestamp NULL DEFAULT NULL,
  `date_end` timestamp NULL DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_broadcast_group`
--

CREATE TABLE `sc_broadcast_group` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) DEFAULT NULL,
  `subtype_id_related` tinyint(3) unsigned NOT NULL,
  `label` int(10) NOT NULL,
  `i18n_id` int(10) NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `gen_contact_count` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_broadcast_group_contact`
--

CREATE TABLE `sc_broadcast_group_contact` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `contact_id` int(10) unsigned NOT NULL,
  `broadcast_group_id` int(10) unsigned NOT NULL,
  `position` int(10) unsigned NOT NULL DEFAULT '1',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_carousel_item`
--

CREATE TABLE `sc_carousel_item` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `subtype_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `description` varchar(150) DEFAULT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `list_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `link_value` varchar(200) DEFAULT NULL,
  `link_label` varchar(200) DEFAULT NULL,
  `date_start` timestamp NULL DEFAULT NULL,
  `date_end` timestamp NULL DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `weight` tinyint(4) NOT NULL DEFAULT '0',
  `capping` tinyint(3) unsigned DEFAULT NULL,
  `link_video` tinyint(4) DEFAULT NULL,
  `home_global` tinyint(4) DEFAULT NULL,
  `home_movie` tinyint(4) DEFAULT NULL,
  `home_tv` tinyint(4) DEFAULT NULL,
  `home_game` tinyint(4) DEFAULT NULL,
  `home_book` tinyint(4) DEFAULT NULL,
  `home_comic` tinyint(4) DEFAULT NULL,
  `home_music` tinyint(4) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_state` (`state`) USING BTREE,
  KEY `idx_subtype_id` (`subtype_id`) USING BTREE,
  KEY `idx_date_start` (`date_start`) USING BTREE,
  KEY `idx_date_end` (`date_end`) USING BTREE,
  KEY `idx_home_global` (`home_global`) USING BTREE,
  KEY `idx_home_movie` (`home_movie`) USING BTREE,
  KEY `idx_home_tv` (`home_tv`) USING BTREE,
  KEY `idx_home_game` (`home_game`) USING BTREE,
  KEY `idx_home_book` (`home_book`) USING BTREE,
  KEY `idx_home_comic` (`home_comic`) USING BTREE,
  KEY `idx_home_music` (`home_music`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=413 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_carousel_item_date`
--

CREATE TABLE `sc_carousel_item_date` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `carousel_item_id` int(11) NOT NULL,
  `day` varchar(15) NOT NULL DEFAULT '',
  `time_start` time NOT NULL,
  `time_end` time NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_carousel_item_id` (`carousel_item_id`) USING BTREE,
  KEY `idx_time_start` (`time_start`) USING BTREE,
  KEY `idx_time_end` (`time_end`) USING BTREE,
  KEY `idx_day` (`day`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=1090 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_category`
--

CREATE TABLE `sc_category` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(200) NOT NULL DEFAULT '',
  `parent_id` int(11) DEFAULT NULL,
  `type_id_related` tinyint(11) NOT NULL,
  `slug` varchar(200) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=253 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_changelog`
--

CREATE TABLE `sc_changelog` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `changelog_type_id` int(10) NOT NULL,
  `description` text NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `date_publication` timestamp NULL DEFAULT NULL,
  `state` tinyint(3) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_changelog_type`
--

CREATE TABLE `sc_changelog_type` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_collection`
--

CREATE TABLE `sc_collection` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `format_id` int(10) unsigned DEFAULT '0',
  `is_displayed` tinyint(3) unsigned DEFAULT '0',
  `rating` tinyint(3) unsigned DEFAULT NULL,
  `is_recommend` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_current` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_done` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_wish_list` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_shopping_list` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_review` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `review_comment_privacy` tinyint(4) DEFAULT NULL,
  `review_state` tinyint(4) DEFAULT NULL,
  `review_state_validation` tinyint(4) DEFAULT NULL,
  `review_date_creation` datetime DEFAULT NULL,
  `review_date_last_update` datetime DEFAULT NULL,
  `review_date_autosave` datetime DEFAULT NULL,
  `review_title` varchar(100) DEFAULT NULL,
  `review_title_autosave` varchar(100) DEFAULT NULL,
  `review_content` text,
  `review_content_autosave` text,
  `review_link` varchar(255) DEFAULT NULL,
  `is_not_interested` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `date_done` date DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT NULL,
  `gen_type_id` tinyint(3) unsigned NOT NULL,
  `gen_subtype_id` tinyint(3) unsigned NOT NULL,
  `gen_review_comment_count` int(10) unsigned NOT NULL DEFAULT '0',
  `gen_review_like_count` int(10) unsigned NOT NULL DEFAULT '0',
  `gen_review_like_positive_count` int(10) unsigned NOT NULL DEFAULT '0',
  `review_hits` int(10) unsigned NOT NULL DEFAULT '0',
  `gen_list_count` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `gen_state_user` tinyint(4) NOT NULL DEFAULT '1',
  `flag_gen` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `parent_1_id` int(10) unsigned DEFAULT NULL,
  `parent_2_id` int(10) unsigned DEFAULT NULL,
  `level_1` smallint(5) unsigned DEFAULT NULL,
  `level_2` text,
  `absolute_level` smallint(5) unsigned DEFAULT NULL,
  `review_content_source` text,
  `review_content_autosave_source` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_user__product__format` (`user_id`,`product_id`,`format_id`) USING BTREE,
  KEY `idx_product_user_review` (`product_id`,`user_id`,`is_review`,`review_date_creation`,`review_state`),
  KEY `idx_type_product` (`gen_type_id`,`product_id`),
  KEY `idx_product_review` (`product_id`,`is_review`,`review_state`,`review_state_validation`,`review_date_last_update`,`user_id`) USING BTREE,
  KEY `idx_flag_gen` (`flag_gen`,`date_last_update`),
  KEY `idx_shopping_list` (`is_shopping_list`),
  KEY `idx_user_rating` (`user_id`,`rating`),
  KEY `idx_ product_id_gen_review_like_positive_count` (`product_id`,`gen_review_like_positive_count`),
  KEY `idx_user_date_creation` (`user_id`,`review_date_creation`) USING BTREE,
  KEY `idx_product_rating` (`product_id`,`rating`) USING BTREE,
  KEY `idx_review_review_date_creation` (`is_review`,`review_date_creation`) USING BTREE,
  KEY `idx_date_creation_type` (`date_creation`,`gen_type_id`) USING BTREE,
  KEY `idx_state_user_product` (`gen_state_user`,`product_id`) USING BTREE,
  KEY `idx_user_last_update` (`user_id`,`date_last_update`) USING BTREE,
  KEY `idx_product_review_user` (`product_id`,`is_review`,`review_state`,`review_state_validation`,`user_id`) USING BTREE,
  KEY `idx_user_is_review_like_count` (`user_id`,`is_review`,`gen_review_like_positive_count`),
  KEY `idx_wishlist` (`is_wish_list`,`user_id`),
  KEY `gen_subtype_id` (`gen_subtype_id`,`gen_state_user`,`format_id`,`product_id`,`rating`),
  KEY `idx_is_displayed_date_last_update` (`is_displayed`,`date_last_update`),
  KEY `idx_parent_2_id` (`parent_2_id`) USING BTREE,
  KEY `idx_parent_1_id` (`parent_1_id`,`user_id`,`absolute_level`),
  KEY `user_id` (`user_id`,`is_current`),
  KEY `is_review` (`is_review`,`review_hits`)
) ENGINE=TokuDB AUTO_INCREMENT=100081037 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_contact`
--

CREATE TABLE `sc_contact` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `subtype_id` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Type of contact (person or company)',
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `label` varchar(250) DEFAULT NULL COMMENT 'Displayed name. Generated from sc_index_param.',
  `contact_id_merged_to` int(10) unsigned DEFAULT NULL,
  `gen_year_of_birth` date DEFAULT NULL COMMENT 'Year of birth. Generated from sc_index_param.',
  `gen_year_of_death` date DEFAULT NULL COMMENT 'Year of death. Generated from sc_index_param.',
  `gen_product_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Based on products associated. Generated from sc_index_param.',
  `gen_collection_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Based on products associated stored in collection. Generated from sc_user_product.',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `flag_gen` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `json` text,
  `has_picture` int(3) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `fk_subtype_id` (`subtype_id`) USING BTREE,
  KEY `fk_id_subtype_id` (`id`,`subtype_id`),
  KEY `fk_label` (`label`) USING BTREE,
  KEY `idx_subtype_id_label` (`subtype_id`,`label`),
  KEY `idx_collection_count` (`gen_collection_count`) USING BTREE,
  KEY `idx_flag_gen_state` (`flag_gen`,`state`)
) ENGINE=TokuDB AUTO_INCREMENT=3179479 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_contact_blacklist`
--

CREATE TABLE `sc_contact_blacklist` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=1918916 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_contact_catchall`
--

CREATE TABLE `sc_contact_catchall` (
  `contact_id` int(11) NOT NULL,
  `catchall` varchar(500) DEFAULT NULL,
  `nb_books` int(10) DEFAULT NULL,
  PRIMARY KEY (`contact_id`),
  KEY `ix_catchall` (`catchall`(255)) USING HASH
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_country`
--

CREATE TABLE `sc_country` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(128) NOT NULL DEFAULT '' COMMENT 'Humanized country name.',
  `iso_3166` char(6) DEFAULT '' COMMENT 'Country code ISO 3166.',
  `zip_country_id` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `_old_code` varchar(4) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_country__label` (`label`) USING BTREE,
  KEY `idx_country__iso_3166` (`iso_3166`),
  KEY `migration_old_code` (`_old_code`),
  KEY `fk_zip_country_id` (`zip_country_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=260 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_debug_truncate`
--

CREATE TABLE `sc_debug_truncate` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `collection_id` int(10) unsigned DEFAULT NULL,
  `shout_id` int(10) unsigned DEFAULT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `review` text,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=2240764 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_dict`
--

CREATE TABLE `sc_dict` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `related_to` varchar(30) NOT NULL,
  `label` varchar(50) DEFAULT NULL,
  `query` varchar(300) DEFAULT NULL COMMENT 'Requête Sql liée',
  `is_i18n` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `description` varchar(200) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=93 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_dynamic_element`
--

CREATE TABLE `sc_dynamic_element` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `capping` int(10) unsigned NOT NULL DEFAULT '0',
  `capping_period` int(10) unsigned DEFAULT '0',
  `state` tinyint(4) DEFAULT '0' COMMENT '0/ Pending. 1/ Admin only 2/ Active.',
  `integrator_user_id` int(10) DEFAULT NULL,
  `guest_user_id` int(11) DEFAULT NULL,
  `element_template_id` int(10) unsigned NOT NULL,
  `ad_campaign_id` int(10) unsigned DEFAULT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `goal` int(10) unsigned DEFAULT NULL,
  `img_base_64` mediumtext,
  `json` mediumtext,
  `date_start` timestamp NULL DEFAULT NULL,
  `date_end` timestamp NULL DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_dynamic_element_ad_campaign_id` (`ad_campaign_id`),
  KEY `idx_dynamic_element_element_template_id` (`element_template_id`),
  KEY `idx_dynamic_element_product_id` (`product_id`),
  KEY `idx_dynamic_element_contact_id` (`contact_id`),
  KEY `idx_dynamic_element_user_id` (`user_id`),
  KEY `idx_dynamic_element_state_date` (`state`,`date_start`,`date_end`)
) ENGINE=TokuDB AUTO_INCREMENT=700 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_dynamic_element_rule`
--

CREATE TABLE `sc_dynamic_element_rule` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `dynamic_element_id` int(10) unsigned NOT NULL,
  `dynamic_rule_id` int(10) unsigned NOT NULL,
  `proportion_of_sharing` int(11) DEFAULT '0',
  `capping` int(11) DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `dynamic_element_id` (`dynamic_element_id`),
  KEY `dynamic_rule_id` (`dynamic_rule_id`)
) ENGINE=TokuDB AUTO_INCREMENT=11202 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_dynamic_position`
--

CREATE TABLE `sc_dynamic_position` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `position` varchar(100) NOT NULL DEFAULT '',
  `state` tinyint(4) DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_dynamic_rule`
--

CREATE TABLE `sc_dynamic_rule` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `state` tinyint(4) DEFAULT '0',
  `dynamic_position_id` int(11) DEFAULT NULL,
  `json` mediumtext,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=61 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_element_template`
--

CREATE TABLE `sc_element_template` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `json` mediumtext,
  `campaign_id` int(11) DEFAULT NULL,
  `dynamic_position_id` int(11) DEFAULT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `template` varchar(100) NOT NULL,
  `tag` varchar(100) NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=511 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_facebook_action`
--

CREATE TABLE `sc_facebook_action` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `tag` varchar(255) NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tag` (`tag`)
) ENGINE=TokuDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_facebook_past_sync_task`
--

CREATE TABLE `sc_facebook_past_sync_task` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned DEFAULT NULL,
  `state` tinyint(3) NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_state` (`state`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=20442 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_factoid`
--

CREATE TABLE `sc_factoid` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_failure_email`
--

CREATE TABLE `sc_failure_email` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(128) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=TokuDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_faq`
--

CREATE TABLE `sc_faq` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `date_creation` timestamp NULL DEFAULT NULL,
  `user_id_creation` int(10) unsigned DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id_last_update` int(10) unsigned DEFAULT NULL,
  `date_validation` timestamp NULL DEFAULT NULL,
  `user_id_validation` int(10) unsigned DEFAULT NULL,
  `question` text NOT NULL COMMENT 'Titre de l''article.',
  `answer` text COMMENT 'Article',
  `state` tinyint(4) DEFAULT '0' COMMENT '0/ Not published. 1/ Published.',
  `gen_like_nb` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Number of comments. Generated from sc_comment.',
  `hits_nb` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_user_id_validation` (`user_id_validation`) USING BTREE,
  KEY `fk_user_id_last_update` (`user_id_last_update`) USING BTREE,
  KEY `fk_user_id_creation` (`user_id_creation`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=157 DEFAULT CHARSET=utf8 COMMENT='Articles du blog.' `compression`='tokudb_small';

--
-- Table structure for table `sc_faq_like`
--

CREATE TABLE `sc_faq_like` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `faq_id` int(10) unsigned NOT NULL,
  `rating` tinyint(4) NOT NULL DEFAULT '0',
  `user_id` int(10) unsigned DEFAULT NULL,
  `faq_like_type_id` tinyint(3) unsigned DEFAULT NULL,
  `ip_user` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_faq_like__user_id` (`user_id`) USING BTREE,
  KEY `fk_faq_like__faq_like_type_id` (`faq_like_type_id`) USING BTREE,
  KEY `fk_faq_like__faq_id` (`faq_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=4705 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_faq_like_type`
--

CREATE TABLE `sc_faq_like_type` (
  `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_faq_tag`
--

CREATE TABLE `sc_faq_tag` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(50) NOT NULL DEFAULT '',
  `position` int(10) unsigned NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_faq_tag_index`
--

CREATE TABLE `sc_faq_tag_index` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `faq_id` int(10) unsigned NOT NULL,
  `faq_tag_id` int(10) unsigned NOT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_feed`
--

CREATE TABLE `sc_feed` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `user_id_scout` int(10) unsigned DEFAULT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `collection_id` int(10) unsigned DEFAULT NULL,
  `type_id` tinyint(3) unsigned DEFAULT NULL,
  `subtype_id` tinyint(3) unsigned DEFAULT NULL,
  `rating` tinyint(3) unsigned DEFAULT NULL,
  `is_shopping_list` tinyint(3) unsigned DEFAULT NULL,
  `is_wish_list` tinyint(3) unsigned DEFAULT NULL,
  `is_wish_list_bis` tinyint(3) unsigned DEFAULT NULL,
  `is_recommend` tinyint(3) unsigned DEFAULT NULL,
  `is_review` tinyint(3) unsigned DEFAULT NULL,
  `is_current` tinyint(3) unsigned DEFAULT NULL,
  `list_id_product` varchar(100) DEFAULT NULL,
  `list_id_list` int(10) unsigned DEFAULT NULL,
  `is_like` tinyint(3) unsigned DEFAULT NULL,
  `is_comment_list` tinyint(3) unsigned DEFAULT NULL,
  `is_comment_review` tinyint(3) unsigned DEFAULT NULL,
  `feed_id_related` int(10) unsigned DEFAULT NULL,
  `format_id` int(10) unsigned DEFAULT NULL,
  `badge_id` int(10) unsigned DEFAULT NULL,
  `param_index_id_trailer` int(10) unsigned DEFAULT NULL,
  `message_id` int(10) unsigned DEFAULT NULL,
  `shout_id` int(10) unsigned DEFAULT NULL,
  `forum_topic_id` int(10) unsigned DEFAULT NULL,
  `is_archive` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `application_id` int(10) unsigned DEFAULT NULL,
  `gen_like_count` int(10) unsigned DEFAULT NULL,
  `gen_comment_count` int(10) unsigned DEFAULT NULL,
  `gen_message_topic_id` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `flag_gen` tinyint(3) NOT NULL DEFAULT '0',
  `host` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`,`is_archive`),
  KEY `idx_product` (`product_id`,`date_creation`) USING BTREE,
  KEY `idx_product_user` (`product_id`,`user_id`,`date_creation`) USING BTREE,
  KEY `idx_user_product` (`user_id`,`product_id`,`date_creation`) USING BTREE,
  KEY `idx_user_id` (`user_id`,`date_creation`) USING BTREE,
  KEY `idx_shout_id` (`shout_id`) USING BTREE,
  KEY `idx_contact_id` (`contact_id`),
  KEY `idx_product_2` (`product_id`,`date_last_update`),
  KEY `product_id` (`product_id`,`user_id`,`date_last_update`),
  KEY `idx_flag_gen` (`flag_gen`,`is_archive`,`host`,`date_last_update`),
  KEY `idx_user_id_is_archive` (`user_id`,`is_archive`,`date_last_update`),
  KEY `date_last_update` (`date_last_update`)
) ENGINE=TokuDB AUTO_INCREMENT=106634912 DEFAULT CHARSET=utf8 `compression`='tokudb_small'
/*!50100 PARTITION BY LIST (is_archive)
(PARTITION ARCHIVED VALUES IN (1) ENGINE = TokuDB,
 PARTITION LIVE VALUES IN (0) ENGINE = TokuDB) */;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `pt_osc_sc_2_sc_feed_ins` AFTER INSERT ON `sc_2`.`sc_feed` FOR EACH ROW REPLACE INTO `sc_2`.`_sc_feed_new` (`id`, `user_id`, `user_id_scout`, `product_id`, `contact_id`, `collection_id`, `type_id`, `subtype_id`, `rating`, `is_shopping_list`, `is_wish_list`, `is_wish_list_bis`, `is_recommend`, `is_review`, `is_current`, `list_id_product`, `list_id_list`, `is_like`, `is_comment_list`, `is_comment_review`, `feed_id_related`, `format_id`, `badge_id`, `param_index_id_trailer`, `message_id`, `shout_id`, `forum_topic_id`, `is_archive`, `application_id`, `gen_like_count`, `gen_comment_count`, `gen_message_topic_id`, `date_creation`, `date_last_update`, `flag_gen`, `host`) VALUES (NEW.`id`, NEW.`user_id`, NEW.`user_id_scout`, NEW.`product_id`, NEW.`contact_id`, NEW.`collection_id`, NEW.`type_id`, NEW.`subtype_id`, NEW.`rating`, NEW.`is_shopping_list`, NEW.`is_wish_list`, NEW.`is_wish_list_bis`, NEW.`is_recommend`, NEW.`is_review`, NEW.`is_current`, NEW.`list_id_product`, NEW.`list_id_list`, NEW.`is_like`, NEW.`is_comment_list`, NEW.`is_comment_review`, NEW.`feed_id_related`, NEW.`format_id`, NEW.`badge_id`, NEW.`param_index_id_trailer`, NEW.`message_id`, NEW.`shout_id`, NEW.`forum_topic_id`, NEW.`is_archive`, NEW.`application_id`, NEW.`gen_like_count`, NEW.`gen_comment_count`, NEW.`gen_message_topic_id`, NEW.`date_creation`, NEW.`date_last_update`, NEW.`flag_gen`, NEW.`host`) */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `pt_osc_sc_2_sc_feed_upd` AFTER UPDATE ON `sc_2`.`sc_feed` FOR EACH ROW REPLACE INTO `sc_2`.`_sc_feed_new` (`id`, `user_id`, `user_id_scout`, `product_id`, `contact_id`, `collection_id`, `type_id`, `subtype_id`, `rating`, `is_shopping_list`, `is_wish_list`, `is_wish_list_bis`, `is_recommend`, `is_review`, `is_current`, `list_id_product`, `list_id_list`, `is_like`, `is_comment_list`, `is_comment_review`, `feed_id_related`, `format_id`, `badge_id`, `param_index_id_trailer`, `message_id`, `shout_id`, `forum_topic_id`, `is_archive`, `application_id`, `gen_like_count`, `gen_comment_count`, `gen_message_topic_id`, `date_creation`, `date_last_update`, `flag_gen`, `host`) VALUES (NEW.`id`, NEW.`user_id`, NEW.`user_id_scout`, NEW.`product_id`, NEW.`contact_id`, NEW.`collection_id`, NEW.`type_id`, NEW.`subtype_id`, NEW.`rating`, NEW.`is_shopping_list`, NEW.`is_wish_list`, NEW.`is_wish_list_bis`, NEW.`is_recommend`, NEW.`is_review`, NEW.`is_current`, NEW.`list_id_product`, NEW.`list_id_list`, NEW.`is_like`, NEW.`is_comment_list`, NEW.`is_comment_review`, NEW.`feed_id_related`, NEW.`format_id`, NEW.`badge_id`, NEW.`param_index_id_trailer`, NEW.`message_id`, NEW.`shout_id`, NEW.`forum_topic_id`, NEW.`is_archive`, NEW.`application_id`, NEW.`gen_like_count`, NEW.`gen_comment_count`, NEW.`gen_message_topic_id`, NEW.`date_creation`, NEW.`date_last_update`, NEW.`flag_gen`, NEW.`host`) */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `pt_osc_sc_2_sc_feed_del` AFTER DELETE ON `sc_2`.`sc_feed` FOR EACH ROW DELETE IGNORE FROM `sc_2`.`_sc_feed_new` WHERE `sc_2`.`_sc_feed_new`.`id` <=> OLD.`id` AND `sc_2`.`_sc_feed_new`.`is_archive` <=> OLD.`is_archive` */;;
DELIMITER ;

--
-- Table structure for table `sc_feedback`
--

CREATE TABLE `sc_feedback` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `feedback_type_id` tinyint(3) unsigned DEFAULT NULL,
  `param_index_id` int(10) unsigned DEFAULT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `url` varchar(600) DEFAULT NULL,
  `description` text,
  `extract_header` text,
  `extract_browser` text,
  `state` tinyint(4) DEFAULT '0',
  `rating` tinyint(4) DEFAULT NULL,
  `_old_id_feedback` int(10) unsigned DEFAULT NULL,
  `_old_id_feedback_product` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_feedback_type_id` (`feedback_type_id`),
  KEY `idx_state` (`state`),
  KEY `idx_product_id_state` (`product_id`,`state`)
) ENGINE=TokuDB AUTO_INCREMENT=154804 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_feedback_type`
--

CREATE TABLE `sc_feedback_type` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_forbidden_text`
--

CREATE TABLE `sc_forbidden_text` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `forbidden_text_type_id` tinyint(3) unsigned NOT NULL,
  `value` text NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=286 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_forbidden_text_type`
--

CREATE TABLE `sc_forbidden_text_type` (
  `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(20) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_format`
--

CREATE TABLE `sc_format` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `subtype_id` tinyint(3) unsigned NOT NULL,
  `subtype_id_target` tinyint(3) unsigned NOT NULL,
  `label` varchar(40) DEFAULT '',
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `_old_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=157 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_forum_alert`
--

CREATE TABLE `sc_forum_alert` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `forum_topic_id` int(10) unsigned DEFAULT NULL,
  `forum_message_id` int(10) unsigned DEFAULT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `alert_category` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `description` text,
  `state` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `user_id_related` int(10) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=210 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_forum_beta`
--

CREATE TABLE `sc_forum_beta` (
  `user_id` int(11) unsigned NOT NULL,
  PRIMARY KEY (`user_id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_forum_message`
--

CREATE TABLE `sc_forum_message` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `forum_topic_id` int(11) unsigned NOT NULL,
  `parent_id` int(11) unsigned DEFAULT NULL,
  `user_id` int(11) unsigned DEFAULT NULL,
  `message` text NOT NULL,
  `level` tinyint(3) unsigned DEFAULT '1',
  `up_vote_count` int(10) DEFAULT '0',
  `down_vote_count` int(10) DEFAULT '0',
  `reply_count` int(10) unsigned DEFAULT '0',
  `score` int(10) DEFAULT '0',
  `state` tinyint(3) NOT NULL DEFAULT '1',
  `ip` int(10) unsigned DEFAULT NULL,
  `gen_state_user` tinyint(1) NOT NULL DEFAULT '1',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_topic_id` (`forum_topic_id`),
  KEY `idx_parent_state` (`parent_id`,`gen_state_user`)
) ENGINE=TokuDB AUTO_INCREMENT=31462 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_forum_message_vote`
--

CREATE TABLE `sc_forum_message_vote` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `message_id` int(10) unsigned NOT NULL,
  `rating` tinyint(1) NOT NULL,
  `gen_state_user` tinyint(1) NOT NULL DEFAULT '1',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unq_user_message` (`user_id`,`message_id`),
  KEY `idx_topic` (`message_id`),
  KEY `idx_user` (`user_id`)
) ENGINE=TokuDB AUTO_INCREMENT=44219 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_forum_related`
--

CREATE TABLE `sc_forum_related` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `forum_topic_id` int(11) unsigned NOT NULL,
  `related_id` int(11) unsigned DEFAULT NULL,
  `subtype_id` int(5) unsigned DEFAULT NULL,
  `related_group` varchar(50) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `related_id` (`related_id`,`forum_topic_id`),
  KEY `forum_topic_id` (`forum_topic_id`) `CLUSTERING`=YES
) ENGINE=TokuDB AUTO_INCREMENT=10211 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_forum_topic`
--

CREATE TABLE `sc_forum_topic` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) unsigned NOT NULL,
  `title` varchar(250) NOT NULL DEFAULT '',
  `slug` varchar(250) NOT NULL DEFAULT '',
  `message` text NOT NULL,
  `message_source` text NOT NULL,
  `up_vote_count` int(5) DEFAULT '0',
  `down_vote_count` int(5) DEFAULT '0',
  `score` int(5) NOT NULL DEFAULT '0',
  `state` tinyint(3) NOT NULL DEFAULT '1',
  `official` tinyint(3) DEFAULT '0',
  `hidden` tinyint(3) DEFAULT '0',
  `ip` int(10) unsigned DEFAULT NULL,
  `json` text,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `date_message_last_update` timestamp NULL DEFAULT NULL,
  `gen_subtype_id` tinyint(3) unsigned NOT NULL,
  `gen_type_id` tinyint(3) unsigned NOT NULL,
  `gen_message_count` int(5) NOT NULL DEFAULT '0',
  `gen_hit` int(10) NOT NULL DEFAULT '0',
  `gen_media_type_id` int(3) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `gen_subtype_id` (`gen_subtype_id`,`state`,`score`),
  KEY `state` (`state`,`date_creation`) `CLUSTERING`=YES
) ENGINE=TokuDB AUTO_INCREMENT=7978 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_forum_topic_vote`
--

CREATE TABLE `sc_forum_topic_vote` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `forum_topic_id` int(10) unsigned NOT NULL,
  `rating` tinyint(1) NOT NULL,
  `gen_state_user` tinyint(1) NOT NULL DEFAULT '1',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unq_user_forum_topic` (`user_id`,`forum_topic_id`),
  KEY `idx_topic` (`forum_topic_id`),
  KEY `idx_user` (`user_id`)
) ENGINE=TokuDB AUTO_INCREMENT=51543 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_forum_user_notification`
--

CREATE TABLE `sc_forum_user_notification` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `parent_message_id` int(10) unsigned DEFAULT NULL,
  `forum_topic_id` int(10) unsigned NOT NULL,
  `state` tinyint(3) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unq_user_parent_message_forum_topic` (`user_id`,`parent_message_id`,`forum_topic_id`),
  KEY `parent_message_id` (`parent_message_id`,`forum_topic_id`,`state`),
  KEY `forum_topic_id` (`forum_topic_id`) `CLUSTERING`=1
) ENGINE=TokuDB AUTO_INCREMENT=72734 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_franchise`
--

CREATE TABLE `sc_franchise` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `subtype_id` int(10) NOT NULL,
  `label` varchar(200) NOT NULL DEFAULT '',
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `gen_product_count` int(10) unsigned NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `user_id_creation` int(10) unsigned DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id_last_update` int(10) unsigned DEFAULT NULL,
  `date_validation` timestamp NULL DEFAULT NULL,
  `user_id_validation` int(10) unsigned DEFAULT NULL,
  `_old_id` int(10) unsigned DEFAULT NULL,
  `franchise_id_merged_to` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `migration_old_id` (`_old_id`)
) ENGINE=TokuDB AUTO_INCREMENT=16478 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_gen_collected_product_contact`
--

CREATE TABLE `sc_gen_collected_product_contact` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(10) unsigned NOT NULL,
  `product_collection_count` int(10) unsigned NOT NULL DEFAULT '0',
  `ranking` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_contact_collection_count` (`contact_id`,`product_collection_count`,`id`)
) ENGINE=TokuDB AUTO_INCREMENT=1765717 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_gen_contact_affinity`
--

CREATE TABLE `sc_gen_contact_affinity` (
  `contact_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `contact_id_related` int(10) unsigned NOT NULL,
  `product_count` int(10) unsigned NOT NULL DEFAULT '0',
  `position` smallint(5) unsigned DEFAULT NULL,
  `json` varchar(400) NOT NULL DEFAULT '',
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`contact_id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_gen_contact_fr_FR`
--

CREATE TABLE `sc_gen_contact_fr_FR` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `type_id` tinyint(3) unsigned NOT NULL,
  `subtype_id` tinyint(3) unsigned NOT NULL,
  `label` varchar(250) NOT NULL DEFAULT '',
  `slug` varchar(128) DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `date_of_death` date DEFAULT NULL,
  `collection_count` int(10) unsigned NOT NULL DEFAULT '0',
  `product_count` int(10) unsigned NOT NULL DEFAULT '0',
  `gen_like_count` int(10) unsigned NOT NULL DEFAULT '0',
  `gen_like_positive_count` int(10) unsigned NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `json` text,
  PRIMARY KEY (`id`),
  KEY `idx_label` (`label`),
  KEY `collection_count` (`collection_count`)
) ENGINE=TokuDB AUTO_INCREMENT=3179479 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_gen_contact_product`
--

CREATE TABLE `sc_gen_contact_product` (
  `contact_id` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `contact_subtype_id` tinyint(4) NOT NULL,
  PRIMARY KEY (`contact_id`,`product_id`),
  UNIQUE KEY `idex_product_contact_subtype` (`product_id`,`contact_id`,`contact_subtype_id`),
  KEY `product_id` (`product_id`,`contact_subtype_id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_gen_feed_imported`
--

CREATE TABLE `sc_gen_feed_imported` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_user_id_unique` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=236623 DEFAULT CHARSET=utf8;

--
-- Table structure for table `sc_gen_feed_new`
--

CREATE TABLE `sc_gen_feed_new` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `feed_id` int(10) unsigned NOT NULL,
  `user_id_scout` int(10) unsigned DEFAULT NULL,
  `date_order` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_unique` (`user_id`,`feed_id`),
  KEY `idx_user` (`user_id`,`date_order`),
  KEY `idx_feed` (`feed_id`,`date_order`),
  KEY `idx_date_update` (`date_last_update`),
  KEY `idx_user_scout` (`user_id_scout`,`user_id`)
) ENGINE=TokuDB AUTO_INCREMENT=2662947060 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_gen_feed_new_old`
--

CREATE TABLE `sc_gen_feed_new_old` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `feed_id` int(10) unsigned NOT NULL,
  `user_id_scout` int(10) unsigned DEFAULT NULL,
  `date_order` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_unique` (`user_id`,`feed_id`),
  KEY `idx_user` (`user_id`,`date_order`),
  KEY `idx_feed` (`feed_id`,`date_order`),
  KEY `idx_date_update` (`date_last_update`),
  KEY `idx_user_scout` (`user_id_scout`,`user_id`)
) ENGINE=TokuDB AUTO_INCREMENT=2413298228 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_gen_feed_sponsored`
--

CREATE TABLE `sc_gen_feed_sponsored` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `feed_id` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_unique` (`feed_id`),
  KEY `idx_product` (`product_id`),
  KEY `idx_user` (`user_id`)
) ENGINE=TokuDB AUTO_INCREMENT=2350787 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_gen_log_task`
--

CREATE TABLE `sc_gen_log_task` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `task_type_id` int(10) unsigned NOT NULL,
  `target_subtype_id` int(10) unsigned DEFAULT NULL,
  `target_id` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `count` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_task_type_id_target_subtype_id_target_id` (`task_type_id`,`target_subtype_id`,`target_id`)
) ENGINE=TokuDB AUTO_INCREMENT=3006123 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_gen_param_index_fr_FR`
--

CREATE TABLE `sc_gen_param_index_fr_FR` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `franchise_id` int(10) unsigned DEFAULT NULL,
  `article_id` int(10) unsigned DEFAULT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `format_id` int(10) unsigned DEFAULT NULL,
  `list_id` int(10) unsigned DEFAULT NULL,
  `badge_id` int(10) unsigned DEFAULT NULL,
  `tag_id` int(10) unsigned DEFAULT NULL,
  `param_id` int(10) unsigned NOT NULL DEFAULT '0',
  `count_like` int(10) unsigned NOT NULL DEFAULT '0',
  `json` text,
  `gen_subtype_id` tinyint(3) unsigned NOT NULL,
  `gen_type_id` tinyint(3) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_product_id` (`product_id`) USING BTREE,
  KEY `idx_contact_id` (`contact_id`) USING BTREE,
  KEY `idx_franchise_id` (`franchise_id`) USING BTREE,
  KEY `idx_article_id` (`article_id`) USING BTREE,
  KEY `idx_user_id` (`user_id`) USING BTREE,
  KEY `idx_format_id` (`format_id`) USING BTREE,
  KEY `idx_list_id` (`list_id`) USING BTREE,
  KEY `idx_badge_id` (`badge_id`) USING BTREE,
  KEY `idx_tag_id` (`tag_id`) USING BTREE,
  KEY `idx_param_id` (`param_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=370541572 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_gen_product_fr_FR`
--

CREATE TABLE `sc_gen_product_fr_FR` (
  `id` int(10) unsigned NOT NULL DEFAULT '0',
  `id_big` bigint(20) unsigned DEFAULT NULL,
  `type_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `subtype_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `category_param_select_id` smallint(5) DEFAULT NULL,
  `title` varchar(128) DEFAULT NULL COMMENT 'Original title.',
  `original_title` varchar(128) DEFAULT '' COMMENT 'Title in french.',
  `slug` varchar(128) DEFAULT NULL COMMENT 'Title url encoded.',
  `year_of_production` smallint(5) DEFAULT NULL,
  `date_release` date DEFAULT NULL COMMENT 'Release date for France.',
  `rating` smallint(5) unsigned DEFAULT NULL,
  `rating_average` smallint(5) DEFAULT NULL,
  `collection_count` int(10) unsigned NOT NULL DEFAULT '0',
  `rating_count` int(10) unsigned DEFAULT '0',
  `recommend_count` int(10) unsigned NOT NULL DEFAULT '0',
  `current_count` int(10) DEFAULT '0',
  `done_count` int(10) DEFAULT '0',
  `wish_list_count` int(10) unsigned NOT NULL DEFAULT '0',
  `shopping_list_count` int(10) unsigned NOT NULL DEFAULT '0',
  `review_count` int(10) unsigned NOT NULL DEFAULT '0',
  `list_count` int(10) unsigned NOT NULL DEFAULT '0',
  `json` text COMMENT 'All the product information in JSON format.',
  `json_full` mediumtext,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `venue_count` smallint(5) unsigned DEFAULT NULL,
  `parent_1_id` int(10) unsigned DEFAULT NULL,
  `parent_2_id` int(10) unsigned DEFAULT NULL,
  `level_1` smallint(5) unsigned DEFAULT NULL,
  `level_2` text,
  `absolute_level` smallint(5) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_big_id` (`id_big`),
  KEY `idx_top_111` (`type_id`,`rating_count`,`rating`),
  KEY `idx_seeks` (`subtype_id`,`date_last_update`),
  KEY `idx_date_last_update` (`date_last_update`),
  KEY `idx_collection_count_date_release` (`date_release`,`collection_count`) USING BTREE,
  KEY `idx_collection_count` (`collection_count`) USING BTREE,
  KEY `type_id` (`type_id`,`collection_count`),
  KEY `idx_subtype_collection_count` (`subtype_id`,`collection_count`),
  KEY `idx_subtype_date_release` (`subtype_id`,`date_release`),
  KEY `idx_venue_count` (`venue_count`),
  KEY `idx_parent_1_id` (`parent_1_id`) USING BTREE,
  KEY `idx_parent_2_id` (`parent_2_id`) USING BTREE,
  KEY `idx_level_1` (`level_1`) USING BTREE,
  KEY `subtype_id` (`id`,`subtype_id`,`rating_count`),
  KEY `subtype_id_2` (`subtype_id`,`parent_1_id`,`absolute_level`),
  KEY `subtype_id_3` (`subtype_id`,`parent_2_id`),
  KEY `idx_year_of_production` (`year_of_production`,`category_param_select_id`),
  KEY `subtype_id_4` (`subtype_id`,`wish_list_count`),
  KEY `type_id_3` (`type_id`,`subtype_id`,`collection_count`),
  KEY `type_id_2` (`type_id`,`date_release`) `CLUSTERING`=YES
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_gen_product_timelapse_fr_FR`
--

CREATE TABLE `sc_gen_product_timelapse_fr_FR` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `type_id` tinyint(3) unsigned NOT NULL,
  `subtype_id` tinyint(3) unsigned NOT NULL,
  `year_of_production` smallint(4) unsigned NOT NULL,
  `decade` smallint(4) unsigned NOT NULL,
  `century` smallint(4) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_decade` (`id`,`decade`),
  KEY `idx_century` (`id`,`century`),
  KEY `idx_decade2` (`decade`)
) ENGINE=TokuDB AUTO_INCREMENT=8126263 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_gen_test_model`
--

CREATE TABLE `sc_gen_test_model` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `type_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `subtype_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `title` varchar(128) DEFAULT NULL COMMENT 'Original title.',
  `json` mediumtext COMMENT 'All the model information in JSON format.',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_gender`
--

CREATE TABLE `sc_gender` (
  `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(128) NOT NULL DEFAULT '' COMMENT 'Humanized sexe name.',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_i18n`
--

CREATE TABLE `sc_i18n` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(6) NOT NULL DEFAULT '' COMMENT 'Code RFC 3066',
  `label` varchar(100) NOT NULL DEFAULT '',
  `state` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_i18n__code` (`code`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_keyval`
--

CREATE TABLE `sc_keyval` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `reference` varchar(30) NOT NULL DEFAULT '',
  `label` varchar(100) NOT NULL DEFAULT '',
  `type_data` varchar(20) NOT NULL DEFAULT '',
  `value` varchar(100) DEFAULT NULL,
  `value_int` int(10) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_reference` (`reference`)
) ENGINE=TokuDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_language`
--

CREATE TABLE `sc_language` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `iso_6391` varchar(3) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=67 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_like`
--

CREATE TABLE `sc_like` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
  `gen_user_id_related` int(10) unsigned DEFAULT NULL,
  `list_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `collection_id_review` int(10) unsigned DEFAULT NULL,
  `list_product_id` int(10) unsigned DEFAULT NULL,
  `format_id` int(10) unsigned DEFAULT NULL,
  `message_id` int(10) unsigned DEFAULT NULL,
  `tag_id` int(10) unsigned DEFAULT NULL,
  `factoid_id` int(10) unsigned DEFAULT NULL,
  `param_index_id` int(10) unsigned DEFAULT NULL,
  `feed_id` int(10) unsigned DEFAULT NULL,
  `rating` tinyint(4) NOT NULL,
  `gen_state_user` tinyint(4) DEFAULT '1',
  `shout_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_collection_id` (`collection_id_review`),
  KEY `idx_user_interaction` (`user_id`,`gen_user_id_related`),
  KEY `idx_user_contact` (`user_id`,`contact_id`),
  KEY `idx_user_list_date_creation` (`user_id`,`list_id`,`date_creation`),
  KEY `idx_list` (`list_id`),
  KEY `idx_list_product` (`list_product_id`),
  KEY `idx_contact_id` (`contact_id`),
  KEY `idx_date_creation` (`date_creation`),
  KEY `idx_feed` (`feed_id`,`user_id`) USING BTREE,
  KEY `idx_user_feed` (`user_id`,`feed_id`),
  KEY `idx_param_index` (`param_index_id`,`user_id`) USING BTREE,
  KEY `idx_shout_id` (`shout_id`,`user_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=9517522 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_list`
--

CREATE TABLE `sc_list` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `parent_id` int(10) unsigned DEFAULT NULL,
  `allow_child` tinyint(3) unsigned DEFAULT NULL,
  `subtype_id` tinyint(3) unsigned DEFAULT NULL,
  `gen_type_id_related` tinyint(3) unsigned DEFAULT NULL,
  `subtype_id_related` tinyint(3) unsigned DEFAULT NULL,
  `label` varchar(200) DEFAULT NULL,
  `slug` varchar(200) DEFAULT NULL,
  `description` text,
  `is_ordered` tinyint(3) NOT NULL DEFAULT '1',
  `is_public` tinyint(3) NOT NULL DEFAULT '1',
  `comment_privacy` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `limitation` int(10) unsigned DEFAULT NULL,
  `is_auto_thumbnail` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `is_spoiler` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_spoiler_admin` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `copyright` varchar(200) DEFAULT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `state_validation` tinyint(4) NOT NULL DEFAULT '0',
  `user_id_creation` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `user_id_last_update` int(10) unsigned DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id_validation` int(10) unsigned DEFAULT NULL,
  `date_validation` timestamp NULL DEFAULT NULL,
  `date_last_action` timestamp NULL DEFAULT NULL,
  `gen_media_id` int(10) unsigned DEFAULT NULL,
  `gen_count` int(10) unsigned NOT NULL DEFAULT '0',
  `gen_comment_count` int(10) unsigned NOT NULL DEFAULT '0',
  `gen_like_count` int(10) unsigned NOT NULL DEFAULT '0',
  `gen_like_positive_count` int(10) unsigned NOT NULL DEFAULT '0',
  `gen_state_user` tinyint(4) NOT NULL DEFAULT '1',
  `json` text,
  `flag_gen` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `hits` int(10) unsigned NOT NULL DEFAULT '0',
  `gen_child_count` int(10) unsigned DEFAULT NULL,
  `gen_child_item_count` int(10) unsigned DEFAULT NULL,
  `description_child` text,
  `state_selection` smallint(6) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `fk_gen_type_id_related` (`subtype_id_related`) USING BTREE,
  KEY `fk_user_id_creation` (`user_id_creation`) USING BTREE,
  KEY `fk_parent_id` (`parent_id`,`user_id_creation`) USING BTREE,
  KEY `idx_subtype_id` (`subtype_id`,`gen_type_id_related`,`state`,`parent_id`),
  KEY `idx_gen_type_id` (`gen_type_id_related`,`state`,`parent_id`,`id`,`gen_like_positive_count`),
  KEY `subtype_id_related` (`subtype_id_related`,`state`,`parent_id`,`subtype_id`,`gen_child_count`),
  KEY `fk_subtype_id` (`subtype_id`,`gen_child_count`),
  KEY `date_creation` (`date_creation`)
) ENGINE=TokuDB AUTO_INCREMENT=1393786 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_list_alias`
--

CREATE TABLE `sc_list_alias` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `alias` varchar(50) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_list_blacklist`
--

CREATE TABLE `sc_list_blacklist` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `state` tinyint(4) NOT NULL DEFAULT '1',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_modification` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=1342386 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_list_category`
--

CREATE TABLE `sc_list_category` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `list_id` int(11) NOT NULL,
  `category1_id` smallint(6) NOT NULL,
  `category2_id` smallint(6) NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=1024 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_list_product`
--

CREATE TABLE `sc_list_product` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `list_id` int(10) unsigned NOT NULL DEFAULT '0',
  `product_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `position` int(10) unsigned DEFAULT '0',
  `description` varchar(2500) DEFAULT NULL,
  `gen_over_limitation` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `gen_like_count` int(10) unsigned DEFAULT NULL,
  `gen_like_positive_count` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_list_id` (`list_id`) USING BTREE,
  KEY `contact_id` (`contact_id`),
  KEY `fk_product_id` (`product_id`,`list_id`),
  KEY `product_id` (`product_id`,`position`)
) ENGINE=TokuDB AUTO_INCREMENT=19117073 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_list_product_blacklist`
--

CREATE TABLE `sc_list_product_blacklist` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `list_id` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `state` int(3) NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_list_product_state` (`list_id`,`product_id`,`state`),
  KEY `idx_list_state` (`list_id`,`state`)
) ENGINE=TokuDB AUTO_INCREMENT=2493 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_list_product_rank`
--

CREATE TABLE `sc_list_product_rank` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `list_id` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `rank` int(10) unsigned NOT NULL,
  `json` text,
  `date_rank` date NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `diff_rank` int(10) NOT NULL DEFAULT '0',
  `is_archive` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_unique` (`list_id`,`product_id`,`rank`,`date_rank`),
  KEY `product_id` (`product_id`,`is_archive`),
  KEY `idx_date_rank` (`date_rank`),
  KEY `idx_list_archive` (`list_id`,`is_archive`)
) ENGINE=TokuDB AUTO_INCREMENT=38838425 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT `compression`='tokudb_small';

--
-- Table structure for table `sc_live`
--

CREATE TABLE `sc_live` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `live_type_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `type_id` tinyint(3) unsigned DEFAULT NULL,
  `type_id_related` tinyint(3) unsigned DEFAULT NULL,
  `gen_col_count` tinyint(3) unsigned DEFAULT NULL,
  `json` text NOT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_publication` timestamp NULL DEFAULT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_date_day` (`user_id`),
  KEY `idx_state` (`state`,`user_id`),
  KEY `idx_live_type_id` (`live_type_id`),
  KEY `idx_col_count_etc` (`gen_col_count`,`state`,`user_id`,`date_publication`)
) ENGINE=TokuDB AUTO_INCREMENT=722739061 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_live_data`
--

CREATE TABLE `sc_live_data` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id_key` int(11) DEFAULT NULL,
  `type_id` int(10) unsigned DEFAULT NULL,
  `badge_id` int(10) unsigned DEFAULT NULL,
  `collection_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `list_id` int(10) unsigned DEFAULT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_collection_id` (`user_id_key`,`type_id`,`collection_id`,`date_creation`,`id`) USING BTREE,
  KEY `idx_product_id` (`user_id_key`,`type_id`,`product_id`,`date_creation`,`id`) USING BTREE,
  KEY `idx_user_id` (`user_id_key`,`type_id`,`user_id`,`date_creation`,`id`) USING BTREE,
  KEY `idx_list_id` (`user_id_key`,`type_id`,`list_id`,`date_creation`,`id`) USING BTREE,
  KEY `idx_contact_id` (`user_id_key`,`type_id`,`contact_id`,`date_creation`,`id`) USING BTREE,
  KEY `idx_badge_id` (`user_id_key`,`type_id`,`badge_id`,`date_creation`,`id`) USING BTREE,
  KEY `idx_user_id_key` (`user_id_key`,`user_id`),
  KEY `idx_date_creation` (`date_creation`)
) ENGINE=TokuDB AUTO_INCREMENT=711888381 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_live_type`
--

CREATE TABLE `sc_live_type` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `template` varchar(100) DEFAULT NULL,
  `related_to` varchar(30) DEFAULT NULL,
  `related_to_column` varchar(30) DEFAULT NULL,
  `tag` varchar(20) DEFAULT NULL,
  `is_multiple` tinyint(1) NOT NULL,
  `col_count` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `is_logged` tinyint(1) DEFAULT NULL,
  `json` text,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_tag` (`tag`)
) ENGINE=TokuDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_ad`
--

CREATE TABLE `sc_log_ad` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) unsigned DEFAULT NULL,
  `dynamic_element_id` int(11) unsigned DEFAULT NULL,
  `campaign_id` int(11) unsigned DEFAULT NULL,
  `date_creation` datetime DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `date_day` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `dynamic_element_id` (`dynamic_element_id`,`date_day`)
) ENGINE=TokuDB AUTO_INCREMENT=42397637 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_ad_event`
--

CREATE TABLE `sc_log_ad_event` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `dynamic_element_id` int(10) unsigned DEFAULT NULL,
  `notification_item_id` int(10) unsigned DEFAULT NULL,
  `ad_sponsored_feed_id` int(10) unsigned DEFAULT NULL,
  `smart_ad_creation_id` int(10) unsigned DEFAULT NULL,
  `ad_event_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `type_id` tinyint(3) unsigned DEFAULT NULL,
  `section_id` int(10) unsigned DEFAULT NULL,
  `view_id` int(10) unsigned DEFAULT NULL,
  `object_id` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `date_day` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_dynamic_element` (`dynamic_element_id`,`ad_event_id`),
  KEY `idx_sponsored_feed` (`ad_sponsored_feed_id`,`ad_event_id`),
  KEY `idx_notification_item` (`notification_item_id`,`ad_event_id`)
) ENGINE=TokuDB AUTO_INCREMENT=400732720 DEFAULT CHARSET=utf8 `compression`='tokudb_small';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`www-prod`@`%`*/ /*!50003 TRIGGER `log_ad_event_insert` BEFORE INSERT ON `sc_log_ad_event` FOR EACH ROW BEGIN
SET NEW.date_day = DATE(NEW.date_creation);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`www-prod`@`%`*/ /*!50003 TRIGGER `log_ad_event_update` BEFORE UPDATE ON `sc_log_ad_event` FOR EACH ROW BEGIN
SET NEW.date_day = DATE(NEW.date_creation);
END */;;
DELIMITER ;

--
-- Table structure for table `sc_log_api`
--

CREATE TABLE `sc_log_api` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `api_id` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `action_id` int(10) unsigned NOT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_api_id_product_id_date_creation` (`api_id`,`product_id`,`date_creation`),
  KEY `idx_api_id_date_creation` (`api_id`,`date_creation`) USING BTREE,
  KEY `contact_id` (`contact_id`,`api_id`,`date_creation`),
  KEY `idx_product_date_creation` (`product_id`,`date_creation`)
) ENGINE=TokuDB AUTO_INCREMENT=12741834 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_cron`
--

CREATE TABLE `sc_log_cron` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `end_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `state` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `execution_time` int(3) NOT NULL DEFAULT '0',
  `result` text NOT NULL,
  `log` text NOT NULL,
  `result_nb` int(10) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `name` (`name`,`state`,`start_time`),
  KEY `idx_state` (`state`)
) ENGINE=TokuDB AUTO_INCREMENT=312506201 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_elasticsearch_error`
--

CREATE TABLE `sc_log_elasticsearch_error` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(10) unsigned DEFAULT NULL,
  `collection_id` int(10) unsigned DEFAULT NULL,
  `list_product_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `list_contact_id` int(10) unsigned DEFAULT NULL,
  `list_id` int(10) unsigned DEFAULT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `franchise_id` int(10) unsigned DEFAULT NULL,
  `venue_id` int(10) unsigned DEFAULT NULL,
  `product_id_parent` int(10) unsigned DEFAULT NULL,
  `contact_id_parent` int(10) unsigned DEFAULT NULL,
  `subtype_id` tinyint(3) NOT NULL DEFAULT '0',
  `exception` text,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `value` int(3) NOT NULL,
  `state` int(3) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_product_id` (`product_id`) USING BTREE,
  KEY `idx_collection_id` (`collection_id`) USING BTREE,
  KEY `idx_list_product_id` (`list_product_id`) USING BTREE,
  KEY `idx_contact_id` (`contact_id`) USING BTREE,
  KEY `idx_list_contact_id` (`list_contact_id`) USING BTREE,
  KEY `idx_list_id` (`list_id`) USING BTREE,
  KEY `idx_user_id` (`user_id`) USING BTREE,
  KEY `idx_franchise_id` (`franchise_id`) USING BTREE,
  KEY `idx_venue_id` (`venue_id`) USING BTREE,
  KEY `idx_product_id_parent` (`product_id_parent`) USING BTREE,
  KEY `idx_contact_id_parent` (`contact_id_parent`) USING BTREE,
  KEY `idx_value` (`value`) USING BTREE,
  KEY `idx_state` (`state`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=10587 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_feed_sponsored`
--

CREATE TABLE `sc_log_feed_sponsored` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `feed_id` int(10) unsigned DEFAULT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_log_feed_sponsored__feed_id_user_id_date_creation` (`feed_id`,`user_id`,`date_creation`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=43824824 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_hit`
--

CREATE TABLE `sc_log_hit` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned DEFAULT NULL,
  `collection_id_review` int(10) unsigned DEFAULT NULL,
  `list_id` int(10) unsigned DEFAULT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`,`state`),
  KEY `idx_date_creation` (`date_creation`,`collection_id_review`) USING BTREE,
  KEY `idx_collection_id_review` (`collection_id_review`),
  KEY `idx_list_id` (`list_id`),
  KEY `idx_user_id` (`user_id`,`date_creation`)
) ENGINE=TokuDB AUTO_INCREMENT=335475795 DEFAULT CHARSET=utf8 `compression`='tokudb_small'
/*!50100 PARTITION BY LIST (state)
(PARTITION pending VALUES IN (0) ENGINE = TokuDB,
 PARTITION updating VALUES IN (1) ENGINE = TokuDB,
 PARTITION done VALUES IN (2) ENGINE = TokuDB) */;

--
-- Table structure for table `sc_log_hit_old`
--

CREATE TABLE `sc_log_hit_old` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned DEFAULT NULL,
  `collection_id_review` int(10) unsigned DEFAULT NULL,
  `list_id` int(10) unsigned DEFAULT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`,`state`),
  KEY `idx_date_creation` (`date_creation`,`collection_id_review`) USING BTREE,
  KEY `idx_collection_id_review` (`collection_id_review`),
  KEY `idx_list_id` (`list_id`),
  KEY `idx_user_id` (`user_id`,`date_creation`)
) ENGINE=TokuDB AUTO_INCREMENT=100871487 DEFAULT CHARSET=utf8 `compression`='tokudb_small'
/*!50100 PARTITION BY LIST (state)
(PARTITION pending VALUES IN (0) ENGINE = TokuDB,
 PARTITION updating VALUES IN (1) ENGINE = TokuDB,
 PARTITION done VALUES IN (2) ENGINE = TokuDB) */;

--
-- Table structure for table `sc_log_mailer_event`
--

CREATE TABLE `sc_log_mailer_event` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `id_mailer_transaction` int(10) unsigned NOT NULL,
  `id_mailer_event` tinyint(4) unsigned NOT NULL,
  `tag` varchar(30) DEFAULT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `id_mailer_transaction` (`id_mailer_transaction`,`id_mailer_event`)
) ENGINE=TokuDB AUTO_INCREMENT=13605056 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_mailer_transaction`
--

CREATE TABLE `sc_log_mailer_transaction` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ab_mailer_id` int(10) unsigned DEFAULT NULL,
  `user_id_from` int(10) unsigned DEFAULT NULL,
  `email_from` varchar(200) DEFAULT NULL,
  `user_id_to` int(10) unsigned DEFAULT NULL,
  `email_to` varchar(200) DEFAULT NULL,
  `mailer_type` int(3) unsigned NOT NULL,
  `url` varchar(300) DEFAULT NULL,
  `data` mediumtext,
  `md5` varchar(32) DEFAULT NULL,
  `priority` tinyint(4) unsigned NOT NULL DEFAULT '0',
  `state` tinyint(3) NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `host` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_md5` (`md5`) USING BTREE,
  KEY `idx_state` (`state`) USING BTREE,
  KEY `idx_date_creation` (`date_creation`),
  KEY `idx_url_date_creation` (`url`(255),`date_creation`),
  KEY `state` (`state`,`priority`,`date_creation`),
  KEY `date_last_update` (`date_last_update`)
) ENGINE=TokuDB AUTO_INCREMENT=52422029 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_merge_delete`
--

CREATE TABLE `sc_log_merge_delete` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id_source` int(10) unsigned DEFAULT NULL,
  `product_id_target` int(10) unsigned DEFAULT NULL,
  `franchise_id_source` int(10) unsigned DEFAULT NULL,
  `franchise_id_target` int(10) unsigned DEFAULT NULL,
  `contact_id_source` int(10) unsigned DEFAULT NULL,
  `contact_id_target` int(10) unsigned DEFAULT NULL,
  `user_id_target` int(10) unsigned DEFAULT NULL,
  `type_action` tinyint(3) unsigned DEFAULT NULL,
  `description` varchar(300) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `user_id_creation` int(10) unsigned DEFAULT NULL,
  `date_validation` timestamp NULL DEFAULT NULL,
  `user_id_validation` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_product_id_source` (`product_id_source`) USING BTREE,
  KEY `fk_product_id_target` (`product_id_target`) USING BTREE,
  KEY `fk_contact_id_source` (`contact_id_source`) USING BTREE,
  KEY `fk_contact_id_target` (`contact_id_target`) USING BTREE,
  KEY `fk_franchise_id_source` (`franchise_id_source`) USING BTREE,
  KEY `fk_franchise_id_target` (`franchise_id_target`) USING BTREE,
  KEY `fk_user_id_creation` (`user_id_creation`) USING BTREE,
  KEY `fk_user_id_validation` (`user_id_validation`) USING BTREE,
  KEY `idx_source_target` (`product_id_source`,`product_id_target`)
) ENGINE=TokuDB AUTO_INCREMENT=4253533 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_notification_contest`
--

CREATE TABLE `sc_log_notification_contest` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) unsigned DEFAULT NULL,
  `ad_campaign_id` int(11) unsigned DEFAULT NULL,
  `notification_contest_id` int(11) unsigned DEFAULT NULL,
  `contest_id` int(11) unsigned DEFAULT NULL,
  `user_action_id` tinyint(3) unsigned DEFAULT NULL,
  `date_creation` datetime DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `notification_contest_id` (`notification_contest_id`,`date_creation`),
  KEY `campaign_id` (`ad_campaign_id`,`date_creation`),
  KEY `notification_contest_id_2` (`notification_contest_id`,`date_creation`,`user_id`)
) ENGINE=TokuDB AUTO_INCREMENT=25005495 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_query`
--

CREATE TABLE `sc_log_query` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `query` text NOT NULL,
  `url` varchar(300) DEFAULT NULL,
  `time_exec` int(10) unsigned NOT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `data` text,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_review`
--

CREATE TABLE `sc_log_review` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `format_id` int(10) unsigned DEFAULT NULL,
  `collection_id` int(10) unsigned DEFAULT NULL,
  `review_title` varchar(100) DEFAULT NULL,
  `review_content` text,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_date_creation` (`date_creation`),
  KEY `idx_user_product_format` (`user_id`,`product_id`,`format_id`),
  KEY `idx_collection` (`collection_id`)
) ENGINE=TokuDB AUTO_INCREMENT=9426875 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_search`
--

CREATE TABLE `sc_log_search` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `keyword` varchar(300) NOT NULL DEFAULT '',
  `user_id` int(10) unsigned DEFAULT NULL,
  `product_id` bigint(20) unsigned DEFAULT NULL,
  `list_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `franchise_id` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `is_click` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `date_click` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_log_search__user_id` (`user_id`) USING BTREE,
  KEY `fk_log_search__product_id` (`product_id`) USING BTREE,
  KEY `fk_log_search__list_id` (`list_id`) USING BTREE,
  KEY `fk_log_search__contact_id` (`contact_id`) USING BTREE,
  KEY `fk_log_search__franchise_id` (`franchise_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=62593135 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_slow_exec`
--

CREATE TABLE `sc_log_slow_exec` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `url` varchar(300) NOT NULL DEFAULT '',
  `execution_time` float(40,2) unsigned NOT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_slow_query`
--

CREATE TABLE `sc_log_slow_query` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `server` varchar(50) NOT NULL DEFAULT '',
  `thread_id` int(10) unsigned NOT NULL,
  `user` varchar(50) NOT NULL DEFAULT '',
  `host` varchar(50) DEFAULT NULL,
  `ip` varchar(20) DEFAULT NULL,
  `schema` varchar(50) DEFAULT NULL,
  `qc_hit` tinyint(3) unsigned NOT NULL,
  `query_time` float(13,2) NOT NULL,
  `lock_time` float(13,2) NOT NULL,
  `rows_sent` int(10) unsigned NOT NULL,
  `rows_examined` int(10) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `query` mediumtext,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_thread_timestamp` (`thread_id`,`date_creation`),
  KEY `idx_date_creation` (`date_creation`)
) ENGINE=TokuDB AUTO_INCREMENT=1123 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_task`
--

CREATE TABLE `sc_log_task` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `task_type_id` int(10) unsigned NOT NULL,
  `target_subtype_id` int(10) unsigned DEFAULT NULL,
  `target_id` int(10) unsigned DEFAULT NULL,
  `json` longtext,
  `state` int(3) NOT NULL,
  `priority` int(3) NOT NULL DEFAULT '1',
  `host` varchar(255) DEFAULT NULL,
  `user_id_creation` int(10) DEFAULT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `user_id_validation` int(10) DEFAULT NULL,
  `date_validation` timestamp NULL DEFAULT NULL,
  `date_start` timestamp NULL DEFAULT NULL,
  `date_end` timestamp NULL DEFAULT NULL,
  `count` int(10) unsigned DEFAULT NULL,
  `results` text,
  `log` text,
  PRIMARY KEY (`id`,`state`),
  KEY `idx_target_id_task_type_id_state` (`target_id`,`task_type_id`,`state`),
  KEY `idx_state_host_priority` (`host`,`priority`)
) ENGINE=TokuDB AUTO_INCREMENT=18085110 DEFAULT CHARSET=utf8 COMMENT='I' `compression`='tokudb_small'
/*!50100 PARTITION BY LIST (state)
(PARTITION pending VALUES IN (0) ENGINE = TokuDB,
 PARTITION refused VALUES IN (-2) ENGINE = TokuDB,
 PARTITION `error` VALUES IN (-1) ENGINE = TokuDB,
 PARTITION done1 VALUES IN (1) ENGINE = TokuDB,
 PARTITION done2 VALUES IN (2) ENGINE = TokuDB,
 PARTITION pending_validation VALUES IN (3) ENGINE = TokuDB) */;

--
-- Table structure for table `sc_log_trailer`
--

CREATE TABLE `sc_log_trailer` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(10) unsigned NOT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=8265489 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_user_action`
--

CREATE TABLE `sc_log_user_action` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `user_action_id` int(10) unsigned NOT NULL,
  `product_id_target` int(10) unsigned DEFAULT NULL,
  `list_id_target` int(10) unsigned DEFAULT NULL,
  `review_id_target` int(10) unsigned DEFAULT NULL,
  `badge_id_target` int(10) unsigned DEFAULT NULL,
  `contact_id_target` int(10) unsigned DEFAULT NULL,
  `user_id_target` int(10) unsigned DEFAULT NULL,
  `feed_id_target` int(10) unsigned DEFAULT NULL,
  `value` int(10) DEFAULT NULL,
  `json` text COMMENT 'All other information in JSON format',
  `gen_subtype_id` tinyint(3) unsigned NOT NULL,
  `gen_type_id` tinyint(3) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ip` varchar(16) DEFAULT NULL,
  `shout_id_target` int(10) unsigned DEFAULT NULL,
  `application_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=214103493 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_log_user_action_product`
--

CREATE TABLE `sc_log_user_action_product` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `user_action_id` int(10) unsigned NOT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `value` int(3) DEFAULT NULL,
  `gen_type_id` int(10) unsigned NOT NULL,
  `gen_subtype_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_stat_all` (`user_action_id`,`product_id`,`date_creation`) USING BTREE,
  KEY `idx_user_action_id_user_id` (`user_action_id`,`user_id`) USING BTREE,
  KEY `user_id` (`user_id`,`product_id`,`user_action_id`)
) ENGINE=TokuDB AUTO_INCREMENT=146446399 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_mailer_blacklist`
--

CREATE TABLE `sc_mailer_blacklist` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `content` varchar(200) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=173 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_mailer_event`
--

CREATE TABLE `sc_mailer_event` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(50) NOT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_mailer_query`
--

CREATE TABLE `sc_mailer_query` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(20) NOT NULL DEFAULT '',
  `query` text NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_mailer_type`
--

CREATE TABLE `sc_mailer_type` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(200) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_media_format`
--

CREATE TABLE `sc_media_format` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `param_id` int(10) unsigned NOT NULL DEFAULT '0',
  `gen_subtype_id` tinyint(3) unsigned NOT NULL,
  `tag` varchar(10) DEFAULT NULL,
  `width` int(10) unsigned DEFAULT NULL,
  `height` int(10) unsigned DEFAULT NULL,
  `media_type_id` tinyint(3) unsigned DEFAULT NULL,
  `force_crop` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `force_resize` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_kill_transparency` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_media_unique` (`param_id`,`tag`),
  KEY `fk_media_format__subtype_id` (`gen_subtype_id`),
  KEY `fk_media_format__media_type_id` (`media_type_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=904 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_media_import`
--

CREATE TABLE `sc_media_import` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `url` varchar(500) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_media_prefix`
--

CREATE TABLE `sc_media_prefix` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `param_id` int(10) unsigned NOT NULL,
  `label` varchar(50) NOT NULL,
  `i18n_id` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `fk_media_prefix__param_id` (`param_id`)
) ENGINE=TokuDB AUTO_INCREMENT=287 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_media_type`
--

CREATE TABLE `sc_media_type` (
  `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `format` varchar(5) NOT NULL DEFAULT '',
  `extension` varchar(5) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_media_vip`
--

CREATE TABLE `sc_media_vip` (
  `media_id` int(10) unsigned NOT NULL DEFAULT '0',
  `product_id` int(10) unsigned NOT NULL DEFAULT '0',
  `subtype_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `collection_count` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`collection_count`,`subtype_id`,`media_id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_message`
--

CREATE TABLE `sc_message` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `message_topic_id` int(10) unsigned DEFAULT NULL,
  `title` varchar(60) DEFAULT NULL,
  `content` text,
  `state` tinyint(4) NOT NULL DEFAULT '1',
  `state_validation` tinyint(4) NOT NULL DEFAULT '0',
  `gen_state_user` tinyint(4) NOT NULL DEFAULT '1',
  `page` int(10) unsigned DEFAULT NULL,
  `is_last` int(3) unsigned NOT NULL DEFAULT '0',
  `user_id_creation` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `user_id_last_update` int(10) unsigned DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id_validation` int(10) unsigned DEFAULT NULL,
  `date_validation` timestamp NULL DEFAULT NULL,
  `ip` int(10) unsigned DEFAULT NULL,
  `_old_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user_interaction` (`message_topic_id`,`user_id_creation`) USING BTREE,
  KEY `idx_topic_id_last` (`message_topic_id`,`is_last`),
  KEY `idx_user_id` (`user_id_creation`),
  KEY `message_topic_id` (`message_topic_id`,`date_creation`)
) ENGINE=TokuDB AUTO_INCREMENT=5140546 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_message_topic`
--

CREATE TABLE `sc_message_topic` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `is_private` tinyint(4) unsigned DEFAULT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `collection_id` int(10) unsigned DEFAULT NULL,
  `feed_id` int(10) unsigned DEFAULT NULL,
  `list_id` int(10) unsigned DEFAULT NULL,
  `article_id` int(10) unsigned DEFAULT NULL,
  `feedback_id` int(10) unsigned DEFAULT NULL,
  `message_count` int(10) unsigned DEFAULT NULL,
  `gen_user_id_related` int(10) unsigned DEFAULT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '1',
  `user_id_last_message` int(10) unsigned DEFAULT NULL,
  `date_last_message` timestamp NULL DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `user_id_creation` int(10) unsigned DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id_last_update` int(10) unsigned DEFAULT NULL,
  `date_validation` timestamp NULL DEFAULT NULL,
  `user_id_validation` int(10) unsigned DEFAULT NULL,
  `shout_id` int(10) unsigned DEFAULT NULL,
  `as_admin` tinyint(4) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_collection` (`collection_id`),
  KEY `idx_feed` (`feed_id`),
  KEY `idx_list` (`list_id`),
  KEY `idx_user_id_creation` (`user_id_creation`),
  KEY `idx_user_interaction` (`gen_user_id_related`),
  KEY `idx_article_id` (`article_id`),
  KEY `idx_feedback_id` (`feedback_id`),
  KEY `idx_id_list_collec` (`id`,`collection_id`,`list_id`) USING BTREE,
  KEY `idx_id_private` (`is_private`,`id`) USING BTREE,
  KEY `idx_shout` (`shout_id`) USING BTREE,
  KEY `product_id` (`product_id`)
) ENGINE=TokuDB AUTO_INCREMENT=1153956 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_message_user`
--

CREATE TABLE `sc_message_user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `message_topic_id` int(10) unsigned DEFAULT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `unread_nb` int(10) unsigned DEFAULT NULL,
  `is_notification` tinyint(3) unsigned DEFAULT NULL,
  `date_last_view` timestamp NULL DEFAULT NULL,
  `date_purge` timestamp NULL DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_message_unique` (`user_id`,`message_topic_id`) USING BTREE,
  KEY `idx_message_topic_user` (`message_topic_id`,`user_id`,`unread_nb`) USING BTREE,
  KEY `idx_user_id_unread_nb` (`user_id`,`unread_nb`)
) ENGINE=TokuDB AUTO_INCREMENT=2625526 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_month`
--

CREATE TABLE `sc_month` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(128) NOT NULL DEFAULT '' COMMENT 'Humanized month name.',
  `position` tinyint(4) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_month__label` (`label`) USING BTREE,
  UNIQUE KEY `idx_month__position` (`position`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_movies_catchall`
--

CREATE TABLE `sc_movies_catchall` (
  `product_id` int(11) NOT NULL,
  `catchall` varchar(500) DEFAULT NULL,
  `catchall_title` varchar(500) DEFAULT NULL,
  PRIMARY KEY (`product_id`),
  KEY `ix_catchall` (`catchall`(255)) USING HASH,
  KEY `catchall_title` (`catchall_title`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_newsletter`
--

CREATE TABLE `sc_newsletter` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL DEFAULT '',
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `user_id_creation` int(10) unsigned NOT NULL,
  `date_sent` date DEFAULT NULL,
  `json` text,
  `count_sent` int(10) unsigned NOT NULL DEFAULT '0',
  `count_open` int(10) unsigned NOT NULL DEFAULT '0',
  `count_click` int(10) unsigned NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `type` tinyint(4) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=214 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_notification`
--

CREATE TABLE `sc_notification` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `user_id_from` int(10) unsigned DEFAULT NULL,
  `user_id_target` int(10) unsigned DEFAULT NULL,
  `product_id_target` int(10) unsigned DEFAULT NULL,
  `collection_id_target` int(10) unsigned DEFAULT NULL,
  `list_id_target` int(10) unsigned DEFAULT NULL,
  `notification_item_id_target` int(10) unsigned DEFAULT NULL,
  `notification_agenda_id_target` int(10) unsigned DEFAULT NULL,
  `badge_id_target` int(10) unsigned DEFAULT NULL,
  `contact_id_target` int(10) unsigned DEFAULT NULL,
  `shout_id_target` int(10) unsigned DEFAULT NULL,
  `feed_id_target` int(10) unsigned DEFAULT NULL,
  `topic_id_target` int(10) unsigned DEFAULT NULL,
  `message_id_target` int(10) unsigned DEFAULT NULL,
  `like_id_target` int(10) unsigned DEFAULT NULL,
  `forum_message_id_target` int(10) unsigned DEFAULT NULL,
  `_temp_state_treated` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `subtype_id` tinyint(3) unsigned NOT NULL,
  `notification_type_id` tinyint(3) unsigned NOT NULL,
  `is_unread` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `mailer_transaction_id` int(10) unsigned DEFAULT NULL,
  `gen_related_subtype_id` tinyint(3) unsigned NOT NULL,
  `gen_related_type_id` tinyint(3) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `date_read` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user_id_unread` (`user_id`,`is_unread`),
  KEY `idx_user_id_date_creation` (`user_id`,`date_creation`),
  KEY `idx_subtype_id` (`subtype_id`) USING BTREE,
  KEY `idx_user_id_subtype_id` (`user_id`,`subtype_id`) USING BTREE,
  KEY `idx_temp_treated` (`_temp_state_treated`) USING BTREE,
  KEY `idx_user_id_target` (`user_id_target`) USING BTREE,
  KEY `idx_product_id_target` (`product_id_target`) USING BTREE,
  KEY `idx_collection_id_target` (`collection_id_target`) USING BTREE,
  KEY `idx_list_id_target` (`list_id_target`) USING BTREE,
  KEY `idx_notification_item_id_target` (`notification_item_id_target`) USING BTREE,
  KEY `idx_badge_id_target` (`badge_id_target`) USING BTREE,
  KEY `idx_contact_id_target` (`contact_id_target`) USING BTREE,
  KEY `idx_shout_id_target` (`shout_id_target`) USING BTREE,
  KEY `idx_feed_id_target` (`feed_id_target`) USING BTREE,
  KEY `idx_topic_id_target` (`topic_id_target`) USING BTREE,
  KEY `idx_like_id_target` (`like_id_target`) USING BTREE,
  KEY `idx_message_id_target` (`message_id_target`) USING BTREE,
  KEY `idx_notification_agenda_id_target` (`notification_agenda_id_target`) USING BTREE,
  KEY `forum_message_id_target` (`forum_message_id_target`)
) ENGINE=TokuDB AUTO_INCREMENT=111342415 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_notification_agenda`
--

CREATE TABLE `sc_notification_agenda` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `subtype_id` tinyint(3) unsigned NOT NULL,
  `state` tinyint(4) DEFAULT '0' COMMENT '0/ Pending. 1/ Sent. 2/ Error. -1/ Deleted.',
  `with_email` tinyint(4) NOT NULL DEFAULT '1',
  `json` mediumtext NOT NULL COMMENT 'all content is in json',
  `date_start` date NOT NULL,
  `date_end` date NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unq_user_date_start_date_end` (`user_id`,`date_start`,`date_end`),
  KEY `idx_state_date_start_date_end` (`state`,`date_start`,`date_end`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=3764961 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_notification_contest`
--

CREATE TABLE `sc_notification_contest` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `ad_campaign_id` int(11) unsigned DEFAULT NULL,
  `product_id` int(11) unsigned DEFAULT NULL,
  `list_id` int(10) unsigned DEFAULT NULL,
  `contest_id` int(11) unsigned DEFAULT NULL,
  `contest_url` varchar(200) DEFAULT NULL,
  `subtype_id` tinyint(3) unsigned DEFAULT NULL,
  `admin_query_id` int(11) unsigned DEFAULT NULL,
  `free_query` text,
  `title` varchar(140) DEFAULT NULL,
  `description` text,
  `text_promo` text,
  `media` int(11) DEFAULT NULL,
  `media_url_small` varchar(150) DEFAULT NULL,
  `media_url_big` varchar(150) DEFAULT NULL,
  `state` tinyint(1) unsigned DEFAULT NULL,
  `date_start` datetime DEFAULT NULL,
  `date_end` datetime DEFAULT NULL,
  `date_creation` datetime DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `gen_total_sent` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `state` (`state`,`date_start`,`date_end`)
) ENGINE=TokuDB AUTO_INCREMENT=185 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_notification_contest_user`
--

CREATE TABLE `sc_notification_contest_user` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) unsigned DEFAULT NULL,
  `notification_contest_id` int(11) DEFAULT NULL,
  `is_read` tinyint(4) DEFAULT NULL,
  `display` tinyint(1) NOT NULL DEFAULT '1',
  `test` tinyint(1) DEFAULT NULL,
  `date_creation` datetime DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_2` (`user_id`,`notification_contest_id`),
  KEY `notification_contest_id` (`notification_contest_id`,`user_id`),
  KEY `user_id` (`user_id`)
) ENGINE=TokuDB AUTO_INCREMENT=77912778 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_notification_item`
--

CREATE TABLE `sc_notification_item` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `subtype_id` tinyint(3) unsigned NOT NULL COMMENT 'info or ad ?',
  `state` tinyint(4) DEFAULT '0' COMMENT '0/ Pending. 1/ Ready-to-send 2/sent . -1/ Deleted',
  `count_sent` int(10) unsigned DEFAULT NULL,
  `with_email` tinyint(4) NOT NULL DEFAULT '0',
  `json` mediumtext NOT NULL COMMENT 'all content is in json',
  `notification_item_template_id` int(10) unsigned NOT NULL,
  `ad_campaign_id` int(10) unsigned DEFAULT NULL,
  `admin_query_id` int(10) unsigned DEFAULT NULL,
  `date_start` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Sent only after date start',
  `date_end` timestamp NULL DEFAULT NULL,
  `date_push_end` timestamp NULL DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `ad_campaign_id` (`ad_campaign_id`)
) ENGINE=TokuDB AUTO_INCREMENT=606 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_notification_item_template`
--

CREATE TABLE `sc_notification_item_template` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `template` varchar(100) NOT NULL,
  `tag` varchar(100) NOT NULL,
  `json_sample` mediumtext,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_notification_old`
--

CREATE TABLE `sc_notification_old` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `user_id_from` int(10) unsigned DEFAULT NULL,
  `user_id_target` int(10) unsigned DEFAULT NULL,
  `product_id_target` int(10) unsigned DEFAULT NULL,
  `collection_id_target` int(10) unsigned DEFAULT NULL,
  `list_id_target` int(10) unsigned DEFAULT NULL,
  `notification_item_id_target` int(10) unsigned DEFAULT NULL,
  `badge_id_target` int(10) unsigned DEFAULT NULL,
  `contact_id_target` int(10) unsigned DEFAULT NULL,
  `shout_id_target` int(10) unsigned DEFAULT NULL,
  `feed_id_target` int(10) unsigned DEFAULT NULL,
  `topic_id_target` int(10) unsigned DEFAULT NULL,
  `message_id_target` int(10) unsigned DEFAULT NULL,
  `like_id_target` int(10) unsigned DEFAULT NULL,
  `_temp_state_treated` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `subtype_id` tinyint(3) unsigned NOT NULL,
  `notification_type_id` tinyint(3) unsigned NOT NULL,
  `is_unread` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `mailer_transaction_id` int(10) unsigned DEFAULT NULL,
  `gen_related_subtype_id` tinyint(3) unsigned NOT NULL,
  `gen_related_type_id` tinyint(3) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `date_read` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user_id_unread` (`user_id`,`is_unread`),
  KEY `idx_user_id_date_creation` (`user_id`,`date_creation`),
  KEY `idx_subtype_id` (`subtype_id`) USING BTREE,
  KEY `idx_user_id_subtype_id` (`user_id`,`subtype_id`) USING BTREE,
  KEY `idx_temp_treated` (`_temp_state_treated`) USING BTREE,
  KEY `idx_user_id_target` (`user_id_target`) USING BTREE,
  KEY `idx_product_id_target` (`product_id_target`) USING BTREE,
  KEY `idx_collection_id_target` (`collection_id_target`) USING BTREE,
  KEY `idx_list_id_target` (`list_id_target`) USING BTREE,
  KEY `idx_notification_item_id_target` (`notification_item_id_target`) USING BTREE,
  KEY `idx_badge_id_target` (`badge_id_target`) USING BTREE,
  KEY `idx_contact_id_target` (`contact_id_target`) USING BTREE,
  KEY `idx_shout_id_target` (`shout_id_target`) USING BTREE,
  KEY `idx_feed_id_target` (`feed_id_target`) USING BTREE,
  KEY `idx_topic_id_target` (`topic_id_target`) USING BTREE,
  KEY `idx_like_id_target` (`like_id_target`) USING BTREE,
  KEY `idx_message_id_target` (`message_id_target`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=20251271 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_notification_type`
--

CREATE TABLE `sc_notification_type` (
  `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(80) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_oauth_token_type`
--

CREATE TABLE `sc_oauth_token_type` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_opengraph_user_action`
--

CREATE TABLE `sc_opengraph_user_action` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_action_id` int(10) unsigned NOT NULL,
  `facebook_action_id` int(10) unsigned DEFAULT NULL,
  `target_id` int(10) unsigned NOT NULL,
  `gen_user_id` int(10) unsigned NOT NULL,
  `subtype_id` tinyint(3) unsigned NOT NULL,
  `opengraph_ref` varchar(100) DEFAULT NULL COMMENT 'Opengraph ID',
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `type` varchar(15) NOT NULL,
  `uri` varchar(250) NOT NULL,
  `value` tinyint(3) NOT NULL DEFAULT '0',
  `json` text NOT NULL,
  `log` varchar(200) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ref_host` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_gen_user_id` (`gen_user_id`),
  KEY `idx_state_target_type` (`state`,`target_id`,`type`),
  KEY `idx_state_host` (`state`,`ref_host`,`gen_user_id`),
  KEY `state` (`state`,`gen_user_id`)
) ENGINE=TokuDB AUTO_INCREMENT=41405853 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_os`
--

CREATE TABLE `sc_os` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_param`
--

CREATE TABLE `sc_param` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(128) NOT NULL DEFAULT '' COMMENT 'Label du paramètre.',
  `subtype_id` tinyint(3) unsigned NOT NULL COMMENT 'Identifiant de la sous-catégorie de produit.',
  `pos` tinyint(3) unsigned DEFAULT NULL COMMENT 'Position pour déterminer l''ordre d''affichage (ORDER DESC).',
  `tag` varchar(25) DEFAULT NULL COMMENT 'Catégorie de paramètre.',
  `max` tinyint(3) unsigned DEFAULT NULL COMMENT 'Nombre de valeurs acceptées pour ce paramètre (NULL = illimité).',
  `is_i18n` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Flag pour indiquer la régionalisation du paramètre (0 = la valeur est unique pour tous les pays).',
  `is_alt_ranked` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'if param acception altranking',
  `is_format` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `ranking_type` tinyint(3) unsigned DEFAULT NULL,
  `type_data` varchar(10) DEFAULT NULL COMMENT 'Type de valeur.',
  `related_to` varchar(20) DEFAULT NULL COMMENT 'Nom de la table servant à faire la jointure dans sc_index_param',
  `rules` text COMMENT 'use with related_to (options)',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `json_rules` varchar(500) DEFAULT NULL,
  `is_contact_affinity` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `_tmp_id` int(10) unsigned DEFAULT NULL,
  `_old_id` int(10) unsigned DEFAULT NULL COMMENT 'Identifiant de l''ancienne base. Temporaire. A effacer après migration.',
  PRIMARY KEY (`id`),
  KEY `fk_param__subtype_id` (`subtype_id`),
  KEY `idx_param__label_subtype_id` (`label`,`subtype_id`) USING BTREE,
  KEY `migration_old_id` (`_old_id`),
  KEY `idx_id_tag` (`id`,`tag`),
  KEY `idx_tag` (`tag`,`id`) USING BTREE,
  KEY `tag` (`tag`,`subtype_id`),
  KEY `idx_id_affinity` (`id`,`is_contact_affinity`),
  KEY `idx_affinity_id` (`is_contact_affinity`,`id`)
) ENGINE=TokuDB AUTO_INCREMENT=483 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_param_index`
--

CREATE TABLE `sc_param_index` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id_key` int(10) unsigned DEFAULT NULL,
  `contact_id_key` int(10) unsigned DEFAULT NULL,
  `franchise_id_key` int(10) unsigned DEFAULT NULL,
  `article_id_key` int(10) unsigned DEFAULT NULL,
  `user_id_key` int(10) unsigned DEFAULT NULL,
  `format_id_key` int(10) unsigned DEFAULT NULL,
  `list_id_key` int(10) unsigned DEFAULT NULL,
  `badge_id_key` int(10) DEFAULT NULL,
  `tag_id_key` int(10) unsigned DEFAULT NULL,
  `i18n_id` int(10) unsigned DEFAULT NULL,
  `param_id` int(10) unsigned NOT NULL DEFAULT '0',
  `value` varchar(600) DEFAULT NULL,
  `value_int` int(11) DEFAULT NULL,
  `value_text` text,
  `value_date` date DEFAULT NULL,
  `contact_id_value` int(10) unsigned DEFAULT NULL,
  `media_id_value` int(10) unsigned DEFAULT NULL,
  `param_select_id_value` int(10) unsigned DEFAULT NULL,
  `country_id_value` int(10) unsigned DEFAULT NULL,
  `language_id_value` int(10) unsigned DEFAULT NULL,
  `product_id_value` int(10) unsigned DEFAULT NULL,
  `franchise_id_value` int(10) unsigned DEFAULT NULL,
  `format_id_value` int(10) unsigned DEFAULT NULL,
  `tag_id_value` int(10) unsigned DEFAULT NULL,
  `ranking` int(10) unsigned DEFAULT NULL,
  `api_id` int(10) unsigned DEFAULT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `user_id_creation` int(10) unsigned DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id_last_update` int(10) unsigned DEFAULT NULL,
  `date_validation` timestamp NULL DEFAULT NULL,
  `user_id_validation` int(10) unsigned DEFAULT NULL,
  `gen_subtype_id` tinyint(3) unsigned NOT NULL,
  `gen_type_id` tinyint(3) unsigned NOT NULL,
  `alt_ranking` int(10) unsigned DEFAULT NULL,
  `alt_ranking_label` varchar(50) DEFAULT NULL,
  `is_favorite` tinyint(1) unsigned DEFAULT NULL,
  `md5` binary(16) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
  `value_date_year` smallint(6) DEFAULT NULL,
  `value_date_month` tinyint(3) unsigned DEFAULT NULL,
  `value_date_day` tinyint(3) unsigned DEFAULT NULL,
  `date_start_year` smallint(6) DEFAULT NULL,
  `date_start_month` tinyint(3) unsigned DEFAULT NULL,
  `date_start_day` tinyint(3) unsigned DEFAULT NULL,
  `date_end_year` smallint(6) DEFAULT NULL,
  `date_end_month` tinyint(3) unsigned DEFAULT NULL,
  `date_end_day` tinyint(3) unsigned DEFAULT NULL,
  `contact_id_value_alt` int(10) DEFAULT NULL,
  `forum_id_key` int(10) unsigned DEFAULT NULL,
  `carousel_item_id_key` int(10) unsigned DEFAULT NULL,
  `list_id_value` int(10) unsigned DEFAULT NULL,
  `value_md5` char(32) NOT NULL DEFAULT '',
  `contest_id_key` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`,`gen_subtype_id`),
  KEY `idx_contact_id_value` (`contact_id_value`) USING BTREE,
  KEY `idx_media_id_value` (`media_id_value`) USING BTREE,
  KEY `idx_product_id_value` (`product_id_value`) USING BTREE,
  KEY `idx_franchise_id_value` (`franchise_id_value`) USING BTREE,
  KEY `idx_tag_id_value` (`tag_id_value`) USING BTREE,
  KEY `idx_user_id_key` (`user_id_key`),
  KEY `contact_id_key` (`contact_id_key`,`param_id`),
  KEY `contact_id_value` (`contact_id_value`,`param_id`) USING BTREE,
  KEY `idx_product_id_key` (`product_id_key`,`param_id`),
  KEY `idx_param_id` (`param_id`,`value`(32)),
  KEY `idx_param_id_product_id` (`param_id`,`product_id_key`),
  KEY `idx_list_id_key` (`list_id_key`,`param_id`),
  KEY `idx_product_id_key_contact_id_value_alt` (`product_id_key`,`contact_id_value_alt`) USING BTREE,
  KEY `contact_id_value_alt` (`contact_id_value_alt`),
  KEY `idx_list_id_value` (`list_id_value`) USING BTREE,
  KEY `forum_id_key` (`forum_id_key`),
  KEY `param_id_2` (`param_id`,`state`,`list_id_key`),
  KEY `param_id_3` (`param_id`,`value_int`),
  KEY `param_id` (`param_id`,`state`,`date_creation`),
  KEY `md5` (`md5`)
) ENGINE=TokuDB AUTO_INCREMENT=370694335 DEFAULT CHARSET=utf8 `compression`='tokudb_small'
/*!50100 PARTITION BY LIST (gen_subtype_id)
(PARTITION p0 VALUES IN (1) ENGINE = TokuDB,
 PARTITION p1 VALUES IN (2) ENGINE = TokuDB,
 PARTITION p2 VALUES IN (3) ENGINE = TokuDB,
 PARTITION p3 VALUES IN (4) ENGINE = TokuDB,
 PARTITION p4 VALUES IN (5) ENGINE = TokuDB,
 PARTITION p5 VALUES IN (6) ENGINE = TokuDB,
 PARTITION p6 VALUES IN (7) ENGINE = TokuDB,
 PARTITION p7 VALUES IN (8) ENGINE = TokuDB,
 PARTITION p8 VALUES IN (9) ENGINE = TokuDB,
 PARTITION p9 VALUES IN (10) ENGINE = TokuDB,
 PARTITION p10 VALUES IN (11) ENGINE = TokuDB,
 PARTITION p11 VALUES IN (12) ENGINE = TokuDB,
 PARTITION p12 VALUES IN (13) ENGINE = TokuDB,
 PARTITION p13 VALUES IN (14) ENGINE = TokuDB,
 PARTITION p14 VALUES IN (15) ENGINE = TokuDB,
 PARTITION p15 VALUES IN (16) ENGINE = TokuDB,
 PARTITION p16 VALUES IN (17) ENGINE = TokuDB,
 PARTITION p17 VALUES IN (18) ENGINE = TokuDB,
 PARTITION p18 VALUES IN (19) ENGINE = TokuDB,
 PARTITION p19 VALUES IN (20) ENGINE = TokuDB,
 PARTITION p20 VALUES IN (21) ENGINE = TokuDB,
 PARTITION p21 VALUES IN (22) ENGINE = TokuDB,
 PARTITION p22 VALUES IN (23) ENGINE = TokuDB,
 PARTITION p23 VALUES IN (24) ENGINE = TokuDB,
 PARTITION p24 VALUES IN (25) ENGINE = TokuDB,
 PARTITION p25 VALUES IN (26) ENGINE = TokuDB,
 PARTITION p26 VALUES IN (27) ENGINE = TokuDB,
 PARTITION p27 VALUES IN (28) ENGINE = TokuDB,
 PARTITION p28 VALUES IN (29) ENGINE = TokuDB,
 PARTITION p29 VALUES IN (30) ENGINE = TokuDB,
 PARTITION p30 VALUES IN (31) ENGINE = TokuDB,
 PARTITION p31 VALUES IN (32) ENGINE = TokuDB,
 PARTITION p32 VALUES IN (33) ENGINE = TokuDB,
 PARTITION p33 VALUES IN (34) ENGINE = TokuDB,
 PARTITION p34 VALUES IN (35) ENGINE = TokuDB,
 PARTITION p35 VALUES IN (36) ENGINE = TokuDB,
 PARTITION p36 VALUES IN (37) ENGINE = TokuDB,
 PARTITION p37 VALUES IN (38) ENGINE = TokuDB,
 PARTITION p38 VALUES IN (39) ENGINE = TokuDB,
 PARTITION p39 VALUES IN (40) ENGINE = TokuDB,
 PARTITION p40 VALUES IN (41) ENGINE = TokuDB,
 PARTITION p41 VALUES IN (42) ENGINE = TokuDB,
 PARTITION p42 VALUES IN (43) ENGINE = TokuDB,
 PARTITION p43 VALUES IN (44) ENGINE = TokuDB,
 PARTITION p44 VALUES IN (45) ENGINE = TokuDB,
 PARTITION p45 VALUES IN (46) ENGINE = TokuDB,
 PARTITION p46 VALUES IN (47) ENGINE = TokuDB,
 PARTITION p47 VALUES IN (48) ENGINE = TokuDB,
 PARTITION p48 VALUES IN (49) ENGINE = TokuDB,
 PARTITION p49 VALUES IN (50) ENGINE = TokuDB,
 PARTITION p50 VALUES IN (51) ENGINE = TokuDB,
 PARTITION p51 VALUES IN (52) ENGINE = TokuDB,
 PARTITION p52 VALUES IN (53) ENGINE = TokuDB,
 PARTITION p53 VALUES IN (54) ENGINE = TokuDB,
 PARTITION p54 VALUES IN (55) ENGINE = TokuDB,
 PARTITION p55 VALUES IN (56) ENGINE = TokuDB,
 PARTITION p56 VALUES IN (57) ENGINE = TokuDB,
 PARTITION p57 VALUES IN (58) ENGINE = TokuDB,
 PARTITION p58 VALUES IN (59) ENGINE = TokuDB,
 PARTITION p59 VALUES IN (60) ENGINE = TokuDB,
 PARTITION p60 VALUES IN (61) ENGINE = TokuDB,
 PARTITION p61 VALUES IN (62) ENGINE = TokuDB,
 PARTITION p62 VALUES IN (63) ENGINE = TokuDB,
 PARTITION p63 VALUES IN (64) ENGINE = TokuDB,
 PARTITION p64 VALUES IN (65) ENGINE = TokuDB,
 PARTITION p65 VALUES IN (66) ENGINE = TokuDB,
 PARTITION p66 VALUES IN (67) ENGINE = TokuDB,
 PARTITION p67 VALUES IN (68) ENGINE = TokuDB,
 PARTITION p68 VALUES IN (69) ENGINE = TokuDB,
 PARTITION p69 VALUES IN (70) ENGINE = TokuDB,
 PARTITION p70 VALUES IN (71) ENGINE = TokuDB,
 PARTITION p71 VALUES IN (72) ENGINE = TokuDB,
 PARTITION p72 VALUES IN (73) ENGINE = TokuDB,
 PARTITION p73 VALUES IN (74) ENGINE = TokuDB,
 PARTITION p74 VALUES IN (75) ENGINE = TokuDB,
 PARTITION p75 VALUES IN (76) ENGINE = TokuDB,
 PARTITION p76 VALUES IN (77) ENGINE = TokuDB,
 PARTITION p77 VALUES IN (78) ENGINE = TokuDB,
 PARTITION p78 VALUES IN (79) ENGINE = TokuDB,
 PARTITION p79 VALUES IN (80) ENGINE = TokuDB,
 PARTITION p80 VALUES IN (81) ENGINE = TokuDB,
 PARTITION p81 VALUES IN (82) ENGINE = TokuDB,
 PARTITION p82 VALUES IN (83) ENGINE = TokuDB,
 PARTITION p83 VALUES IN (84) ENGINE = TokuDB,
 PARTITION p84 VALUES IN (85) ENGINE = TokuDB,
 PARTITION p85 VALUES IN (86) ENGINE = TokuDB,
 PARTITION p86 VALUES IN (87) ENGINE = TokuDB,
 PARTITION p87 VALUES IN (88) ENGINE = TokuDB,
 PARTITION p88 VALUES IN (89) ENGINE = TokuDB,
 PARTITION p89 VALUES IN (90) ENGINE = TokuDB,
 PARTITION p90 VALUES IN (91) ENGINE = TokuDB,
 PARTITION p91 VALUES IN (92) ENGINE = TokuDB,
 PARTITION p92 VALUES IN (93) ENGINE = TokuDB,
 PARTITION p93 VALUES IN (94) ENGINE = TokuDB,
 PARTITION p94 VALUES IN (95) ENGINE = TokuDB,
 PARTITION p95 VALUES IN (96) ENGINE = TokuDB,
 PARTITION p96 VALUES IN (97) ENGINE = TokuDB,
 PARTITION p97 VALUES IN (98) ENGINE = TokuDB) */;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`www-prod`@`%`*/ /*!50003 TRIGGER `md5_insert` BEFORE INSERT ON `sc_param_index` FOR EACH ROW BEGIN
     SET NEW.md5 = UNHEX(MD5(CONCAT(
          IF(NEW.product_id_key IS NULL,'',CONCAT('|product_id_key:',NEW.product_id_key)),
          IF(NEW.contact_id_key IS NULL,'',CONCAT('|concat_id_key:',NEW.contact_id_key)),
          IF(NEW.franchise_id_key IS NULL,'',CONCAT('|franchise_id_key:',NEW.franchise_id_key)),
          IF(NEW.article_id_key IS NULL,'',CONCAT('|article_id_key:',NEW.article_id_key)),
          IF(NEW.user_id_key IS NULL,'',CONCAT('|user_id_key:',NEW.user_id_key)),
          IF(NEW.format_id_key IS NULL,'',CONCAT('|format_id_key:',NEW.format_id_key)),
          IF(NEW.list_id_key IS NULL,'',CONCAT('|list_id_key:',NEW.list_id_key)),
          IF(NEW.badge_id_key IS NULL,'',CONCAT('|badge_id_key:',NEW.badge_id_key)),
          IF(NEW.tag_id_key IS NULL,'',CONCAT('|tag_id_key:',NEW.tag_id_key)),
          IF(NEW.forum_id_key IS NULL,'',CONCAT('|forum_id_key:',NEW.forum_id_key)),
          IF(NEW.carousel_item_id_key IS NULL,'',CONCAT('|carousel_item_id_key:',NEW.carousel_item_id_key)),
          IF(NEW.i18n_id IS NULL,'',CONCAT('|i18n_id:',NEW.i18n_id)),
          IF(NEW.param_id IS NULL,'',CONCAT('|param_id:',NEW.param_id)),
          IF(TRIM(LOWER(NEW.value)) IS NULL,'',CONCAT('|value:',TRIM(LOWER(NEW.value)))),
          IF(TRIM(LOWER(NEW.value_text)) IS NULL,'',CONCAT('|value_text:',TRIM(LOWER(NEW.value_text)))),
          IF(NEW.value_int IS NULL,'',CONCAT('|value_int:',NEW.value_int)),
          IF(NEW.value_date IS NULL,'',CONCAT('|value_date:',NEW.value_date)),
          IF(NEW.value_date_year IS NULL,'',CONCAT('|value_date_year:',NEW.value_date_year)),
          IF(NEW.value_date_month IS NULL,'',CONCAT('|value_date_month:',NEW.value_date_month)),
          IF(NEW.value_date_day IS NULL,'',CONCAT('|value_date_day:',NEW.value_date_day)),
          IF(NEW.date_start_year IS NULL,'',CONCAT('|date_start_year:',NEW.date_start_year)),
          IF(NEW.date_start_month IS NULL,'',CONCAT('|date_start_month:',NEW.date_start_month)),
          IF(NEW.date_start_day IS NULL,'',CONCAT('|date_start_day:',NEW.date_start_day)),
          IF(NEW.date_end_year IS NULL,'',CONCAT('|date_end_year:',NEW.date_end_year)),
          IF(NEW.date_end_month IS NULL,'',CONCAT('|date_end_month:',NEW.date_end_month)),
          IF(NEW.date_end_day IS NULL,'',CONCAT('|date_end_day:',NEW.date_end_day)),
          IF(NEW.contact_id_value IS NULL,'',CONCAT('|contact_id_value:',NEW.contact_id_value)),
          IF(NEW.media_id_value IS NULL,'',CONCAT('|media_id_value:',NEW.media_id_value)),
          IF(NEW.param_select_id_value IS NULL,'',CONCAT('|param_select_id_value:',NEW.param_select_id_value)),
          IF(NEW.country_id_value IS NULL,'',CONCAT('|country_id_value:',NEW.country_id_value)),
          IF(NEW.language_id_value IS NULL,'',CONCAT('|language_id_value:',NEW.language_id_value)),
          IF(NEW.product_id_value IS NULL,'',CONCAT('|product_id_value:',NEW.product_id_value)),
          IF(NEW.franchise_id_value IS NULL,'',CONCAT('|franchise_id_value:',NEW.franchise_id_value)),
          IF(NEW.format_id_value IS NULL,'',CONCAT('|format_id_value:',NEW.format_id_value)),
          IF(NEW.tag_id_value IS NULL,'',CONCAT('|tag_id_value:',NEW.tag_id_value)),
          IF(NEW.ranking IS NULL,'',CONCAT('|ranking:',NEW.ranking)),
          IF(NEW.api_id IS NULL,'',CONCAT('|api_id:',NEW.api_id)),
          IF(NEW.contact_id_value_alt IS NULL,'',CONCAT('|contact_id_value_alt:',NEW.contact_id_value_alt)),          
          IF(NEW.state >= 0,'|state:1','|state:0'),
          IF(NEW.alt_ranking IS NULL,'',CONCAT('|alt_ranking:',NEW.alt_ranking)),
          IF(TRIM(LOWER(NEW.alt_ranking_label)) IS NULL,'',CONCAT('|alt_ranking_label:',TRIM(LOWER(NEW.alt_ranking_label)))),
          IF(NEW.list_id_value IS NULL,'',CONCAT('|list_id_value:',NEW.list_id_value))
     )));

    SET NEW.value_md5 = IF(NEW.value IS NULL, '', MD5(NEW.value)); 
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`www-prod`@`%`*/ /*!50003 TRIGGER `md5_update` BEFORE UPDATE ON `sc_param_index` FOR EACH ROW BEGIN
     SET NEW.md5 = UNHEX(MD5(CONCAT(
          IF(NEW.product_id_key IS NULL,'',CONCAT('|product_id_key:',NEW.product_id_key)),
          IF(NEW.contact_id_key IS NULL,'',CONCAT('|concat_id_key:',NEW.contact_id_key)),
          IF(NEW.franchise_id_key IS NULL,'',CONCAT('|franchise_id_key:',NEW.franchise_id_key)),
          IF(NEW.article_id_key IS NULL,'',CONCAT('|article_id_key:',NEW.article_id_key)),
          IF(NEW.user_id_key IS NULL,'',CONCAT('|user_id_key:',NEW.user_id_key)),
          IF(NEW.format_id_key IS NULL,'',CONCAT('|format_id_key:',NEW.format_id_key)),
          IF(NEW.list_id_key IS NULL,'',CONCAT('|list_id_key:',NEW.list_id_key)),
          IF(NEW.badge_id_key IS NULL,'',CONCAT('|badge_id_key:',NEW.badge_id_key)),
          IF(NEW.tag_id_key IS NULL,'',CONCAT('|tag_id_key:',NEW.tag_id_key)),
          IF(NEW.forum_id_key IS NULL,'',CONCAT('|forum_id_key:',NEW.forum_id_key)),
          IF(NEW.carousel_item_id_key IS NULL,'',CONCAT('|carousel_item_id_key:',NEW.carousel_item_id_key)),
          IF(NEW.i18n_id IS NULL,'',CONCAT('|i18n_id:',NEW.i18n_id)),
          IF(NEW.param_id IS NULL,'',CONCAT('|param_id:',NEW.param_id)),
          IF(TRIM(LOWER(NEW.value)) IS NULL,'',CONCAT('|value:',TRIM(LOWER(NEW.value)))),
          IF(TRIM(LOWER(NEW.value_text)) IS NULL,'',CONCAT('|value_text:',TRIM(LOWER(NEW.value_text)))),
          IF(NEW.value_int IS NULL,'',CONCAT('|value_int:',NEW.value_int)),
          IF(NEW.value_date IS NULL,'',CONCAT('|value_date:',NEW.value_date)),
          IF(NEW.value_date_year IS NULL,'',CONCAT('|value_date_year:',NEW.value_date_year)),
          IF(NEW.value_date_month IS NULL,'',CONCAT('|value_date_month:',NEW.value_date_month)),
          IF(NEW.value_date_day IS NULL,'',CONCAT('|value_date_day:',NEW.value_date_day)),
          IF(NEW.date_start_year IS NULL,'',CONCAT('|date_start_year:',NEW.date_start_year)),
          IF(NEW.date_start_month IS NULL,'',CONCAT('|date_start_month:',NEW.date_start_month)),
          IF(NEW.date_start_day IS NULL,'',CONCAT('|date_start_day:',NEW.date_start_day)),
          IF(NEW.date_end_year IS NULL,'',CONCAT('|date_end_year:',NEW.date_end_year)),
          IF(NEW.date_end_month IS NULL,'',CONCAT('|date_end_month:',NEW.date_end_month)),
          IF(NEW.date_end_day IS NULL,'',CONCAT('|date_end_day:',NEW.date_end_day)),
          IF(NEW.contact_id_value IS NULL,'',CONCAT('|contact_id_value:',NEW.contact_id_value)),
          IF(NEW.media_id_value IS NULL,'',CONCAT('|media_id_value:',NEW.media_id_value)),
          IF(NEW.param_select_id_value IS NULL,'',CONCAT('|param_select_id_value:',NEW.param_select_id_value)),
          IF(NEW.country_id_value IS NULL,'',CONCAT('|country_id_value:',NEW.country_id_value)),
          IF(NEW.language_id_value IS NULL,'',CONCAT('|language_id_value:',NEW.language_id_value)),
          IF(NEW.product_id_value IS NULL,'',CONCAT('|product_id_value:',NEW.product_id_value)),
          IF(NEW.franchise_id_value IS NULL,'',CONCAT('|franchise_id_value:',NEW.franchise_id_value)),
          IF(NEW.format_id_value IS NULL,'',CONCAT('|format_id_value:',NEW.format_id_value)),
          IF(NEW.tag_id_value IS NULL,'',CONCAT('|tag_id_value:',NEW.tag_id_value)),
          IF(NEW.ranking IS NULL,'',CONCAT('|ranking:',NEW.ranking)),
          IF(NEW.api_id IS NULL,'',CONCAT('|api_id:',NEW.api_id)),
          IF(NEW.state >= 0,'|state:1','|state:0'),
          IF(NEW.alt_ranking IS NULL,'',CONCAT('|alt_ranking:',NEW.alt_ranking)),
          IF(TRIM(LOWER(NEW.alt_ranking_label)) IS NULL,'',CONCAT('|alt_ranking_label:',TRIM(LOWER(NEW.alt_ranking_label)))),
          IF(NEW.contact_id_value_alt IS NULL,'',CONCAT('|contact_id_value_alt:',NEW.contact_id_value_alt)),
          IF(NEW.list_id_value IS NULL,'',CONCAT('|list_id_value:',NEW.list_id_value))
     )));

    SET NEW.value_md5 = IF(NEW.value IS NULL, '', MD5(NEW.value)); 
END */;;
DELIMITER ;

--
-- Table structure for table `sc_param_index_to_delete`
--

CREATE TABLE `sc_param_index_to_delete` (
  `id` int(10) unsigned NOT NULL DEFAULT '0',
  `md5` binary(16) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
  `gen_subtype_id` tinyint(3) unsigned NOT NULL,
  `c` bigint(21) NOT NULL
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_param_select`
--

CREATE TABLE `sc_param_select` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `param_id` int(10) unsigned NOT NULL DEFAULT '0',
  `label` varchar(100) NOT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `user_id_creation` int(10) unsigned DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id_last_update` int(10) unsigned DEFAULT NULL,
  `date_validation` timestamp NULL DEFAULT NULL,
  `user_id_validation` int(10) unsigned DEFAULT NULL,
  `_old_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `param_id` (`param_id`,`label`),
  KEY `fk_param_select__param_id` (`param_id`),
  KEY `fk_param_select__user_id_creation` (`user_id_creation`) USING BTREE,
  KEY `fk_param_select__user_id_validation` (`user_id_validation`) USING BTREE,
  KEY `fk_param_select__user_id_last_update` (`user_id_last_update`) USING BTREE,
  KEY `_idx_old_id` (`_old_id`)
) ENGINE=TokuDB AUTO_INCREMENT=599 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_param_translate`
--

CREATE TABLE `sc_param_translate` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label_origin` varchar(250) NOT NULL DEFAULT '',
  `label_target` varchar(250) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id_creation` int(10) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_label` (`label_origin`)
) ENGINE=TokuDB AUTO_INCREMENT=65070 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_product`
--

CREATE TABLE `sc_product` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `id_big` bigint(20) unsigned DEFAULT NULL,
  `parent_id` int(10) unsigned DEFAULT NULL,
  `subtype_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `label` varchar(255) NOT NULL DEFAULT '',
  `gen_year` int(4) unsigned DEFAULT NULL,
  `product_id_merged_to` int(10) unsigned DEFAULT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `flag_gen` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Flag pour la mise à jour de l''index. 0 = à générer. 1 = À jour.',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `gen_collection_count` int(10) unsigned NOT NULL DEFAULT '0',
  `gen_type_id` tinyint(3) unsigned DEFAULT NULL,
  `flag_gen_count` tinyint(3) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_id_big` (`id_big`),
  KEY `fk_subtype_id` (`subtype_id`) USING BTREE,
  KEY `fk_parent_id` (`parent_id`) USING BTREE,
  KEY `idx_state` (`state`),
  KEY `idx_flag` (`flag_gen`,`gen_collection_count`,`gen_type_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=22052620 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_product_blacklist`
--

CREATE TABLE `sc_product_blacklist` (
  `product_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`product_id`)
) ENGINE=TokuDB AUTO_INCREMENT=18838649 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_product_focus`
--

CREATE TABLE `sc_product_focus` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(10) unsigned NOT NULL,
  `type_id` tinyint(3) unsigned DEFAULT NULL,
  `product_focus_type_id` tinyint(3) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `date_day` date DEFAULT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `category_param_select_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=1039399 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_product_focus_type`
--

CREATE TABLE `sc_product_focus_type` (
  `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `type_id` tinyint(3) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_product_genre`
--

CREATE TABLE `sc_product_genre` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `product_id` int(11) DEFAULT NULL,
  `subtype_id` smallint(6) DEFAULT NULL,
  `genre_tag_id` int(11) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `ix_product_genre` (`subtype_id`,`product_id`,`genre_tag_id`),
  KEY `ix_product_id` (`product_id`)
) ENGINE=TokuDB AUTO_INCREMENT=40053130 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_product_platform`
--

CREATE TABLE `sc_product_platform` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `product_id` int(11) DEFAULT NULL,
  `subtype_id` smallint(6) DEFAULT NULL,
  `platform_format_id` int(11) DEFAULT NULL,
  `gen_rating_count` int(5) DEFAULT '0',
  `gen_wish_list_count` int(5) DEFAULT '0',
  `gen_collection_count` int(5) DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `ix_product_platform` (`subtype_id`,`product_id`,`platform_format_id`)
) ENGINE=TokuDB AUTO_INCREMENT=4276422 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_product_progress`
--

CREATE TABLE `sc_product_progress` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(10) unsigned NOT NULL,
  `gen_subtype_id` tinyint(3) unsigned NOT NULL,
  `parent_1_id` int(10) unsigned NOT NULL,
  `parent_2_id` int(10) unsigned DEFAULT NULL,
  `level_1` smallint(5) unsigned DEFAULT NULL,
  `level_2` text,
  `absolute_level` smallint(5) unsigned DEFAULT NULL,
  `date_release` date DEFAULT NULL,
  `total` smallint(5) unsigned DEFAULT NULL,
  `absolute_total` smallint(5) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_airing` tinyint(3) unsigned NOT NULL,
  `current_popularity` int(10) unsigned DEFAULT NULL,
  `production_status` tinyint(3) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_parent_1_id` (`parent_1_id`) USING BTREE,
  KEY `idx_product_id` (`product_id`) USING BTREE,
  KEY `idx_gen_subtype_id` (`gen_subtype_id`) USING BTREE,
  KEY `idx_parent_2_id` (`parent_2_id`) USING BTREE,
  KEY `idx_level_1` (`level_1`) USING BTREE,
  KEY `idx_absolute_level` (`absolute_level`) USING BTREE,
  KEY `idx_total` (`total`) USING BTREE,
  KEY `idx_absolute_total` (`absolute_total`) USING BTREE,
  KEY `idx_is_airing` (`is_airing`) USING BTREE,
  KEY `idx_production_status` (`production_status`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=46532145 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_product_rank`
--

CREATE TABLE `sc_product_rank` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(10) unsigned NOT NULL,
  `type_id` tinyint(3) unsigned NOT NULL,
  `subtype_id` tinyint(3) unsigned NOT NULL,
  `is_archive` tinyint(3) NOT NULL DEFAULT '0',
  `rank` int(10) unsigned NOT NULL,
  `date_rank` date DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `diff_rank` smallint(6) DEFAULT NULL,
  `rating` smallint(5) unsigned DEFAULT NULL,
  `subtype_id_rank` tinyint(3) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`,`is_archive`),
  UNIQUE KEY `idx_subtype_rank_unique` (`subtype_id_rank`,`date_rank`,`product_id`,`is_archive`),
  KEY `idx_subtype_product` (`subtype_id`,`rank`,`is_archive`) USING BTREE,
  KEY `idx_product` (`product_id`),
  KEY `idx_subtype_rank_subtype_product` (`subtype_id_rank`,`subtype_id`,`rank`,`is_archive`),
  KEY `idx_subtype_rank_product` (`subtype_id_rank`,`product_id`)
) ENGINE=TokuDB AUTO_INCREMENT=2866036 DEFAULT CHARSET=utf8 `compression`='tokudb_small'
/*!50100 PARTITION BY LIST (is_archive)
(PARTITION ARCHIVED VALUES IN (1) ENGINE = TokuDB,
 PARTITION ACTIVE VALUES IN (0) ENGINE = TokuDB) */;

--
-- Table structure for table `sc_product_similarity`
--

CREATE TABLE `sc_product_similarity` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `product_id` int(11) NOT NULL,
  `product_id_related` int(11) NOT NULL,
  `similarity` float NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_product_id_product_id_related` (`product_id`,`product_id_related`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=661441 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_scout`
--

CREATE TABLE `sc_scout` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `user_id_scout` int(10) unsigned NOT NULL,
  `scout_group_id` int(10) unsigned DEFAULT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `date_confirmation` timestamp NULL DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `gen_state_user` tinyint(3) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_user_id__user_id_scout` (`user_id`,`user_id_scout`) USING BTREE,
  KEY `idx_user_id` (`user_id`) USING BTREE,
  KEY `idx_user_id_scout` (`user_id_scout`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=2381070 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_scout_group`
--

CREATE TABLE `sc_scout_group` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `label` varchar(15) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `gen_count` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_select_home`
--

CREATE TABLE `sc_select_home` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `list_id` int(10) unsigned DEFAULT NULL,
  `collection_id` int(10) unsigned DEFAULT NULL,
  `type_id` tinyint(3) unsigned NOT NULL,
  `subtype_id` tinyint(3) unsigned NOT NULL,
  `user_id_creation` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `user_id_last_update` int(10) unsigned DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `type_id` (`type_id`,`state`,`list_id`)
) ENGINE=TokuDB AUTO_INCREMENT=4652 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_shout`
--

CREATE TABLE `sc_shout` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `content` varchar(300) NOT NULL DEFAULT '',
  `state` tinyint(4) NOT NULL,
  `state_validation` tinyint(4) NOT NULL DEFAULT '0',
  `gen_state_user` tinyint(4) NOT NULL DEFAULT '1',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `gen_like_count` int(10) unsigned NOT NULL DEFAULT '0',
  `gen_comment_count` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_product_id` (`product_id`),
  KEY `idx_product_like_count` (`product_id`,`gen_like_count`,`date_creation`)
) ENGINE=TokuDB AUTO_INCREMENT=172997 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_site_section`
--

CREATE TABLE `sc_site_section` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `tag` varchar(100) NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_site_view`
--

CREATE TABLE `sc_site_view` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `tag` varchar(100) NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_stat_badge`
--

CREATE TABLE `sc_stat_badge` (
  `badge_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_count` int(10) unsigned NOT NULL,
  `weight` int(10) unsigned NOT NULL DEFAULT '0',
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`badge_id`)
) ENGINE=TokuDB AUTO_INCREMENT=1442 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_stat_contact_affinity_type`
--

CREATE TABLE `sc_stat_contact_affinity_type` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `contact_id` int(10) unsigned NOT NULL,
  `type_id` tinyint(3) unsigned NOT NULL,
  `collection_count` int(10) unsigned NOT NULL DEFAULT '0',
  `popularity` decimal(9,6) DEFAULT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_contact_type` (`contact_id`,`type_id`) USING BTREE,
  UNIQUE KEY `idx_type_contact` (`type_id`,`contact_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=1957989 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_stat_contact_subtype`
--

CREATE TABLE `sc_stat_contact_subtype` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `subtype_id` tinyint(3) DEFAULT NULL,
  `max_collection_count` int(10) unsigned NOT NULL DEFAULT '0',
  `max_product_count` int(10) unsigned NOT NULL DEFAULT '0',
  `max_popularity` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_like_count` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_like_positive_count` int(10) unsigned NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_type_id` (`subtype_id`) USING BTREE,
  UNIQUE KEY `idx_subtype_id` (`subtype_id`)
) ENGINE=TokuDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_stat_content`
--

CREATE TABLE `sc_stat_content` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `gender_id` tinyint(3) unsigned DEFAULT NULL,
  `month_interval` int(10) unsigned DEFAULT NULL,
  `date_creation` date NOT NULL,
  `user_count` int(10) unsigned NOT NULL DEFAULT '0',
  `scout_no` int(10) unsigned DEFAULT NULL,
  `scout_1` int(10) unsigned DEFAULT NULL,
  `scout_2` int(10) unsigned DEFAULT NULL,
  `scout_5` int(10) unsigned DEFAULT NULL,
  `scout_10` int(10) unsigned DEFAULT NULL,
  `scout_20` int(10) unsigned DEFAULT NULL,
  `scout_50` int(10) unsigned DEFAULT NULL,
  `scout_100` int(10) unsigned DEFAULT NULL,
  `scout_101` int(10) unsigned DEFAULT NULL,
  `follower_no` int(10) unsigned DEFAULT NULL,
  `follower_1` int(10) unsigned DEFAULT NULL,
  `follower_2` int(10) unsigned DEFAULT NULL,
  `follower_5` int(10) unsigned DEFAULT NULL,
  `follower_10` int(10) unsigned DEFAULT NULL,
  `follower_20` int(10) unsigned DEFAULT NULL,
  `follower_50` int(10) unsigned DEFAULT NULL,
  `follower_100` int(10) unsigned DEFAULT NULL,
  `follower_101` int(10) unsigned DEFAULT NULL,
  `review_count` int(10) unsigned DEFAULT NULL,
  `collection_count` int(10) unsigned DEFAULT NULL,
  `has_list` int(10) unsigned DEFAULT NULL,
  `has_top` int(10) unsigned DEFAULT NULL,
  `has_poll` int(10) unsigned DEFAULT NULL,
  `has_shopping_list` int(10) unsigned DEFAULT NULL,
  `has_top_full` int(10) unsigned DEFAULT NULL,
  `avg_list_count` decimal(5,2) unsigned DEFAULT NULL,
  `avg_list_product_count` decimal(5,2) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `date_creation` (`date_creation`,`gender_id`,`month_interval`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=15725 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_stat_daily`
--

CREATE TABLE `sc_stat_daily` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `review` int(10) unsigned NOT NULL,
  `rate` int(10) unsigned NOT NULL,
  `addList` int(10) unsigned NOT NULL,
  `listLike` int(10) unsigned NOT NULL,
  `listDisLike` int(10) NOT NULL,
  `reviewLike` int(10) NOT NULL,
  `reviewDisLike` int(10) NOT NULL,
  `contactLike` int(10) NOT NULL,
  `inactive_7_days` int(10) NOT NULL,
  `inactive_30_days` int(10) NOT NULL,
  `inactive_90_days` int(10) NOT NULL,
  `active_1_day` int(10) NOT NULL,
  `count_list` int(20) DEFAULT NULL,
  `count_user` int(20) DEFAULT NULL,
  `count_review` int(20) DEFAULT NULL,
  `engagement_rate` float DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `date` (`date`)
) ENGINE=TokuDB AUTO_INCREMENT=1484 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_stat_franchise_subtype`
--

CREATE TABLE `sc_stat_franchise_subtype` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `subtype_id` tinyint(3) DEFAULT NULL,
  `max_gen_product_count` int(10) unsigned NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_subtype_id` (`subtype_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_stat_list_subtype`
--

CREATE TABLE `sc_stat_list_subtype` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `subtype_id` tinyint(3) DEFAULT NULL,
  `max_gen_count_child` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_count_parent` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_comment_count_child` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_comment_count_parent` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_like_count_child` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_like_count_parent` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_like_positive_count_child` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_like_positive_count_parent` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_child_count` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_child_item_count` int(10) unsigned NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_subtype_id` (`subtype_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_stat_month`
--

CREATE TABLE `sc_stat_month` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `year` int(10) unsigned NOT NULL,
  `month` int(10) unsigned NOT NULL,
  `average_rate_product_per_user` int(10) unsigned NOT NULL,
  `sum_recommend` int(10) unsigned NOT NULL,
  `sum_wish` int(10) unsigned NOT NULL,
  `sum_buy` int(10) unsigned NOT NULL,
  `m500average_char_per_review_per_user` int(10) NOT NULL,
  `l500average_char_per_review_per_user` int(10) NOT NULL,
  `l300average_char_per_review_per_user` int(10) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `year` (`year`,`month`)
) ENGINE=TokuDB AUTO_INCREMENT=126 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_stat_product_subtype`
--

CREATE TABLE `sc_stat_product_subtype` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `subtype_id` tinyint(3) DEFAULT NULL,
  `average_rating_count` int(10) unsigned DEFAULT NULL,
  `average_rating` decimal(6,4) unsigned DEFAULT NULL,
  `max_collection_count` int(10) unsigned NOT NULL DEFAULT '0',
  `max_contact_affinity_collection_count` int(10) unsigned NOT NULL DEFAULT '0',
  `percentile_collection_10` int(11) DEFAULT NULL,
  `percentile_collection_20` int(11) DEFAULT NULL,
  `percentile_collection_30` int(11) DEFAULT NULL,
  `percentile_collection_40` int(11) DEFAULT NULL,
  `percentile_collection_50` int(11) DEFAULT NULL,
  `percentile_collection_60` int(11) DEFAULT NULL,
  `percentile_collection_70` int(11) DEFAULT NULL,
  `percentile_collection_80` int(11) DEFAULT NULL,
  `percentile_collection_85` int(11) DEFAULT NULL,
  `percentile_collection_90` int(11) DEFAULT NULL,
  `percentile_collection_91` int(11) DEFAULT NULL,
  `percentile_collection_92` int(11) DEFAULT NULL,
  `percentile_collection_93` int(11) DEFAULT NULL,
  `percentile_collection_94` int(11) DEFAULT NULL,
  `percentile_collection_95` int(11) DEFAULT NULL,
  `percentile_collection_96` int(11) DEFAULT NULL,
  `percentile_collection_97` int(11) DEFAULT NULL,
  `percentile_collection_98` int(11) DEFAULT NULL,
  `percentile_collection_99` int(11) DEFAULT NULL,
  `percentile_collection_100` int(11) DEFAULT NULL,
  `percentile_rating_10` int(11) DEFAULT NULL,
  `percentile_rating_20` int(11) DEFAULT NULL,
  `percentile_rating_30` int(11) DEFAULT NULL,
  `percentile_rating_40` int(11) DEFAULT NULL,
  `percentile_rating_50` int(11) DEFAULT NULL,
  `percentile_rating_60` int(11) DEFAULT NULL,
  `percentile_rating_70` int(11) DEFAULT NULL,
  `percentile_rating_80` int(11) DEFAULT NULL,
  `percentile_rating_85` int(11) DEFAULT NULL,
  `percentile_rating_90` int(11) DEFAULT NULL,
  `percentile_rating_91` int(11) DEFAULT NULL,
  `percentile_rating_92` int(11) DEFAULT NULL,
  `percentile_rating_93` int(11) DEFAULT NULL,
  `percentile_rating_94` int(11) DEFAULT NULL,
  `percentile_rating_95` int(11) DEFAULT NULL,
  `percentile_rating_96` int(11) DEFAULT NULL,
  `percentile_rating_97` int(11) DEFAULT NULL,
  `percentile_rating_98` int(11) DEFAULT NULL,
  `percentile_rating_99` int(11) DEFAULT NULL,
  `percentile_rating_100` int(11) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `max_rating_count` int(10) unsigned NOT NULL DEFAULT '0',
  `max_wish_list_count` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_type_id` (`subtype_id`) USING BTREE,
  UNIQUE KEY `idx_subtype_id` (`subtype_id`)
) ENGINE=TokuDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_stat_product_type`
--

CREATE TABLE `sc_stat_product_type` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `type_id` tinyint(3) unsigned NOT NULL,
  `average_rating_count` int(10) unsigned DEFAULT NULL,
  `average_rating` decimal(6,4) unsigned DEFAULT NULL,
  `max_collection_count` int(10) unsigned NOT NULL DEFAULT '0',
  `max_contact_affinity_collection_count` int(10) unsigned NOT NULL DEFAULT '0',
  `percentile_collection_10` int(11) DEFAULT NULL,
  `percentile_collection_20` int(11) DEFAULT NULL,
  `percentile_collection_30` int(11) DEFAULT NULL,
  `percentile_collection_40` int(11) DEFAULT NULL,
  `percentile_collection_50` int(11) DEFAULT NULL,
  `percentile_collection_60` int(11) DEFAULT NULL,
  `percentile_collection_70` int(11) DEFAULT NULL,
  `percentile_collection_80` int(11) DEFAULT NULL,
  `percentile_collection_85` int(11) DEFAULT NULL,
  `percentile_collection_90` int(11) DEFAULT NULL,
  `percentile_collection_91` int(11) DEFAULT NULL,
  `percentile_collection_92` int(11) DEFAULT NULL,
  `percentile_collection_93` int(11) DEFAULT NULL,
  `percentile_collection_94` int(11) DEFAULT NULL,
  `percentile_collection_95` int(11) DEFAULT NULL,
  `percentile_collection_96` int(11) DEFAULT NULL,
  `percentile_collection_97` int(11) DEFAULT NULL,
  `percentile_collection_98` int(11) DEFAULT NULL,
  `percentile_collection_99` int(11) DEFAULT NULL,
  `percentile_collection_100` int(11) DEFAULT NULL,
  `percentile_rating_10` int(11) DEFAULT NULL,
  `percentile_rating_20` int(11) DEFAULT NULL,
  `percentile_rating_30` int(11) DEFAULT NULL,
  `percentile_rating_40` int(11) DEFAULT NULL,
  `percentile_rating_50` int(11) DEFAULT NULL,
  `percentile_rating_60` int(11) DEFAULT NULL,
  `percentile_rating_70` int(11) DEFAULT NULL,
  `percentile_rating_80` int(11) DEFAULT NULL,
  `percentile_rating_85` int(11) DEFAULT NULL,
  `percentile_rating_90` int(11) DEFAULT NULL,
  `percentile_rating_91` int(11) DEFAULT NULL,
  `percentile_rating_92` int(11) DEFAULT NULL,
  `percentile_rating_93` int(11) DEFAULT NULL,
  `percentile_rating_94` int(11) DEFAULT NULL,
  `percentile_rating_95` int(11) DEFAULT NULL,
  `percentile_rating_96` int(11) DEFAULT NULL,
  `percentile_rating_97` int(11) DEFAULT NULL,
  `percentile_rating_98` int(11) DEFAULT NULL,
  `percentile_rating_99` int(11) DEFAULT NULL,
  `percentile_rating_100` int(11) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `average_number_of_product_rated` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_type_id` (`type_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_stat_product_type_user`
--

CREATE TABLE `sc_stat_product_type_user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `type_id` tinyint(3) unsigned NOT NULL,
  `rating_count` int(10) unsigned NOT NULL DEFAULT '0',
  `average_rating` decimal(6,4) unsigned NOT NULL DEFAULT '0.0000',
  `popularity` decimal(6,4) unsigned NOT NULL DEFAULT '0.0000',
  `bias` decimal(6,4) NOT NULL DEFAULT '0.0000',
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_user` (`user_id`,`type_id`) USING BTREE,
  UNIQUE KEY `idx_type` (`type_id`,`user_id`) USING BTREE,
  KEY `type_id` (`type_id`,`rating_count`)
) ENGINE=TokuDB AUTO_INCREMENT=545820422 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_stat_user`
--

CREATE TABLE `sc_stat_user` (
  `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `opening_ratio` decimal(8,7) unsigned DEFAULT NULL,
  `rating_count` int(10) unsigned NOT NULL DEFAULT '0',
  `collection_count` int(10) unsigned NOT NULL DEFAULT '0',
  `review_count` int(10) unsigned NOT NULL DEFAULT '0',
  `follower_count` int(10) unsigned NOT NULL DEFAULT '0',
  `scout_count` int(10) unsigned NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`user_id`)
) ENGINE=TokuDB AUTO_INCREMENT=646623 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_stat_user_max_similarity`
--

CREATE TABLE `sc_stat_user_max_similarity` (
  `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `max_similarity` float DEFAULT NULL,
  `max_similarity_1` float DEFAULT NULL,
  `max_similarity_2` float DEFAULT NULL,
  `max_similarity_3` float DEFAULT NULL,
  `max_similarity_4` float DEFAULT NULL,
  `max_similarity_5` float DEFAULT NULL,
  `max_similarity_6` float DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`user_id`)
) ENGINE=TokuDB AUTO_INCREMENT=295400 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_stat_user_subtype`
--

CREATE TABLE `sc_stat_user_subtype` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `subtype_id` tinyint(3) DEFAULT NULL,
  `max_gen_scout_count` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_follower_count` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_collection_count` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_review_count` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_list_count` int(10) unsigned NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_subtype_id` (`subtype_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_stat_venue_subtype`
--

CREATE TABLE `sc_stat_venue_subtype` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `subtype_id` tinyint(3) DEFAULT NULL,
  `max_gen_product_count` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_favorite_count` int(10) unsigned NOT NULL DEFAULT '0',
  `max_gen_weight` int(10) unsigned NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_subtype_id` (`subtype_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_state_reference`
--

CREATE TABLE `sc_state_reference` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `state_reference_type_id` int(10) unsigned NOT NULL,
  `ref` int(11) NOT NULL,
  `label` varchar(100) NOT NULL DEFAULT '',
  `is_review` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_list` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_message` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_shout` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_state_reference_type`
--

CREATE TABLE `sc_state_reference_type` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_subtype`
--

CREATE TABLE `sc_subtype` (
  `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `type_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `label` varchar(128) NOT NULL DEFAULT '',
  `position` tinyint(3) unsigned DEFAULT '0',
  `is_index` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_type_id` (`type_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_tag`
--

CREATE TABLE `sc_tag` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `gen_type_id` tinyint(3) unsigned NOT NULL,
  `subtype_id` tinyint(3) unsigned NOT NULL,
  `label` varchar(100) NOT NULL DEFAULT '',
  `type_id_related` tinyint(3) unsigned DEFAULT NULL,
  `user_id_creation` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `user_id_last_udpate` int(10) unsigned DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id_validation` int(10) unsigned DEFAULT NULL,
  `date_validation` timestamp NULL DEFAULT NULL,
  `_old_music_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_type_id_related` (`type_id_related`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=14538 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_task_type`
--

CREATE TABLE `sc_task_type` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `tag` varchar(255) NOT NULL,
  `label` varchar(255) NOT NULL,
  `description` text,
  `json` text,
  `auto_execute` int(3) NOT NULL DEFAULT '1',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_test_model`
--

CREATE TABLE `sc_test_model` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(128) DEFAULT NULL COMMENT 'Label',
  `title` varchar(128) DEFAULT NULL COMMENT 'Original title.',
  `json` mediumtext COMMENT 'All the model information in JSON format.',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_ticker`
--

CREATE TABLE `sc_ticker` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `type_id` tinyint(3) unsigned DEFAULT NULL,
  `label` varchar(150) DEFAULT '',
  `description` varchar(150) NOT NULL DEFAULT '',
  `link` varchar(200) DEFAULT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `list_id` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `date_publication` timestamp NULL DEFAULT NULL,
  `weight` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `state` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=612 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_tv_channel`
--

CREATE TABLE `sc_tv_channel` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `plurimedia_ref` int(10) unsigned DEFAULT NULL,
  `label` varchar(100) DEFAULT NULL,
  `tv_channel_thema_id` int(10) DEFAULT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '1',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_plurimedia` (`plurimedia_ref`)
) ENGINE=TokuDB AUTO_INCREMENT=4056 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_tv_channel_thema`
--

CREATE TABLE `sc_tv_channel_thema` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_tv_guide`
--

CREATE TABLE `sc_tv_guide` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `tv_channel_id` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `date_start` timestamp NULL DEFAULT NULL,
  `date_end` timestamp NULL DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `episode` smallint(5) unsigned DEFAULT NULL,
  `season` smallint(5) unsigned DEFAULT NULL,
  `gen_plurimedia_ref_product` int(10) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_product_date` (`product_id`,`date_start`),
  KEY `idx_date` (`date_start`)
) ENGINE=TokuDB AUTO_INCREMENT=1491182 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_tv_network`
--

CREATE TABLE `sc_tv_network` (
  `id` int(5) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(50) DEFAULT NULL,
  `position` tinyint(3) unsigned DEFAULT NULL,
  `plurimedia_ref` smallint(5) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_plurimedia` (`plurimedia_ref`)
) ENGINE=TokuDB AUTO_INCREMENT=23775 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_tv_network_channel`
--

CREATE TABLE `sc_tv_network_channel` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `tv_channel_id` int(10) unsigned NOT NULL,
  `tv_network_id` smallint(5) unsigned DEFAULT NULL,
  `channel_number` smallint(5) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_channel_network` (`tv_channel_id`,`tv_network_id`)
) ENGINE=TokuDB AUTO_INCREMENT=62423 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_type`
--

CREATE TABLE `sc_type` (
  `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(20) NOT NULL DEFAULT '',
  `related_to` varchar(30) NOT NULL DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_action`
--

CREATE TABLE `sc_user_action` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_advice`
--

CREATE TABLE `sc_user_advice` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id_to` int(10) unsigned NOT NULL,
  `user_id_from` int(10) unsigned NOT NULL,
  `collection_id` int(10) unsigned DEFAULT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `list_id` int(10) unsigned DEFAULT NULL,
  `state` tinyint(4) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=10796 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_application`
--

CREATE TABLE `sc_user_application` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `application_id` int(10) unsigned NOT NULL,
  `state` tinyint(4) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user_id_application_id` (`user_id`,`application_id`)
) ENGINE=TokuDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_beta_mobile`
--

CREATE TABLE `sc_user_beta_mobile` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `device_reference` tinyint(3) unsigned NOT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user_id` (`user_id`)
) ENGINE=TokuDB AUTO_INCREMENT=4500 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_campaign`
--

CREATE TABLE `sc_user_campaign` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `campaign_id` int(10) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `label` varchar(250) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_catchall`
--

CREATE TABLE `sc_user_catchall` (
  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
  `username` varchar(20) NOT NULL DEFAULT '',
  `firstname` varchar(30) NOT NULL DEFAULT '',
  `lastname` varchar(30) NOT NULL DEFAULT '',
  PRIMARY KEY (`user_id`),
  KEY `username` (`username`),
  KEY `firstname` (`firstname`),
  KEY `lastname` (`lastname`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_cookie`
--

CREATE TABLE `sc_user_cookie` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '1',
  `cookie_ref` varchar(32) DEFAULT NULL,
  `last_session_ref` varchar(30) DEFAULT NULL,
  `application_id` int(10) unsigned DEFAULT NULL,
  `ip` int(10) unsigned DEFAULT NULL,
  `ref_host` varchar(20) DEFAULT NULL,
  `json` text NOT NULL,
  `date_expiration` timestamp NULL DEFAULT NULL,
  `date_creation` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`,`state`),
  UNIQUE KEY `idx_user_session__cookie_ref_state` (`cookie_ref`,`state`) USING BTREE,
  KEY `idx_user_session__state` (`state`),
  KEY `idx_user_session__user_id` (`user_id`)
) ENGINE=TokuDB AUTO_INCREMENT=3797118 DEFAULT CHARSET=utf8 `compression`='tokudb_small'
/*!50100 PARTITION BY LIST (state)
(PARTITION p0 VALUES IN (0) ENGINE = TokuDB,
 PARTITION p1 VALUES IN (1) ENGINE = TokuDB) */;

--
-- Table structure for table `sc_user_device`
--

CREATE TABLE `sc_user_device` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `device_key` varchar(200) NOT NULL DEFAULT '',
  `user_id` int(10) unsigned DEFAULT NULL,
  `device_os_id` tinyint(3) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_device` (`device_key`),
  KEY `idx_user` (`user_id`),
  KEY `device_os_id` (`user_id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_editor`
--

CREATE TABLE `sc_user_editor` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `editor_id` int(10) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user_id_editor_id` (`user_id`,`editor_id`)
) ENGINE=TokuDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_exclusion`
--

CREATE TABLE `sc_user_exclusion` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `type_id_related` tinyint(3) unsigned NOT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=105518 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_interaction`
--

CREATE TABLE `sc_user_interaction` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `user_id_related` int(10) unsigned NOT NULL,
  `action_count` int(10) unsigned NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ix_user_id_user_id_related` (`user_id`,`user_id_related`),
  KEY `idx_user_id_related` (`user_id_related`)
) ENGINE=TokuDB AUTO_INCREMENT=4310652 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_jail`
--

CREATE TABLE `sc_user_jail` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `user_id_admin` int(10) unsigned NOT NULL,
  `type` tinyint(3) unsigned NOT NULL,
  `description` text,
  `date_release` timestamp NULL DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_product_progress`
--

CREATE TABLE `sc_user_product_progress` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `gen_subtype_id` tinyint(3) unsigned NOT NULL,
  `parent_1_id` int(10) unsigned DEFAULT NULL,
  `parent_2_id` int(10) unsigned DEFAULT NULL,
  `level_1` smallint(5) unsigned DEFAULT NULL,
  `level_2` text,
  `absolute_level` smallint(5) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `done_count` smallint(5) unsigned DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_user__parent_1_id` (`user_id`,`parent_1_id`) USING BTREE,
  KEY `idx_user_id` (`user_id`) USING BTREE,
  KEY `idx_product_id` (`product_id`) USING BTREE,
  KEY `idx_parent_1_id` (`parent_1_id`) USING BTREE,
  KEY `idx_parent_2_id` (`parent_2_id`) USING BTREE,
  KEY `idx_level_1` (`level_1`) USING BTREE,
  KEY `idx_absolute_level` (`absolute_level`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=46898247 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_product_recommendation`
--

CREATE TABLE `sc_user_product_recommendation` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `product_id` int(11) DEFAULT NULL,
  `type_id` smallint(2) unsigned DEFAULT NULL,
  `position` int(5) unsigned NOT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `product_id` (`product_id`,`user_id`,`type_id`),
  KEY `user_id` (`user_id`,`type_id`,`position`)
) ENGINE=TokuDB AUTO_INCREMENT=37894951 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_quality`
--

CREATE TABLE `sc_user_quality` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `level` tinyint(4) NOT NULL DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `user_id_creation` int(10) unsigned DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_id_last_update` int(10) unsigned DEFAULT NULL,
  `date_validation` timestamp NULL DEFAULT NULL,
  `user_id_validation` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_tv_channel`
--

CREATE TABLE `sc_user_tv_channel` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `tv_channel_id` int(10) NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`,`tv_channel_id`),
  KEY `idx_tv_channel_id` (`tv_channel_id`)
) ENGINE=TokuDB AUTO_INCREMENT=327025 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_tv_network`
--

CREATE TABLE `sc_user_tv_network` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `tv_network_id` smallint(5) NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`,`tv_network_id`),
  KEY `idx_tv_network_id` (`tv_network_id`)
) ENGINE=TokuDB AUTO_INCREMENT=25717 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_venue`
--

CREATE TABLE `sc_user_venue` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `venue_id` int(10) unsigned NOT NULL,
  `favorite` tinyint(3) unsigned DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user_venue` (`user_id`,`venue_id`)
) ENGINE=TokuDB AUTO_INCREMENT=70495 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_vod_editor`
--

CREATE TABLE `sc_user_vod_editor` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `vod_editor_id` int(10) NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`,`vod_editor_id`),
  KEY `idx_vod_editor_id` (`vod_editor_id`)
) ENGINE=TokuDB AUTO_INCREMENT=248682 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_user_walkthrough`
--

CREATE TABLE `sc_user_walkthrough` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `related_subtype_id` tinyint(3) unsigned NOT NULL,
  `count_products` int(10) unsigned NOT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user_id` (`user_id`),
  KEY `related_subtype_id` (`related_subtype_id`,`user_id`)
) ENGINE=TokuDB AUTO_INCREMENT=1336 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_venue`
--

CREATE TABLE `sc_venue` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `plurimedia_ref` varchar(15) DEFAULT NULL,
  `label` varchar(255) DEFAULT NULL,
  `subtype_id` tinyint(3) unsigned DEFAULT NULL,
  `street_number` varchar(30) DEFAULT NULL,
  `route` varchar(255) DEFAULT NULL,
  `postal_code` varchar(20) DEFAULT NULL,
  `locality` varchar(255) DEFAULT NULL,
  `administrative_area_level_2` varchar(255) DEFAULT NULL,
  `administrative_area_level_1` varchar(255) DEFAULT NULL,
  `zip_country_id` int(10) unsigned DEFAULT NULL,
  `latitude` double DEFAULT NULL,
  `longitude` double DEFAULT NULL,
  `formatted_address` varchar(255) DEFAULT NULL,
  `long_address_plurimedia` varchar(255) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `json` mediumtext,
  `gen_product_count` smallint(5) unsigned NOT NULL DEFAULT '0',
  `gen_favorite_count` int(10) unsigned NOT NULL DEFAULT '0',
  `gen_weight` smallint(5) DEFAULT NULL,
  `flag_gen` tinyint(4) NOT NULL DEFAULT '0',
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `search_field` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ix_plurimedia_ref` (`plurimedia_ref`),
  KEY `idx_flag_gen` (`flag_gen`),
  KEY `idx_weight` (`gen_weight`),
  KEY `idx_product_count` (`gen_product_count`,`gen_weight`)
) ENGINE=TokuDB AUTO_INCREMENT=3372 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_venue_programming`
--

CREATE TABLE `sc_venue_programming` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `venue_id` int(10) unsigned DEFAULT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `plurimedia_product_theater_id` int(10) unsigned DEFAULT NULL,
  `date_start` timestamp NULL DEFAULT NULL,
  `date_end` timestamp NULL DEFAULT NULL,
  `programming_litteral` varchar(500) DEFAULT NULL,
  `is_first_week` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_premiere` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `tag_id_type_sound` int(10) unsigned DEFAULT NULL,
  `tag_id_type_audio` int(10) unsigned DEFAULT NULL,
  `tag_id_type_projection` int(10) unsigned DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `json` mediumtext,
  `flag_gen` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_state` (`state`),
  KEY `idx_venue_state` (`venue_id`,`state`),
  KEY `idx_pluri_product` (`plurimedia_product_theater_id`),
  KEY `product_id` (`product_id`)
) ENGINE=TokuDB AUTO_INCREMENT=4911846 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_venue_showtime`
--

CREATE TABLE `sc_venue_showtime` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `venue_id` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `venue_programming_id` int(10) unsigned NOT NULL,
  `plurimedia_product_theater_id` int(10) unsigned NOT NULL,
  `date_start` timestamp NULL DEFAULT NULL,
  `date_end` timestamp NULL DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `plurimedia_product_theater_id` (`plurimedia_product_theater_id`)
) ENGINE=TokuDB AUTO_INCREMENT=47950056 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_zip_city`
--

CREATE TABLE `sc_zip_city` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `zip_country_id` int(10) unsigned NOT NULL,
  `country` varchar(2) NOT NULL,
  `language` varchar(2) NOT NULL,
  `ref` bigint(20) NOT NULL,
  `iso2` varchar(6) NOT NULL,
  `region1` varchar(60) NOT NULL,
  `region2` varchar(60) NOT NULL,
  `region3` varchar(60) NOT NULL,
  `region4` varchar(60) NOT NULL,
  `zip` varchar(10) NOT NULL,
  `city` varchar(60) NOT NULL,
  `area1` varchar(80) NOT NULL,
  `area2` varchar(80) NOT NULL,
  `lat` double NOT NULL,
  `lng` double NOT NULL,
  `tz` varchar(30) NOT NULL,
  `utc` varchar(10) NOT NULL,
  `dst` varchar(1) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_zip_country_id` (`zip_country_id`) USING BTREE,
  KEY `idx_country` (`country`) USING BTREE,
  KEY `idx_zip` (`zip`)
) ENGINE=TokuDB AUTO_INCREMENT=2656445 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_zip_code`
--

CREATE TABLE `sc_zip_code` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `zip_country_id` int(10) unsigned DEFAULT NULL,
  `zip` varchar(10) DEFAULT NULL,
  `description` text,
  PRIMARY KEY (`id`),
  KEY `idx_zip` (`zip`) USING BTREE,
  KEY `fk_zip_country_id` (`zip_country_id`) USING BTREE
) ENGINE=TokuDB AUTO_INCREMENT=2594945 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sc_zip_country`
--

CREATE TABLE `sc_zip_country` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `reference` char(2) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `seeks_delete`
--

CREATE TABLE `seeks_delete` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `contact_id` int(10) unsigned DEFAULT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `product_id` int(10) unsigned DEFAULT NULL,
  `list_id` int(10) unsigned DEFAULT NULL,
  `franchise_id` int(10) unsigned DEFAULT NULL,
  `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `product_id` (`product_id`),
  KEY `date_creation` (`date_creation`)
) ENGINE=TokuDB AUTO_INCREMENT=17005119 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `smart_ad_creation`
--

CREATE TABLE `smart_ad_creation` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(100) NOT NULL DEFAULT '',
  `slug` varchar(100) NOT NULL DEFAULT '',
  `sc_campaign_id` int(10) unsigned NOT NULL,
  `smart_ad_format_id` int(10) unsigned NOT NULL,
  `sc_user_integrator_id` int(10) unsigned NOT NULL,
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `json` mediumtext,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `smart_ad_format`
--

CREATE TABLE `smart_ad_format` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL DEFAULT '',
  `state` tinyint(4) NOT NULL DEFAULT '0',
  `algo` varchar(30) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `sphinx_venue`
--

CREATE TABLE `sphinx_venue` (
  `id` bigint(20) unsigned NOT NULL,
  `weight` int(11) NOT NULL,
  `query` varchar(3072) NOT NULL,
  `_sph_geodist` float DEFAULT NULL,
  `group_id` int(11) DEFAULT NULL,
  KEY `query` (`query`(1024))
) ENGINE=SPHINX DEFAULT CHARSET=utf8 CONNECTION='sphinx://172.16.0.33:9312/search_venues';

--
-- Table structure for table `sphinx_venue_max`
--

CREATE TABLE `sphinx_venue_max` (
  `max_doc_id` int(10) unsigned NOT NULL DEFAULT '0',
  KEY `max_doc_id` (`max_doc_id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `stats_master`
--

CREATE TABLE `stats_master` (
  `TABLE_NAME` varchar(64) NOT NULL DEFAULT '',
  `INDEX_NAME` varchar(64) NOT NULL DEFAULT '',
  `CONCAT(index_name, '.', table_name)` varchar(129) NOT NULL DEFAULT ''
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `tmpDeleteDupeLike`
--

CREATE TABLE `tmpDeleteDupeLike` (
  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
  `list_id` int(10) unsigned DEFAULT NULL,
  `maxId` int(10) unsigned DEFAULT NULL,
  KEY `ix_zizi` (`user_id`,`list_id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `tmp_lost_list_media`
--

CREATE TABLE `tmp_lost_list_media` (
  `user_id` int(11) NOT NULL,
  `list_id` int(11) NOT NULL,
  `param_id` int(11) NOT NULL,
  `param_index_id` int(11) NOT NULL,
  `is_done` tinyint(3) unsigned DEFAULT '0'
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `tmp_lost_messaged_users`
--

CREATE TABLE `tmp_lost_messaged_users` (
  `user_id` int(11) NOT NULL
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `tmp_lost_user_media`
--

CREATE TABLE `tmp_lost_user_media` (
  `user_id` int(11) NOT NULL,
  `param_id` int(11) NOT NULL,
  `param_index_id` int(11) NOT NULL,
  `is_done` tinyint(3) unsigned DEFAULT '0'
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `tmp_pouet`
--

CREATE TABLE `tmp_pouet` (
  `id` int(10) unsigned NOT NULL DEFAULT '0',
  `product_id_key` int(10) unsigned DEFAULT NULL,
  `contact_id_value` int(10) unsigned DEFAULT NULL,
  `ranking` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `tmp_tempHits`
--

CREATE TABLE `tmp_tempHits` (
  `user_id` int(10) unsigned DEFAULT NULL,
  `list_id` int(10) unsigned DEFAULT NULL,
  `collection_id_review` int(10) unsigned DEFAULT NULL,
  KEY `ix_list` (`user_id`,`list_id`),
  KEY `ix_collection` (`user_id`,`collection_id_review`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `tvdb_anime`
--

CREATE TABLE `tvdb_anime` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `tvdb_id` int(11) DEFAULT NULL,
  `anidb_id` int(11) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `anidb_id` (`anidb_id`,`tvdb_id`),
  KEY `tvdb_id` (`tvdb_id`)
) ENGINE=TokuDB AUTO_INCREMENT=16461 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `tvdb_link`
--

CREATE TABLE `tvdb_link` (
  `product_id` int(11) NOT NULL,
  `label_sc` varchar(255) DEFAULT NULL,
  `id_tvdb` int(11) DEFAULT NULL,
  `id_anidb` varchar(10) DEFAULT NULL,
  `language_tvdb` varchar(3) DEFAULT NULL,
  `label_tvdb` varchar(255) DEFAULT NULL,
  `path_banner_tvdb` varchar(255) DEFAULT NULL,
  `overview_tvdb` text,
  `date_first_aired_tvdb` varchar(15) DEFAULT NULL,
  `id_imdb` varchar(50) DEFAULT NULL,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `is_valid` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=TokuDB AUTO_INCREMENT=15972 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `util_calendar`
--

CREATE TABLE `util_calendar` (
  `date_day` varchar(10) NOT NULL,
  PRIMARY KEY (`date_day`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `vod_editor`
--

CREATE TABLE `vod_editor` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `id_cnc` smallint(6) DEFAULT NULL,
  `label` varchar(200) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_cnc` (`id_cnc`)
) ENGINE=TokuDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `vod_product`
--

CREATE TABLE `vod_product` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `gid` char(36) NOT NULL DEFAULT '',
  `allocine_ref_id` int(11) DEFAULT NULL,
  `sc_product_id` int(11) DEFAULT NULL,
  `title` varchar(500) NOT NULL DEFAULT '',
  `original_title` varchar(500) DEFAULT NULL,
  `director` varchar(150) DEFAULT NULL,
  `year_of_production` smallint(4) DEFAULT NULL,
  `catch_all` varchar(500) DEFAULT '',
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `sc_product_id` (`sc_product_id`),
  KEY `allocine_ref_id` (`allocine_ref_id`),
  KEY `gid` (`gid`),
  KEY `catch_all` (`catch_all`)
) ENGINE=TokuDB AUTO_INCREMENT=15605 DEFAULT CHARSET=utf8 `compression`='tokudb_small';

--
-- Table structure for table `vod_product_modality`
--

CREATE TABLE `vod_product_modality` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `ref_vod_modality_id` int(11) NOT NULL,
  `vod_gid` char(36) NOT NULL DEFAULT '',
  `sc_product_id` int(11) DEFAULT NULL,
  `vod_editor_id` int(5) NOT NULL,
  `date_start` datetime DEFAULT NULL,
  `date_end` datetime DEFAULT NULL,
  `mode` varchar(10) DEFAULT NULL,
  `quality` varchar(10) DEFAULT NULL,
  `price` varchar(5) DEFAULT NULL,
  `language` varchar(50) DEFAULT NULL,
  `url` varchar(300) NOT NULL DEFAULT '',
  `iptv` varchar(250) DEFAULT NULL,
  `date_creation` timestamp NULL DEFAULT NULL,
  `date_last_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `sc_product_id` (`sc_product_id`),
  KEY `idx_end_product` (`date_end`,`sc_product_id`),
  KEY `sc_product_id_2` (`sc_product_id`,`date_end`),
  KEY `vod_gid` (`vod_gid`)
) ENGINE=TokuDB AUTO_INCREMENT=24304196 DEFAULT CHARSET=utf8 `compression`='tokudb_small';


