diff options
author | Simon Rettberg | 2014-10-06 16:10:22 +0200 |
---|---|---|
committer | Simon Rettberg | 2014-10-06 16:10:22 +0200 |
commit | a5ba3dbba96285a08da99c00bd0613d076ad0346 (patch) | |
tree | b05fe851689cfefcec8d77126f60c64f54912a1a /extras | |
parent | Add qnd script to fetch all bwIDM members (IdPs) and insert them into db (diff) | |
download | masterserver-a5ba3dbba96285a08da99c00bd0613d076ad0346.tar.gz masterserver-a5ba3dbba96285a08da99c00bd0613d076ad0346.tar.xz masterserver-a5ba3dbba96285a08da99c00bd0613d076ad0346.zip |
Support new API methods, changed DB scheme, updated .sql script
Diffstat (limited to 'extras')
-rw-r--r-- | extras/database.sql | 246 |
1 files changed, 93 insertions, 153 deletions
diff --git a/extras/database.sql b/extras/database.sql index 3c86665..fe5f957 100644 --- a/extras/database.sql +++ b/extras/database.sql @@ -1,177 +1,117 @@ --- phpMyAdmin SQL Dump --- version 4.2.6 --- http://www.phpmyadmin.net --- --- Host: localhost --- Generation Time: Aug 18, 2014 at 12:22 PM --- Server version: 10.0.12-MariaDB-log --- PHP Version: 5.5.15 - SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; + SET time_zone = "+00:00"; -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; - --- --- Database: `masterserver` --- - --- -------------------------------------------------------- - --- --- Table structure for table `ftpUser` --- - -CREATE TABLE IF NOT EXISTS `ftpUser` ( -`id` int(11) NOT NULL, - `username` varchar(10) NOT NULL, - `password` varchar(16) NOT NULL, - `mode` enum('uploading','downloading') NOT NULL, - `filename` varchar(255) NOT NULL, - `sessionid` varchar(64) NOT NULL, - `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- -------------------------------------------------------- - --- --- Table structure for table `images` --- - -CREATE TABLE IF NOT EXISTS `images` ( - `UUID` varchar(36) COLLATE utf8_unicode_ci NOT NULL, - `image_version` int(11) NOT NULL, - `image_name` varchar(50) COLLATE utf8_unicode_ci NOT NULL, - `image_path` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `image_createTime` datetime NOT NULL, - `image_updateTime` datetime NOT NULL, - `image_owner` varchar(100) COLLATE utf8_unicode_ci NOT NULL, - `content_operatingSystem` varchar(20) COLLATE utf8_unicode_ci NOT NULL, - `status_isValid` tinyint(1) NOT NULL, - `status_isDeleted` tinyint(1) NOT NULL, - `image_shortDescription` varchar(100) COLLATE utf8_unicode_ci NOT NULL, - `image_longDescription` varchar(1000) COLLATE utf8_unicode_ci NOT NULL, - `timestamp` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, - `fileSize` bigint(20) NOT NULL, - `token` varchar(100) COLLATE utf8_unicode_ci NOT NULL, - `missingBlocks` text COLLATE utf8_unicode_ci NOT NULL, - `serverSessionId` varchar(255) COLLATE utf8_unicode_ci NOT NULL + +CREATE TABLE `image` ( + + `uuid` varchar(36) COLLATE utf8_unicode_ci NOT NULL, + + `revision` int(10) unsigned NOT NULL, + + `title` varchar(200) COLLATE utf8_unicode_ci NOT NULL, + + `path` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + + `createtime` int(10) unsigned NOT NULL, + + `updatetime` int(10) unsigned NOT NULL, + + `ownerid` int(10) unsigned NOT NULL, + + `operatingsystem` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + + `isvalid` tinyint(1) unsigned NOT NULL, + + `isdeleted` tinyint(1) unsigned NOT NULL, + + `description` text COLLATE utf8_unicode_ci NOT NULL, + + `filesize` bigint(20) unsigned NOT NULL, + + `missingblocks` text COLLATE utf8_unicode_ci NOT NULL, + + PRIMARY KEY (`uuid`,`revision`), + + KEY `ownerid` (`ownerid`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; --- --- Dumping data for table `images` --- -INSERT INTO `images` (`UUID`, `image_version`, `image_name`, `image_path`, `image_createTime`, `image_updateTime`, `image_owner`, `content_operatingSystem`, `status_isValid`, `status_isDeleted`, `image_shortDescription`, `image_longDescription`, `timestamp`, `fileSize`, `token`, `missingBlocks`, `serverSessionId`) VALUES -('460030a0-f7ac-11e3-a3ac-0800200c9a66', 2, 'irgendwas', '/home/nils/ftp/images/460030a0-f7ac-11e3-a3ac-0800200c9a66.vmdk', '2014-07-23 16:19:33', '2014-07-23 16:19:33', 'dm123@uni-freiburg.de', 'anyThing', 1, 0, 'best', 'theVeryBest', '2014-07-23 14:19:28', 556400640, 'pdJ4Ty0sG7fg3zoZBzkGdu1PA9zbIY1qHTDbDvSjUsadMbNmAkthVXZSJNafUyiDIN8jXkIHSI4YOrwcnycWspttijYMod0sNUXS', '1;2;3;4;5;6;7;8;9;10;11;14;15;17;18;19;20;21;23;25;26;28;29;30;', '2799F33D8EAAF276BD35158DA45FDAF410BB78890AF0EB01C16B88E56C0FEB8A'), -('8fbaf5cb-ebf6-11e3-996b-f5a55bd7273c', 1, 'windows7.vmdk', '/home/nils/ftp/images/8fbaf5cb-ebf6-11e3-996b-f5a55bd7273c.vmdk', '2014-06-04 00:00:00', '2014-06-04 00:00:00', 'ns202@uni-freiburg.de', 'win7', 1, 0, 'Windows 7', 'Das ist ein tolles Windows 7.', '2014-07-02 13:56:41', 123123123, '3s6a3t98b7xe11rw0os93s6a3t98b7xe11rw0os93s6a3t98b7xe11rw0os93s6a3t98b7xe11rw0os93s6a3t98b7xe11rw0os9', '', ''); --- -------------------------------------------------------- +CREATE TABLE `satellite` ( --- --- Table structure for table `satellite` --- + `organizationid` varchar(32) NOT NULL, -CREATE TABLE IF NOT EXISTS `satellite` ( - `organization` varchar(32) NOT NULL, `address` varchar(64) NOT NULL, + `name` varchar(255) NOT NULL, - `prefix` varchar(3) NOT NULL, - `publickey` blob NOT NULL + + `authmethod` varchar(255) NOT NULL, + + `publickey` text, + + PRIMARY KEY (`organizationid`) + +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + + +CREATE TABLE `satellite_suffix` ( + + `organizationid` varchar(32) NOT NULL, + + `suffix` varchar(32) NOT NULL, + + PRIMARY KEY (`suffix`), + + KEY `organizationid` (`organizationid`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- --- Dumping data for table `satellite` --- -INSERT INTO `satellite` (`organization`, `address`, `name`, `prefix`, `publickey`) VALUES -('asdf.de', 'asdf.de', 'asdf', 'asd', 0x30820122300d06092a864886f70d01010105000382010f003082010a0282010100c78e45217da19aa7fbbc25369fed6e86373b43e06846edd752f77bbb72c57170b78a81bb51b842ad7caf2b21a92aaf824b0054e912bb2a1aae05d53435d2c2626f2e583a748fb6e68e6701dc24969f81e8afaa9eb900385c9a202bad0454fffcf17f4eb69db732cd8e5c1dd69d9a079f89012a2cf993c69853d77ddf7e247580b46cd1ff2168736772200916e44a2306aca97ccff18b3808f8d59c0a208dd5d97e4bb3f6109f65e8b064877de69391b64244a3b9a08d362d283ae1f372a14c3085aa96c0ff05c37a9636cccecd5757ff76c09264514c460a4c02c9b25b45bf26598495ed391c662565a54ca4c63738f4f47eb3280106e671be3afc3ba173aa030203010001), -('fh-offenburg.de', '10.10.10.10', 'HS Offenburg', 'og', ''), -('michis-test.de', 'irgendwas.de', 'Michis Test', 'mt', 0x30820222300d06092a864886f70d01010105000382020f003082020a0282020100b9a5657fd6742ffd717bee9f4f8a9eba6d34a790778831bef7dc885f4ab9b07c07fe52569befaa37e0698015d19565385bc3b0d12120a45ab7c3c33bedacdc6ff006d14b4d681c78eb30595dc25278f2d08292157e936600d0cbad588b93cee3ebdd11106ef6203b4b952eb0be5088f12760f28ed3c61cdbde17607fd1eae3e0bae095e5985214acc1ff7e804bb009b76de0dbcede355ba52b3cff99769572c6f322b0b9db1bc07922f5c3507833970d56f6e8ea6c6480249c1149be7471b9759c7e9d1b4cb1d81eac04159f57efb8a94146bc0999cf5d36b59e24e881c9a0c066ebc46001459f76dd7c825e1d061728d298392f07d76ed90fe091fa7571e2b52508eb87c78c9d332ad0064fd27b50b8f3de68c9f794093dccceef98de4b6a5655f3e32e339650ee274547601e1030f068c88fba0040254d87781ac677ca3e6b91b467f70789f2fce8065e64bc21b1a69fb6038008f92a407122121049999a547d1aeb73e8b1ffe127f20d21cebefe4b25fc93ad41e0b87d712a67199620e168ea685f506e6806234611a0785e1ec57f09f701f19d77dc914b3c0ff8c493f17b0f4cff5384b3651266b56ecddc846b6bac719c8eb44ab2cf777c14d0c42b20101577c73572d62b0890b63a0c5c0882d285989352d5b21a8bfc38b4dda3e29eee395b00c6f3cb0f466593cea87268f0d22dcbda270ddca3c611412fc088794e790203010001), -('uni-freiburg.de', 'thisistthesatellite.not', 'Uni Freiburg', 'fr', 0x30820222300d06092a864886f70d01010105000382020f003082020a0282020100b9a5657fd6742ffd717bee9f4f8a9eba6d34a790778831bef7dc885f4ab9b07c07fe52569befaa37e0698015d19565385bc3b0d12120a45ab7c3c33bedacdc6ff006d14b4d681c78eb30595dc25278f2d08292157e936600d0cbad588b93cee3ebdd11106ef6203b4b952eb0be5088f12760f28ed3c61cdbde17607fd1eae3e0bae095e5985214acc1ff7e804bb009b76de0dbcede355ba52b3cff99769572c6f322b0b9db1bc07922f5c3507833970d56f6e8ea6c6480249c1149be7471b9759c7e9d1b4cb1d81eac04159f57efb8a94146bc0999cf5d36b59e24e881c9a0c066ebc46001459f76dd7c825e1d061728d298392f07d76ed90fe091fa7571e2b52508eb87c78c9d332ad0064fd27b50b8f3de68c9f794093dccceef98de4b6a5655f3e32e339650ee274547601e1030f068c88fba0040254d87781ac677ca3e6b91b467f70789f2fce8065e64bc21b1a69fb6038008f92a407122121049999a547d1aeb73e8b1ffe127f20d21cebefe4b25fc93ad41e0b87d712a67199620e168ea685f506e6806234611a0785e1ec57f09f701f19d77dc914b3c0ff8c493f17b0f4cff5384b3651266b56ecddc846b6bac719c8eb44ab2cf777c14d0c42b20101577c73572d62b0890b63a0c5c0882d285989352d5b21a8bfc38b4dda3e29eee395b00c6f3cb0f466593cea87268f0d22dcbda270ddca3c611412fc088794e790203010001), -('uni-nils.de', 'sat.uni-freiburg.de', 'Universität von Nils Schwabe', 'ns', ''); --- -------------------------------------------------------- +CREATE TABLE `user` ( --- --- Table structure for table `user` --- + `userid` int(10) unsigned NOT NULL AUTO_INCREMENT, + + `login` varchar(48) DEFAULT NULL, -CREATE TABLE IF NOT EXISTS `user` ( -`userid` int(10) unsigned NOT NULL, - `username` varchar(12) NOT NULL, `password` varchar(255) CHARACTER SET ascii COLLATE ascii_bin NOT NULL, - `organization` varchar(32) NOT NULL, + + `organizationid` varchar(32) NOT NULL, + `firstname` varchar(32) NOT NULL, + `lastname` varchar(32) NOT NULL, + `email` varchar(48) NOT NULL, - `lastlogin` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; - --- --- Dumping data for table `user` --- - -INSERT INTO `user` (`userid`, `username`, `password`, `organization`, `firstname`, `lastname`, `email`, `lastlogin`) VALUES -(5, 'ns202', '$6$WHysxfXjaQnloqOK$1mxra2ZpfMm6NxHSOl7topYF78FNl7PJdkIaqCn5ibruTTiY7kscT1yQibPa4xlS8NKQUS4cofFof6N4ohEtY1', 'uni-freiburg.de', 'Nils', 'Schwabe', 'nils.schwabe@pluto.uni-freiburg.de', '2014-05-07 12:33:42'), -(6, 'dm123', 'asdf', 'uni-freiburg.de', 'Deine', 'Mutter', 'deine@mutter.de', '2014-05-19 22:00:00'); - --- --- Indexes for dumped tables --- - --- --- Indexes for table `ftpUser` --- -ALTER TABLE `ftpUser` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `images` --- -ALTER TABLE `images` - ADD PRIMARY KEY (`UUID`), ADD UNIQUE KEY `UUID` (`UUID`); - --- --- Indexes for table `satellite` --- -ALTER TABLE `satellite` - ADD PRIMARY KEY (`organization`); - --- --- Indexes for table `user` --- -ALTER TABLE `user` - ADD PRIMARY KEY (`userid`), ADD UNIQUE KEY `username` (`organization`,`username`); - --- --- AUTO_INCREMENT for dumped tables --- - --- --- AUTO_INCREMENT for table `ftpUser` --- -ALTER TABLE `ftpUser` -MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `user` --- -ALTER TABLE `user` -MODIFY `userid` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7; --- --- Constraints for dumped tables --- - --- --- Constraints for table `user` --- + + PRIMARY KEY (`userid`), + + UNIQUE KEY `username` (`organizationid`,`login`) + +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + + + + +ALTER TABLE `image` + + ADD CONSTRAINT `image_ibfk_1` FOREIGN KEY (`ownerid`) REFERENCES `user` (`userid`) ON UPDATE CASCADE; + + + +ALTER TABLE `satellite_suffix` + + ADD CONSTRAINT `satellite_suffix_ibfk_1` FOREIGN KEY (`organizationid`) REFERENCES `satellite` (`organizationid`) ON UPDATE CASCADE; + + + ALTER TABLE `user` -ADD CONSTRAINT `user_ibfk_1` FOREIGN KEY (`organization`) REFERENCES `satellite` (`organization`) ON UPDATE CASCADE; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; + ADD CONSTRAINT `user_ibfk_1` FOREIGN KEY (`organizationid`) REFERENCES `satellite` (`organizationid`) ON UPDATE CASCADE; + + |