CREATE TABLE `ie_SchoolResourceCategory` (
  `id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `sorter` int(11) NOT NULL,
  `added` datetime NOT NULL,
  `changed` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

ALTER TABLE `ie_SchoolResourceCategory`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `ie_SchoolResourceCategory`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

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

CREATE TABLE `ie_SchoolResource` (
  `id` int(11) NOT NULL,
  `categoryId` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `file` varchar(255) NOT NULL,
  `enabled` enum('y','n') NOT NULL DEFAULT 'y',
  `sorter` int(11) NOT NULL,
  `added` datetime NOT NULL,
  `changed` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

ALTER TABLE `ie_SchoolResource`
  ADD PRIMARY KEY (`id`),
  ADD KEY `categoryId` (`categoryId`);

ALTER TABLE `ie_SchoolResource`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

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

INSERT INTO `ie_zz_DPageItemType` (`id`, `type`, `title`, `sorter`) VALUES (NULL, 'SchoolResource_', 'School Resources', '800');

-- створити сторінку в цмс