zallery/db_structure.sql

165 lines
4.1 KiB
SQL

--
-- Database: `zallery`
--
-- --------------------------------------------------------
--
-- Table structure for table `Comments`
--
CREATE TABLE `Comments` (
`id` int(11) NOT NULL,
`image` int(11) DEFAULT NULL,
`video` int(11) DEFAULT NULL,
`user` int(11) DEFAULT NULL,
`dateCreated` datetime DEFAULT NULL,
`message` text
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Indexes for table `Comments`
--
ALTER TABLE `Comments`
ADD PRIMARY KEY (`id`),
ADD KEY `image` (`image`,`video`);
--
-- AUTO_INCREMENT for table `Comments`
--
ALTER TABLE `Comments`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
-- --------------------------------------------------------
--
-- Table structure for table `Folder`
--
CREATE TABLE `Folder` (
`id` int(10) UNSIGNED NOT NULL,
`owner` int(10) UNSIGNED DEFAULT NULL,
`parent` int(10) UNSIGNED DEFAULT NULL,
`name` text,
`dateCreated` datetime NOT NULL,
`isPrivate` bit(1) DEFAULT b'0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for table `Folder`
--
ALTER TABLE `Folder`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for table `Folder`
--
ALTER TABLE `Folder`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=46;
--
-- Data for table `Folder`
--
INSERT INTO `Folder` (`owner`, `name`, `parent`, `dateCreated`, `isPrivate`) VALUES
(0, '/', NULL, '2011-01-24 21:35:34', b'0');
-- --------------------------------------------------------
--
-- Table structure for table `Image`
--
CREATE TABLE `Image` (
`id` int(10) UNSIGNED NOT NULL,
`folder` int(10) UNSIGNED NOT NULL,
`fileName` varchar(45) NOT NULL,
`fileExtension` varchar(5) NOT NULL,
`owner` int(10) UNSIGNED NOT NULL,
`title` varchar(55) DEFAULT NULL,
`description` text,
`dateUploaded` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for table `Image`
--
ALTER TABLE `Image`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD KEY `folder` (`folder`);
--
-- AUTO_INCREMENT for table `Image`
--
ALTER TABLE `Image`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1713;
-- --------------------------------------------------------
--
-- Table structure for table `User`
--
CREATE TABLE `User` (
`id` int(11) NOT NULL,
`name` varchar(40) NOT NULL,
`email` varchar(50) DEFAULT NULL,
`emailVerified` tinyint(1) NOT NULL,
`passwordHash` varchar(64) DEFAULT NULL,
`passwordSalt` varchar(5) DEFAULT NULL,
`ipHost` varchar(20) DEFAULT NULL,
`dateCreated` datetime DEFAULT NULL,
`dateLastLogin` datetime DEFAULT NULL,
`cookieHash` varchar(42) DEFAULT NULL,
`superUser` tinyint(1) NOT NULL,
`enabled` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for table `User`
--
ALTER TABLE `User`
ADD PRIMARY KEY (`id`),
ADD KEY `email` (`email`),
ADD KEY `cookieHash` (`cookieHash`);
--
-- AUTO_INCREMENT for table `User`
--
ALTER TABLE `User`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=44;
--
-- Data for table `User`
-- User: admin, Password: password
--
INSERT INTO `User` (`name`, `email`, `emailVerified`, `passwordHash`, `passwordSalt`, `ipHost`, `dateCreated`, `dateLastLogin`, `cookieHash`, `superUser`, `enabled`) VALUES
('Admin Admin', 'admin', 1, '6e88be8bad7eae9d9e10aa061224034fed48d03fcbad968b56006784539d5214', 'salt', '', '1970-01-01 01:00:0', '1970-01-01 01:00:0', '', 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `Video`
--
CREATE TABLE `Video` (
`id` int(10) UNSIGNED NOT NULL,
`folder` int(10) UNSIGNED NOT NULL,
`fileName` varchar(45) NOT NULL,
`fileExtension` varchar(5) NOT NULL,
`owner` int(10) UNSIGNED NOT NULL,
`title` varchar(55) DEFAULT NULL,
`description` text,
`dateUploaded` datetime DEFAULT NULL,
`transcoded` tinyint(1) NOT NULL DEFAULT '0',
`length` int(10) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for table `Video`
--
ALTER TABLE `Video`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD KEY `folder` (`folder`);
--
-- AUTO_INCREMENT for table `Video`
--
ALTER TABLE `Video`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
-- --------------------------------------------------------