--
-- Database: `api-cms-test`
--
CREATE DATABASE IF NOT EXISTS `api-cms-test` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `api-cms-test`;

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

--
-- Table structure for table `cms__column`
--

CREATE TABLE `cms__column` (
  `columnID` int(11) UNSIGNED NOT NULL COMMENT 'Azonosító',
  `layoutID` int(11) UNSIGNED NOT NULL COMMENT 'Layout',
  `name` varchar(64) NOT NULL COMMENT 'Név'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__column`
--

INSERT INTO `cms__column` (`columnID`, `layoutID`, `name`) VALUES
(1, 1, 'Bal'),
(2, 1, 'Közép'),
(3, 1, 'Jobb');

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

--
-- Table structure for table `cms__column_has_panels`
--

CREATE TABLE `cms__column_has_panels` (
  `columnID` int(11) UNSIGNED NOT NULL COMMENT 'Column',
  `panelID` int(11) UNSIGNED NOT NULL COMMENT 'Panel',
  `maxPerColumn` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__column_has_panels`
--

INSERT INTO `cms__column_has_panels` (`columnID`, `panelID`, `maxPerColumn`) VALUES
(1, 1, NULL),
(2, 1, NULL),
(2, 2, NULL),
(2, 3, NULL);

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

--
-- Table structure for table `cms__domain`
--

CREATE TABLE `cms__domain` (
  `domainID` int(11) UNSIGNED NOT NULL COMMENT 'Azonosító',
  `name` varchar(32) NOT NULL COMMENT 'Név',
  `defaultSiteID` int(11) UNSIGNED NOT NULL COMMENT 'Alapértelmezett site',
  `gaTrackingID` varchar(45) DEFAULT NULL COMMENT 'Analytics Tracking ID'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__domain`
--

INSERT INTO `cms__domain` (`domainID`, `name`, `defaultSiteID`, `gaTrackingID`) VALUES
(1, 'cms.toma', 1, NULL),
(2, 'api-cms.dani', 1, NULL),
(3, 'cms.w5', 1, NULL);

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

--
-- Table structure for table `cms__file`
--

CREATE TABLE `cms__file` (
  `fileID` int(11) UNSIGNED NOT NULL COMMENT 'Azonosító',
  `folderID` int(11) UNSIGNED NOT NULL COMMENT 'Mappa',
  `name` varchar(128) NOT NULL COMMENT 'Név',
  `alias` varchar(128) DEFAULT NULL,
  `url` varchar(255) NOT NULL COMMENT 'Fájl url',
  `status` enum('active','inactive') NOT NULL DEFAULT 'active' COMMENT 'Státusz',
  `activeFrom` datetime DEFAULT NULL,
  `activeTo` datetime DEFAULT NULL,
  `type` enum('static','page','link','rest') NOT NULL DEFAULT 'page' COMMENT 'Fájltipus',
  `createDate` datetime NOT NULL COMMENT 'Létrehozva',
  `modifyDate` datetime DEFAULT NULL COMMENT 'Módosítva'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__file`
--

INSERT INTO `cms__file` (`fileID`, `folderID`, `name`, `alias`, `url`, `status`, `activeFrom`, `activeTo`, `type`, `createDate`, `modifyDate`) VALUES
(1, 1, 'Kezdőlap', NULL, '/hu/index.html', 'active', NULL, NULL, 'page', '2016-08-29 21:53:00', NULL),
(2, 1, 'Hiba', NULL, '/hu/hiba.html', 'active', NULL, NULL, 'page', '2016-08-29 21:53:00', NULL),
(3, 2, 'teszt.txt', NULL, '/hu/letoltes/teszt.txt', 'active', NULL, NULL, 'static', '2016-08-30 18:00:00', '2016-08-30 18:00:00'),
(4, 2, 'w5.png', NULL, '/hu/letoltes/w5.png', 'active', NULL, NULL, 'static', '2016-08-30 18:00:00', '2016-08-30 18:00:00'),
(5, 1, 'link.logo', NULL, '/hu/logo.link', 'active', NULL, NULL, 'link', '2016-08-31 10:00:00', '2016-08-31 10:00:00'),
(6, 1, 'REST-html', NULL, '/hu/test', 'active', NULL, NULL, 'rest', '2016-09-05 10:00:00', '2016-09-05 10:00:00'),
(7, 3, 'Home', NULL, '/en/index.html', 'active', NULL, NULL, 'page', '2016-08-29 21:53:00', NULL),
(8, 3, 'Error', NULL, '/en/error.html', 'active', NULL, NULL, 'page', '2016-08-29 21:53:00', NULL);

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

--
-- Table structure for table `cms__file_link`
--

CREATE TABLE `cms__file_link` (
  `fileID` int(11) UNSIGNED NOT NULL COMMENT 'Azonosító',
  `linkFileID` int(11) UNSIGNED DEFAULT NULL COMMENT 'File link',
  `linkFolderID` int(11) UNSIGNED DEFAULT NULL COMMENT 'Folder link',
  `linkUrl` varchar(255) DEFAULT NULL COMMENT 'Külső hivatkozás',
  `target` enum('_self','_blank') NOT NULL DEFAULT '_self' COMMENT 'Hova nyitódjon meg',
  `linkParams` text COMMENT 'Paraméterek'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__file_link`
--

INSERT INTO `cms__file_link` (`fileID`, `linkFileID`, `linkFolderID`, `linkUrl`, `target`, `linkParams`) VALUES
(5, 4, NULL, NULL, '_self', NULL);

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

--
-- Table structure for table `cms__file_page`
--

CREATE TABLE `cms__file_page` (
  `fileID` int(11) UNSIGNED NOT NULL COMMENT 'Azonosító',
  `layoutID` int(11) UNSIGNED NOT NULL COMMENT 'Layout',
  `title` varchar(64) DEFAULT NULL COMMENT 'Meta cím',
  `keywords` text COMMENT 'Meta kulcsszavak',
  `description` text COMMENT 'Meta leírás',
  `editMode` enum('published','edit','review') NOT NULL DEFAULT 'published' COMMENT 'Szerkesztési állapot',
  `editData` text COMMENT 'Szerkesztett adatok'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__file_page`
--

INSERT INTO `cms__file_page` (`fileID`, `layoutID`, `title`, `keywords`, `description`, `editMode`, `editData`) VALUES
(1, 1, 'Kezdőlap', 'teszt,keyword,keyword', 'Ez egy teszt', 'published', '[{"panelVariantID":3,"columnID":1,"parameters":"{\\"content\\":\\"<h3>Html Panel<\\/h3><p>Bal oldali Html Panel módosítva<\\/p>\\"}","deleted":false, "position":1},{"panelVariantID":4,"columnID":2,"parameters":"{\\"content\\":\\"Ez egy Plain Text panel módosítva\\"}","deleted":false, "position":2}]'),
(2, 1, 'Hiba', NULL, NULL, 'published', NULL),
(7, 1, 'Home', 'test,keyword,keyword', 'This is a test', 'published', NULL),
(8, 1, 'Error', NULL, NULL, 'published', NULL);

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

--
-- Table structure for table `cms__file_page_has_panels`
--

CREATE TABLE `cms__file_page_has_panels` (
  `phpID` int(11) UNSIGNED NOT NULL COMMENT 'Azonosító',
  `fileID` int(11) UNSIGNED NOT NULL COMMENT 'Page',
  `columnID` int(11) UNSIGNED NOT NULL COMMENT 'Column',
  `panelVariantID` int(11) UNSIGNED NOT NULL COMMENT 'Panel variant',
  `position` int(10) NOT NULL COMMENT 'Pozíció'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__file_page_has_panels`
--

INSERT INTO `cms__file_page_has_panels` (`phpID`, `fileID`, `columnID`, `panelVariantID`, `position`) VALUES
(1, 1, 2, 1, 1),
(3, 2, 2, 2, 1),
(5, 1, 1, 3, 1),
(7, 1, 2, 4, 2),
(8, 7, 2, 5, 1),
(9, 8, 2, 6, 1);

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

--
-- Table structure for table `cms__file_rest`
--

CREATE TABLE `cms__file_rest` (
  `fileID` int(11) UNSIGNED NOT NULL COMMENT 'Azonosító',
  `className` varchar(64) NOT NULL COMMENT 'Class név'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__file_rest`
--

INSERT INTO `cms__file_rest` (`fileID`, `className`) VALUES
(6, 'Module\\Test\\File\\Test');

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

--
-- Table structure for table `cms__file_static`
--

CREATE TABLE `cms__file_static` (
  `fileID` int(11) UNSIGNED NOT NULL COMMENT 'Azonosító',
  `mime` varchar(128) NOT NULL COMMENT 'MIME típus',
  `size` int(10) UNSIGNED NOT NULL COMMENT 'Méret',
  `file` longblob NOT NULL COMMENT 'Fájl'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__file_static`
--

INSERT INTO `cms__file_static` (`fileID`, `mime`, `size`, `file`) VALUES
(3, 'text/plain', 25, 0x457a20656779207465737a74207374617469632066c3a16a6c),
(4, 'image/png', 16000, 0x[BLOB]);

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

--
-- Table structure for table `cms__folder`
--

CREATE TABLE `cms__folder` (
  `folderID` int(11) UNSIGNED NOT NULL COMMENT 'Azonosító',
  `parentID` int(11) UNSIGNED DEFAULT NULL COMMENT 'Szülő mappa',
  `name` varchar(64) NOT NULL COMMENT 'Név',
  `url` varchar(128) NOT NULL COMMENT 'Mappa url',
  `defaultFileID` int(11) UNSIGNED DEFAULT NULL COMMENT 'Alapértelmezett fájl'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__folder`
--

INSERT INTO `cms__folder` (`folderID`, `parentID`, `name`, `url`, `defaultFileID`) VALUES
(1, NULL, 'hu', '/hu', 1),
(2, 1, 'letoltes', '/hu/letoltes', NULL),
(3, NULL, 'en', '/en', 7);

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

--
-- Table structure for table `cms__group`
--

CREATE TABLE `cms__group` (
  `groupID` int(11) UNSIGNED NOT NULL COMMENT 'Azonosító',
  `name` varchar(32) NOT NULL COMMENT 'Név',
  `description` text NOT NULL COMMENT 'Leírás',
  `status` enum('active','inactive') NOT NULL DEFAULT 'active' COMMENT 'Státusz'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__group`
--

INSERT INTO `cms__group` (`groupID`, `name`, `description`, `status`) VALUES
(1, 'Adminisztrátor', '', 'active'),
(2, 'Felhasználó', '', 'active'),
(3, 'Vendég', '', 'active');

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

--
-- Table structure for table `cms__language`
--

CREATE TABLE `cms__language` (
  `languageID` int(11) UNSIGNED NOT NULL COMMENT 'Azonosító',
  `name` varchar(32) NOT NULL COMMENT 'Név',
  `dir` varchar(16) NOT NULL COMMENT 'Mappa név',
  `locale` varchar(8) NOT NULL COMMENT 'Locale',
  `status` enum('active','inactive') NOT NULL DEFAULT 'active' COMMENT 'Státusz'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__language`
--

INSERT INTO `cms__language` (`languageID`, `name`, `dir`, `locale`, `status`) VALUES
(1, 'Magyar', 'hu', 'hu_HU', 'active'),
(2, 'English', 'en', 'en_US', 'active');

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

--
-- Table structure for table `cms__layout`
--

CREATE TABLE `cms__layout` (
  `layoutID` int(11) UNSIGNED NOT NULL COMMENT 'Azonosító',
  `name` varchar(32) NOT NULL COMMENT 'Név',
  `fileName` varchar(64) NOT NULL COMMENT 'Fájlnév',
  `icon` varchar(32) NOT NULL COMMENT 'Ikon'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__layout`
--

INSERT INTO `cms__layout` (`layoutID`, `name`, `fileName`, `icon`) VALUES
(1, 'layout.default', 'default', 'icon.png');

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

--
-- Table structure for table `cms__module`
--

CREATE TABLE `cms__module` (
  `moduleID` int(11) UNSIGNED NOT NULL COMMENT 'Azonosító',
  `name` varchar(32) NOT NULL COMMENT 'Név'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__module`
--

INSERT INTO `cms__module` (`moduleID`, `name`) VALUES
(1, 'module.core'),
(3, 'module.domain'),
(4, 'module.site'),
(2, 'module.text'),
(5, 'module.vfs');

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

--
-- Table structure for table `cms__panel`
--

CREATE TABLE `cms__panel` (
  `panelID` int(11) UNSIGNED NOT NULL COMMENT 'Azonosító',
  `moduleID` int(11) UNSIGNED NOT NULL COMMENT 'Modul',
  `name` varchar(64) NOT NULL COMMENT 'Név',
  `exclusive` enum('true','false') NOT NULL DEFAULT 'false' COMMENT 'Kizárólagos panel',
  `status` enum('active','inactive') NOT NULL DEFAULT 'active' COMMENT 'Státusz',
  `parameters` mediumtext COMMENT 'Paraméterek'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__panel`
--

INSERT INTO `cms__panel` (`panelID`, `moduleID`, `name`, `exclusive`, `status`, `parameters`) VALUES
(1, 2, 'panel.text.html', 'false', 'active', '{"content":"HTML panel"}'),
(2, 2, 'panel.text.error', 'true', 'active', '{"content":"Error panel"}'),
(3, 2, 'panel.text.plain', 'false', 'active', '{"content":"Plain panel - Formázatlan szöveg"}');

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

--
-- Table structure for table `cms__panel_variant`
--

CREATE TABLE `cms__panel_variant` (
  `panelVariantID` int(11) UNSIGNED NOT NULL COMMENT 'Azonosító',
  `panelID` int(11) UNSIGNED NOT NULL COMMENT 'Panel',
  `name` varchar(128) DEFAULT NULL COMMENT 'Név',
  `parameters` mediumtext COMMENT 'Paraméterek',
  `type` enum('local','global') NOT NULL DEFAULT 'local' COMMENT 'Típus',
  `status` enum('active','inactive') NOT NULL DEFAULT 'active' COMMENT 'Státusz'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__panel_variant`
--

INSERT INTO `cms__panel_variant` (`panelVariantID`, `panelID`, `name`, `parameters`, `type`, `status`) VALUES
(1, 1, NULL, '{"content":"<h3>Html Panel</h3><p>Főoldal Html Panel</p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec viverra, mi ullamcorper porta placerat, sem nunc consequat nisl, quis efficitur diam sem in nisi. Integer facilisis aliquam sapien eu fermentum. Cras in augue imperdiet, suscipit lectus ut, ultricies ipsum. Fusce placerat arcu sem, sit amet egestas dui rutrum eu. Donec egestas tincidunt felis, id aliquet dolor finibus eget. Mauris vel rutrum mi, quis maximus dui. Etiam pulvinar ullamcorper pharetra. Integer sit amet ante dolor. Curabitur ultricies, odio at sollicitudin rhoncus, neque metus aliquam erat, ac laoreet elit ex vitae lacus. Integer posuere ex et venenatis sollicitudin. Cras eget dui nulla. Donec volutpat euismod iaculis. Morbi massa mauris, rhoncus sit amet consectetur sit amet, mollis nec magna. Ut placerat, nisi eu egestas tincidunt, lorem erat consequat urna, vitae auctor magna tortor ut lorem.</p><p>Vestibulum id quam in odio viverra tempus scelerisque ut elit. Nunc luctus accumsan neque et elementum. Sed suscipit mauris suscipit, iaculis dui sed, suscipit elit. Nam vel metus ac sem convallis semper pellentesque sed ipsum. Maecenas pharetra mi nec erat viverra, vitae molestie arcu hendrerit. Cras molestie urna et lacinia vehicula. Cras sed tempus justo. Nulla ex quam, hendrerit eget tincidunt ut, placerat vel nibh. Fusce quis purus purus. In tempus rhoncus libero, vel placerat diam dapibus nec.</p><p>In eleifend, sem non condimentum egestas, felis purus lobortis risus, in consequat mauris lacus ut justo. Morbi porttitor eros ut ullamcorper sagittis. Praesent auctor enim vel lorem placerat rutrum. Donec vitae turpis arcu. Proin sit amet nibh accumsan, feugiat est ac, tempus odio. In lacinia vehicula lorem, in tincidunt erat rutrum eu. Fusce fermentum convallis leo, ac scelerisque nulla tempus quis. Duis eget bibendum tortor. Etiam porttitor augue commodo elit vehicula, ut laoreet leo tempor. Nullam commodo quam ac rutrum ultricies. Duis commodo lacus et orci tristique, sed pulvinar ipsum dignissim.</p>"}', 'local', 'active'),
(2, 2, NULL, '{"content":"<h3>Hiba történt</h3><p>A keresett oldal nem található</p>"}', 'local', 'active'),
(3, 1, NULL, '{"content":"<h3>Html Panel</h3><p>Bal oldali Html Panel</p>"}', 'local', 'active'),
(4, 3, NULL, NULL, 'local', 'active'),
(5, 1, NULL, '{"content":"<h3>Html Panel</h3><p>Home Html Panel</p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec viverra, mi ullamcorper porta placerat, sem nunc consequat nisl, quis efficitur diam sem in nisi. Integer facilisis aliquam sapien eu fermentum. Cras in augue imperdiet, suscipit lectus ut, ultricies ipsum. Fusce placerat arcu sem, sit amet egestas dui rutrum eu. Donec egestas tincidunt felis, id aliquet dolor finibus eget. Mauris vel rutrum mi, quis maximus dui. Etiam pulvinar ullamcorper pharetra. Integer sit amet ante dolor. Curabitur ultricies, odio at sollicitudin rhoncus, neque metus aliquam erat, ac laoreet elit ex vitae lacus. Integer posuere ex et venenatis sollicitudin. Cras eget dui nulla. Donec volutpat euismod iaculis. Morbi massa mauris, rhoncus sit amet consectetur sit amet, mollis nec magna. Ut placerat, nisi eu egestas tincidunt, lorem erat consequat urna, vitae auctor magna tortor ut lorem.</p><p>Vestibulum id quam in odio viverra tempus scelerisque ut elit. Nunc luctus accumsan neque et elementum. Sed suscipit mauris suscipit, iaculis dui sed, suscipit elit. Nam vel metus ac sem convallis semper pellentesque sed ipsum. Maecenas pharetra mi nec erat viverra, vitae molestie arcu hendrerit. Cras molestie urna et lacinia vehicula. Cras sed tempus justo. Nulla ex quam, hendrerit eget tincidunt ut, placerat vel nibh. Fusce quis purus purus. In tempus rhoncus libero, vel placerat diam dapibus nec.</p><p>In eleifend, sem non condimentum egestas, felis purus lobortis risus, in consequat mauris lacus ut justo. Morbi porttitor eros ut ullamcorper sagittis. Praesent auctor enim vel lorem placerat rutrum. Donec vitae turpis arcu. Proin sit amet nibh accumsan, feugiat est ac, tempus odio. In lacinia vehicula lorem, in tincidunt erat rutrum eu. Fusce fermentum convallis leo, ac scelerisque nulla tempus quis. Duis eget bibendum tortor. Etiam porttitor augue commodo elit vehicula, ut laoreet leo tempor. Nullam commodo quam ac rutrum ultricies. Duis commodo lacus et orci tristique, sed pulvinar ipsum dignissim.</p>"}', 'local', 'active'),
(6, 2, NULL, '{"content":"<h3>Ooops</h3><p>The page you are looking for is not found</p>"}', 'local', 'active');

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

--
-- Table structure for table `cms__resource`
--

CREATE TABLE `cms__resource` (
  `resourceID` varchar(100) NOT NULL,
  `moduleID` int(11) UNSIGNED NOT NULL,
  `name` varchar(64) DEFAULT NULL,
  `description` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__resource`
--

INSERT INTO `cms__resource` (`resourceID`, `moduleID`, `name`, `description`) VALUES
('core.domain.create', 3, NULL, NULL),
('core.domain.delete', 3, NULL, NULL),
('core.domain.list', 3, NULL, NULL),
('core.domain.update', 3, NULL, NULL),
('core.site.create', 4, NULL, NULL),
('core.site.delete', 4, NULL, NULL),
('core.site.list', 4, NULL, NULL),
('core.site.update', 4, NULL, NULL),
('text.error.create', 2, NULL, NULL),
('text.error.edit', 2, NULL, NULL),
('text.error.index', 2, NULL, NULL),
('text.error.move', 2, NULL, NULL),
('text.error.remove', 2, NULL, NULL),
('text.html.create', 2, NULL, NULL),
('text.html.edit', 2, NULL, NULL),
('text.html.index', 2, NULL, NULL),
('text.html.move', 2, NULL, NULL),
('text.html.remove', 2, NULL, NULL);

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

--
-- Table structure for table `cms__role`
--

CREATE TABLE `cms__role` (
  `roleID` varchar(64) NOT NULL COMMENT 'Azonosító',
  `moduleID` int(11) UNSIGNED NOT NULL COMMENT 'Modul',
  `name` varchar(64) NOT NULL COMMENT 'Név',
  `description` varchar(100) NOT NULL COMMENT 'Leírás'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__role`
--

INSERT INTO `cms__role` (`roleID`, `moduleID`, `name`, `description`) VALUES
('domain.admin', 3, 'role.common.admin.name', 'role.common.admin.description'),
('site.admin', 4, 'role.common.admin.name', 'role.common.admin.description'),
('text.admin', 2, 'role.common.admin.name', 'role.common.admin.description'),
('text.editor', 2, 'role.common.admin.name', 'role.common.admin.description'),
('text.guest', 2, 'role.common.admin.name', 'role.common.admin.description'),
('vfs.admin', 5, 'role.common.admin.name', 'role.common.admin.description'),
('vfs.editor', 5, 'role.common.admin.name', 'role.common.admin.description');

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

--
-- Table structure for table `cms__site`
--

CREATE TABLE `cms__site` (
  `siteID` int(11) UNSIGNED NOT NULL COMMENT 'Azonosító',
  `name` varchar(32) NOT NULL COMMENT 'Név',
  `languageID` int(11) UNSIGNED NOT NULL COMMENT 'Nyelv',
  `rootFolderID` int(11) UNSIGNED NOT NULL COMMENT 'Alapértelmezett mappa',
  `errorFileID` int(11) UNSIGNED NOT NULL COMMENT 'Hiba fájl'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__site`
--

INSERT INTO `cms__site` (`siteID`, `name`, `languageID`, `rootFolderID`, `errorFileID`) VALUES
(1, 'Magyar', 1, 1, 2),
(2, 'English', 2, 3, 8);

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

--
-- Table structure for table `cms__site_has_domains`
--

CREATE TABLE `cms__site_has_domains` (
  `siteID` int(11) UNSIGNED NOT NULL COMMENT 'Site',
  `domainID` int(11) UNSIGNED NOT NULL COMMENT 'Domain'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms__site_has_domains`
--

INSERT INTO `cms__site_has_domains` (`siteID`, `domainID`) VALUES
(1, 1),
(2, 1);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `cms__column`
--
ALTER TABLE `cms__column`
  ADD PRIMARY KEY (`columnID`),
  ADD KEY `layoutID` (`layoutID`),
  ADD KEY `name` (`name`);

--
-- Indexes for table `cms__column_has_panels`
--
ALTER TABLE `cms__column_has_panels`
  ADD PRIMARY KEY (`columnID`,`panelID`),
  ADD KEY `panelID` (`panelID`);

--
-- Indexes for table `cms__domain`
--
ALTER TABLE `cms__domain`
  ADD PRIMARY KEY (`domainID`),
  ADD KEY `name` (`name`),
  ADD KEY `defaultSiteID` (`defaultSiteID`);

--
-- Indexes for table `cms__file`
--
ALTER TABLE `cms__file`
  ADD PRIMARY KEY (`fileID`),
  ADD KEY `folderID` (`folderID`),
  ADD KEY `name` (`name`),
  ADD KEY `url` (`url`);

--
-- Indexes for table `cms__file_link`
--
ALTER TABLE `cms__file_link`
  ADD PRIMARY KEY (`fileID`),
  ADD KEY `linkFileID` (`linkFileID`),
  ADD KEY `linkFolderID` (`linkFolderID`);

--
-- Indexes for table `cms__file_page`
--
ALTER TABLE `cms__file_page`
  ADD PRIMARY KEY (`fileID`),
  ADD KEY `layoutID` (`layoutID`);

--
-- Indexes for table `cms__file_page_has_panels`
--
ALTER TABLE `cms__file_page_has_panels`
  ADD PRIMARY KEY (`phpID`),
  ADD KEY `fileID` (`fileID`),
  ADD KEY `columnID` (`columnID`),
  ADD KEY `panelVariantID` (`panelVariantID`);

--
-- Indexes for table `cms__file_rest`
--
ALTER TABLE `cms__file_rest`
  ADD PRIMARY KEY (`fileID`);

--
-- Indexes for table `cms__file_static`
--
ALTER TABLE `cms__file_static`
  ADD PRIMARY KEY (`fileID`);

--
-- Indexes for table `cms__folder`
--
ALTER TABLE `cms__folder`
  ADD PRIMARY KEY (`folderID`),
  ADD KEY `parentID` (`parentID`),
  ADD KEY `defaultFileID` (`defaultFileID`),
  ADD KEY `name` (`name`),
  ADD KEY `url` (`url`);

--
-- Indexes for table `cms__group`
--
ALTER TABLE `cms__group`
  ADD PRIMARY KEY (`groupID`),
  ADD KEY `name` (`name`);

--
-- Indexes for table `cms__language`
--
ALTER TABLE `cms__language`
  ADD PRIMARY KEY (`languageID`),
  ADD KEY `name` (`name`),
  ADD KEY `path` (`dir`);

--
-- Indexes for table `cms__layout`
--
ALTER TABLE `cms__layout`
  ADD PRIMARY KEY (`layoutID`),
  ADD KEY `name` (`name`);

--
-- Indexes for table `cms__module`
--
ALTER TABLE `cms__module`
  ADD PRIMARY KEY (`moduleID`),
  ADD KEY `name` (`name`);

--
-- Indexes for table `cms__panel`
--
ALTER TABLE `cms__panel`
  ADD PRIMARY KEY (`panelID`),
  ADD KEY `moduleID` (`moduleID`),
  ADD KEY `name` (`name`);

--
-- Indexes for table `cms__panel_variant`
--
ALTER TABLE `cms__panel_variant`
  ADD PRIMARY KEY (`panelVariantID`),
  ADD KEY `panelID` (`panelID`);

--
-- Indexes for table `cms__resource`
--
ALTER TABLE `cms__resource`
  ADD PRIMARY KEY (`resourceID`),
  ADD KEY `moduleID` (`moduleID`),
  ADD KEY `name` (`name`);

--
-- Indexes for table `cms__role`
--
ALTER TABLE `cms__role`
  ADD PRIMARY KEY (`roleID`),
  ADD KEY `moduleID` (`moduleID`),
  ADD KEY `name` (`name`);

--
-- Indexes for table `cms__site`
--
ALTER TABLE `cms__site`
  ADD PRIMARY KEY (`siteID`),
  ADD KEY `folderID` (`rootFolderID`),
  ADD KEY `errorPageID` (`errorFileID`),
  ADD KEY `languageID` (`languageID`);

--
-- Indexes for table `cms__site_has_domains`
--
ALTER TABLE `cms__site_has_domains`
  ADD PRIMARY KEY (`siteID`,`domainID`),
  ADD KEY `domainID` (`domainID`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `cms__column`
--
ALTER TABLE `cms__column`
  MODIFY `columnID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Azonosító', AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `cms__domain`
--
ALTER TABLE `cms__domain`
  MODIFY `domainID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Azonosító', AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `cms__file`
--
ALTER TABLE `cms__file`
  MODIFY `fileID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Azonosító', AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `cms__file_page_has_panels`
--
ALTER TABLE `cms__file_page_has_panels`
  MODIFY `phpID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Azonosító', AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `cms__folder`
--
ALTER TABLE `cms__folder`
  MODIFY `folderID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Azonosító', AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `cms__group`
--
ALTER TABLE `cms__group`
  MODIFY `groupID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Azonosító', AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `cms__language`
--
ALTER TABLE `cms__language`
  MODIFY `languageID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Azonosító', AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `cms__layout`
--
ALTER TABLE `cms__layout`
  MODIFY `layoutID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Azonosító', AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `cms__module`
--
ALTER TABLE `cms__module`
  MODIFY `moduleID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Azonosító', AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `cms__panel`
--
ALTER TABLE `cms__panel`
  MODIFY `panelID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Azonosító', AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `cms__panel_variant`
--
ALTER TABLE `cms__panel_variant`
  MODIFY `panelVariantID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Azonosító', AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `cms__site`
--
ALTER TABLE `cms__site`
  MODIFY `siteID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Azonosító', AUTO_INCREMENT=3;
--
-- Constraints for dumped tables
--

--
-- Constraints for table `cms__column`
--
ALTER TABLE `cms__column`
  ADD CONSTRAINT `cms__column_ibfk_1` FOREIGN KEY (`layoutID`) REFERENCES `cms__layout` (`layoutID`) ON UPDATE CASCADE;

--
-- Constraints for table `cms__column_has_panels`
--
ALTER TABLE `cms__column_has_panels`
  ADD CONSTRAINT `cms__column_has_panels_ibfk_1` FOREIGN KEY (`columnID`) REFERENCES `cms__column` (`columnID`) ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__column_has_panels_ibfk_2` FOREIGN KEY (`panelID`) REFERENCES `cms__panel` (`panelID`) ON UPDATE CASCADE;

--
-- Constraints for table `cms__domain`
--
ALTER TABLE `cms__domain`
  ADD CONSTRAINT `cms__domain_ibfk_1` FOREIGN KEY (`defaultSiteID`) REFERENCES `cms__site` (`siteID`) ON UPDATE CASCADE;

--
-- Constraints for table `cms__file`
--
ALTER TABLE `cms__file`
  ADD CONSTRAINT `cms__file_ibfk_1` FOREIGN KEY (`folderID`) REFERENCES `cms__folder` (`folderID`) ON UPDATE CASCADE;

--
-- Constraints for table `cms__file_link`
--
ALTER TABLE `cms__file_link`
  ADD CONSTRAINT `cms__file_link_ibfk_1` FOREIGN KEY (`fileID`) REFERENCES `cms__file` (`fileID`) ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__file_link_ibfk_2` FOREIGN KEY (`linkFileID`) REFERENCES `cms__file` (`fileID`) ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__file_link_ibfk_3` FOREIGN KEY (`linkFolderID`) REFERENCES `cms__folder` (`folderID`) ON UPDATE CASCADE;

--
-- Constraints for table `cms__file_page`
--
ALTER TABLE `cms__file_page`
  ADD CONSTRAINT `cms__file_page_ibfk_1` FOREIGN KEY (`fileID`) REFERENCES `cms__file` (`fileID`) ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__file_page_ibfk_2` FOREIGN KEY (`layoutID`) REFERENCES `cms__layout` (`layoutID`) ON UPDATE CASCADE;

--
-- Constraints for table `cms__file_page_has_panels`
--
ALTER TABLE `cms__file_page_has_panels`
  ADD CONSTRAINT `cms__file_page_has_panels_ibfk_1` FOREIGN KEY (`fileID`) REFERENCES `cms__file_page` (`fileID`) ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__file_page_has_panels_ibfk_2` FOREIGN KEY (`columnID`) REFERENCES `cms__column` (`columnID`) ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__file_page_has_panels_ibfk_3` FOREIGN KEY (`panelVariantID`) REFERENCES `cms__panel_variant` (`panelVariantID`) ON UPDATE CASCADE;

--
-- Constraints for table `cms__file_rest`
--
ALTER TABLE `cms__file_rest`
  ADD CONSTRAINT `cms__file_rest_ibfk_1` FOREIGN KEY (`fileID`) REFERENCES `cms__file` (`fileID`) ON UPDATE CASCADE;

--
-- Constraints for table `cms__file_static`
--
ALTER TABLE `cms__file_static`
  ADD CONSTRAINT `cms__file_static_ibfk_1` FOREIGN KEY (`fileID`) REFERENCES `cms__file` (`fileID`) ON UPDATE CASCADE;

--
-- Constraints for table `cms__folder`
--
ALTER TABLE `cms__folder`
  ADD CONSTRAINT `cms__folder_ibfk_1` FOREIGN KEY (`defaultFileID`) REFERENCES `cms__file` (`fileID`) ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__folder_ibfk_2` FOREIGN KEY (`parentID`) REFERENCES `cms__folder` (`folderID`) ON UPDATE CASCADE;

--
-- Constraints for table `cms__panel`
--
ALTER TABLE `cms__panel`
  ADD CONSTRAINT `cms__panel_ibfk_1` FOREIGN KEY (`moduleID`) REFERENCES `cms__module` (`moduleID`) ON UPDATE CASCADE;

--
-- Constraints for table `cms__panel_variant`
--
ALTER TABLE `cms__panel_variant`
  ADD CONSTRAINT `cms__panel_variant_ibfk_1` FOREIGN KEY (`panelID`) REFERENCES `cms__panel` (`panelID`) ON UPDATE CASCADE;

--
-- Constraints for table `cms__resource`
--
ALTER TABLE `cms__resource`
  ADD CONSTRAINT `cms__resource_ibfk_1` FOREIGN KEY (`moduleID`) REFERENCES `cms__module` (`moduleID`) ON UPDATE CASCADE;

--
-- Constraints for table `cms__role`
--
ALTER TABLE `cms__role`
  ADD CONSTRAINT `cms__role_ibfk_1` FOREIGN KEY (`moduleID`) REFERENCES `cms__module` (`moduleID`) ON UPDATE CASCADE;

--
-- Constraints for table `cms__site`
--
ALTER TABLE `cms__site`
  ADD CONSTRAINT `cms__site_ibfk_1` FOREIGN KEY (`rootFolderID`) REFERENCES `cms__folder` (`folderID`) ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__site_ibfk_2` FOREIGN KEY (`errorFileID`) REFERENCES `cms__file` (`fileID`) ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__site_ibfk_3` FOREIGN KEY (`languageID`) REFERENCES `cms__language` (`languageID`) ON UPDATE CASCADE;

--
-- Constraints for table `cms__site_has_domains`
--
ALTER TABLE `cms__site_has_domains`
  ADD CONSTRAINT `cms__site_has_domains_ibfk_1` FOREIGN KEY (`siteID`) REFERENCES `cms__site` (`siteID`) ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__site_has_domains_ibfk_2` FOREIGN KEY (`domainID`) REFERENCES `cms__domain` (`domainID`) ON UPDATE CASCADE;
