-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jun 28, 2018 at 08:26 AM
-- Server version: 5.6.38
-- PHP Version: 7.1.12

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";



--
-- Table structure for table `attachment`
--

CREATE TABLE `attachment` (
  `id` int(11) NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `caption` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `alt` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `blog_category`
--

CREATE TABLE `blog_category` (
  `id` int(11) NOT NULL,
  `term_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `term_slug` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `term_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `term_description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `term_image` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `blog_options`
--

CREATE TABLE `blog_options` (
  `id` int(11) NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `options` longtext COLLATE utf8_unicode_ci COMMENT '(DC2Type:json_array)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `blog_options`
--

INSERT INTO `blog_options` (`id`, `name`, `type`, `options`) VALUES
(1, 'options', NULL, '{\"blog_title\":\"hyper Blog Magazine\",\"blog_slogan\":\"PHP Script\",\"auto_feature\":\"true\",\"allow_comment\":\"close\",\"home_page\":\"home.widget.html.twig\",\"language\":null,\"use_page_home\":false,\"page\":null,\"sitemap_priority_post\":null,\"sitemap_changefreq_post\":\"monthly\",\"sitemap_priority_page\":null,\"sitemap_changefreq_page\":\"monthly\",\"blog_theme\":\"magz\",\"blog_icon\":null,\"blog_pagination\":\"10\",\"blog_logo\":null,\"comment\":null,\"contact_email\":null,\"captcha_secret\":null,\"captcha_site\":null,\"map\":null,\"analytics\":null,\"register\":1,\"user_register\":0,\"default_mail\":0,\"mail_server\":null,\"user_mail\":\"test@localhost.com\",\"comment_type\":\"disque\",\"view_count\":1,\"like_button\":1,\"guest_post\":1,\"guest_post_upload\":1,\"guest_post_mail\":1,\"analytics_client_key\":\"1080677902587-3absumr91qld5re80atkkr94naofifio.apps.googleusercontent.com\"}'),
(2, 'magz_options', 'theme_option', '{\"script\":\"\",\"footer\":\"\\u00a9 Copyright SM PHP Script - Developed by Mazonblog\",\"searchbar\":\"show\",\"post_nav\":\"show\",\"skin_style\":\"skin-default\",\"skin_box\":\"\",\"related_post\":\"4\",\"date\":\"show\",\"featureImage\":\"hide\",\"author\":\"show\",\"is_rtl\":\"hide\",\"facebook\":\"\",\"twitter\":\"\",\"instagram\":\"\",\"youtube\":\"\",\"vimeo\":\"\"}');

-- --------------------------------------------------------

--
-- Table structure for table `blog_post`
--

CREATE TABLE `blog_post` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `content` longtext COLLATE utf8_unicode_ci,
  `fields` longtext COLLATE utf8_unicode_ci,
  `meta` longtext COLLATE utf8_unicode_ci NOT NULL COMMENT '(DC2Type:json_array)',
  `slug` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL,
  `modified_at` datetime DEFAULT NULL,
  `page_template` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `published` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `feature_image` int(11) DEFAULT NULL,
  `fake_tag` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `view` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `blog_post_blog_category`
--

CREATE TABLE `blog_post_blog_category` (
  `blog_post_id` int(11) NOT NULL,
  `blog_category_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `campaigns`
--

CREATE TABLE `campaigns` (
  `id` int(11) NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `options` longtext COLLATE utf8_unicode_ci NOT NULL COMMENT '(DC2Type:json_array)',
  `active` tinyint(1) NOT NULL,
  `start_at` datetime NOT NULL,
  `progress` int(11) NOT NULL,
  `total` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `languages`
--

CREATE TABLE `languages` (
  `id` int(11) NOT NULL,
  `language` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `code` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `image` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `mail_servers`
--

CREATE TABLE `mail_servers` (
  `id` int(11) NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `options` longtext COLLATE utf8_unicode_ci NOT NULL COMMENT '(DC2Type:json_array)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `member_ship`
--

CREATE TABLE `member_ship` (
  `id` int(11) NOT NULL,
  `slug` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `about` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `contact` longtext COLLATE utf8_unicode_ci COMMENT '(DC2Type:json_array)',
  `profile_image` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `active` tinyint(1) NOT NULL,
  `roles` longtext COLLATE utf8_unicode_ci NOT NULL COMMENT '(DC2Type:json_array)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `member_ship_blog_post`
--

CREATE TABLE `member_ship_blog_post` (
  `member_ship_id` int(11) NOT NULL,
  `blog_post_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `newsletters`
--

CREATE TABLE `newsletters` (
  `id` int(11) NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `html` longtext COLLATE utf8_unicode_ci NOT NULL,
  `style` longtext COLLATE utf8_unicode_ci,
  `templates` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `polls`
--

CREATE TABLE `polls` (
  `id` int(11) NOT NULL,
  `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `choices` longtext COLLATE utf8_unicode_ci,
  `result` longtext COLLATE utf8_unicode_ci COMMENT '(DC2Type:json_array)',
  `templates` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `setting` longtext COLLATE utf8_unicode_ci COMMENT '(DC2Type:json_array)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `subscribers`
--

CREATE TABLE `subscribers` (
  `id` int(11) NOT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `confirm` tinyint(1) NOT NULL,
  `join_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `subscribers_subscriber_group`
--

CREATE TABLE `subscribers_subscriber_group` (
  `subscribers_id` int(11) NOT NULL,
  `subscriber_group_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `subscriber_group`
--

CREATE TABLE `subscriber_group` (
  `id` int(11) NOT NULL,
  `group_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `user`
--

CREATE TABLE `user` (
  `id` int(11) NOT NULL,
  `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `roles` longtext COLLATE utf8_unicode_ci NOT NULL COMMENT '(DC2Type:json_array)',
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `image` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `background` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `content` longtext COLLATE utf8_unicode_ci,
  `slug` varchar(128) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;



--
-- Indexes for dumped tables
--

--
-- Indexes for table `attachment`
--
ALTER TABLE `attachment`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `blog_category`
--
ALTER TABLE `blog_category`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `blog_options`
--
ALTER TABLE `blog_options`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `blog_post`
--
ALTER TABLE `blog_post`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UNIQ_BA5AE01D989D9B62` (`slug`),
  ADD KEY `IDX_BA5AE01DA76ED395` (`user_id`);

--
-- Indexes for table `blog_post_blog_category`
--
ALTER TABLE `blog_post_blog_category`
  ADD PRIMARY KEY (`blog_post_id`,`blog_category_id`),
  ADD KEY `IDX_C9F85ADCA77FBEAF` (`blog_post_id`),
  ADD KEY `IDX_C9F85ADCCB76011C` (`blog_category_id`);

--
-- Indexes for table `campaigns`
--
ALTER TABLE `campaigns`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `languages`
--
ALTER TABLE `languages`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `mail_servers`
--
ALTER TABLE `mail_servers`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `member_ship`
--
ALTER TABLE `member_ship`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `member_ship_blog_post`
--
ALTER TABLE `member_ship_blog_post`
  ADD PRIMARY KEY (`member_ship_id`,`blog_post_id`),
  ADD KEY `IDX_A83D12C57DA286E9` (`member_ship_id`),
  ADD KEY `IDX_A83D12C5A77FBEAF` (`blog_post_id`);

--
-- Indexes for table `newsletters`
--
ALTER TABLE `newsletters`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `polls`
--
ALTER TABLE `polls`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `subscribers`
--
ALTER TABLE `subscribers`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `subscribers_subscriber_group`
--
ALTER TABLE `subscribers_subscriber_group`
  ADD PRIMARY KEY (`subscribers_id`,`subscriber_group_id`),
  ADD KEY `IDX_A8A2404B4F6E6AC1` (`subscribers_id`),
  ADD KEY `IDX_A8A2404B8D9A4678` (`subscriber_group_id`);

--
-- Indexes for table `subscriber_group`
--
ALTER TABLE `subscriber_group`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `user`
--
ALTER TABLE `user`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UNIQ_8D93D649989D9B62` (`slug`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `attachment`
--
ALTER TABLE `attachment`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `blog_category`
--
ALTER TABLE `blog_category`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `blog_options`
--
ALTER TABLE `blog_options`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `blog_post`
--
ALTER TABLE `blog_post`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `campaigns`
--
ALTER TABLE `campaigns`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `languages`
--
ALTER TABLE `languages`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `mail_servers`
--
ALTER TABLE `mail_servers`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `member_ship`
--
ALTER TABLE `member_ship`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `newsletters`
--
ALTER TABLE `newsletters`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `polls`
--
ALTER TABLE `polls`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `subscribers`
--
ALTER TABLE `subscribers`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `subscriber_group`
--
ALTER TABLE `subscriber_group`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `blog_post`
--
ALTER TABLE `blog_post`
  ADD CONSTRAINT `FK_BA5AE01DA76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`);

--
-- Constraints for table `blog_post_blog_category`
--
ALTER TABLE `blog_post_blog_category`
  ADD CONSTRAINT `FK_C9F85ADCA77FBEAF` FOREIGN KEY (`blog_post_id`) REFERENCES `blog_post` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_C9F85ADCCB76011C` FOREIGN KEY (`blog_category_id`) REFERENCES `blog_category` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `member_ship_blog_post`
--
ALTER TABLE `member_ship_blog_post`
  ADD CONSTRAINT `FK_A83D12C57DA286E9` FOREIGN KEY (`member_ship_id`) REFERENCES `member_ship` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_A83D12C5A77FBEAF` FOREIGN KEY (`blog_post_id`) REFERENCES `blog_post` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `subscribers_subscriber_group`
--
ALTER TABLE `subscribers_subscriber_group`
  ADD CONSTRAINT `FK_A8A2404B4F6E6AC1` FOREIGN KEY (`subscribers_id`) REFERENCES `subscribers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_A8A2404B8D9A4678` FOREIGN KEY (`subscriber_group_id`) REFERENCES `subscriber_group` (`id`) ON DELETE CASCADE;
