zallery/db_structure.sql
2018-08-08 21:07:19 +02:00

161 lines
3.8 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,
`date` datetime DEFAULT NULL,
`message` text
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `Folder`
--
CREATE TABLE `Folder` (
`id` int(10) UNSIGNED NOT NULL,
`user` int(10) UNSIGNED DEFAULT NULL,
`path` text,
`parent` int(10) UNSIGNED DEFAULT NULL,
`date` datetime NOT NULL,
`isPrivate` bit(1) DEFAULT b'0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- 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,
`user` int(10) UNSIGNED NOT NULL,
`title` varchar(55) DEFAULT NULL,
`description` text,
`date` datetime DEFAULT NULL,
`rating` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- 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,
`loginDate` datetime DEFAULT NULL,
`cookieHash` varchar(42) DEFAULT NULL,
`superUser` tinyint(1) NOT NULL,
`enabled` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `User`
--
INSERT INTO `User` (`id`, `name`, `email`, `emailVerified`, `passwordHash`, `passwordSalt`, `ipHost`, `loginDate`, `cookieHash`, `superUser`, `enabled`) VALUES
(1, 'Admin Admin', 'admin', 1, '6e88be8bad7eae9d9e10aa061224034fed48d03fcbad968b56006784539d5214', 'salt', '', '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,
`user` int(10) UNSIGNED NOT NULL,
`title` varchar(55) DEFAULT NULL,
`description` text,
`date` datetime DEFAULT NULL,
`rating` float 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 `Comments`
--
ALTER TABLE `Comments`
ADD PRIMARY KEY (`id`),
ADD KEY `image` (`image`,`video`);
--
-- Indexes for table `Folder`
--
ALTER TABLE `Folder`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `Image`
--
ALTER TABLE `Image`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD KEY `folder` (`folder`);
--
-- Indexes for table `User`
--
ALTER TABLE `User`
ADD PRIMARY KEY (`id`),
ADD KEY `email` (`email`),
ADD KEY `cookieHash` (`cookieHash`);
--
-- Indexes for table `Video`
--
ALTER TABLE `Video`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD KEY `folder` (`folder`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `Comments`
--
ALTER TABLE `Comments`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT for table `Folder`
--
ALTER TABLE `Folder`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=46;
--
-- AUTO_INCREMENT for table `Image`
--
ALTER TABLE `Image`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1713;
--
-- AUTO_INCREMENT for table `User`
--
ALTER TABLE `User`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=44;
--
-- AUTO_INCREMENT for table `Video`
--
ALTER TABLE `Video`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;