From b6dd38d69fab9c81cca14e64934900fc1cf4c709 Mon Sep 17 00:00:00 2001 From: stubbfel Date: Tue, 25 Jun 2013 13:39:32 +0200 Subject: [PATCH] update sql --- sql/create/createDB-20130625.sql | 321 +++++++++++++++++++++++++ sql/insert/example/insert-20130625.sql | 97 ++++++++ 2 files changed, 418 insertions(+) create mode 100644 sql/create/createDB-20130625.sql create mode 100644 sql/insert/example/insert-20130625.sql diff --git a/sql/create/createDB-20130625.sql b/sql/create/createDB-20130625.sql new file mode 100644 index 0000000..5b0bd95 --- /dev/null +++ b/sql/create/createDB-20130625.sql @@ -0,0 +1,321 @@ +-- phpMyAdmin SQL Dump +-- version 3.5.2.2 +-- http://www.phpmyadmin.net +-- +-- Host: 127.0.0.1 +-- Erstellungszeit: 25. Jun 2013 um 13:36 +-- Server Version: 5.5.27 +-- PHP-Version: 5.4.7 + +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 */; + +-- +-- Datenbank: `geodb` +-- + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `domain` +-- + +DROP TABLE IF EXISTS `domain`; +CREATE TABLE IF NOT EXISTS `domain` ( + `id` int(32) NOT NULL AUTO_INCREMENT, + `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ; + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `information` +-- + +DROP TABLE IF EXISTS `information`; +CREATE TABLE IF NOT EXISTS `information` ( + `id` int(32) NOT NULL AUTO_INCREMENT, + `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; + +-- -------------------------------------------------------- + +-- +-- Stellvertreter-Struktur des Views `pis` +-- +DROP VIEW IF EXISTS `pis`; +CREATE TABLE IF NOT EXISTS `pis` ( +`pid` int(32) +,`iid` int(32) +,`name` varchar(50) +,`value` varchar(500) +); +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `place` +-- + +DROP TABLE IF EXISTS `place`; +CREATE TABLE IF NOT EXISTS `place` ( + `id` int(32) NOT NULL AUTO_INCREMENT, + `plan` geometry NOT NULL, + `parent` int(32) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ; + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `placealias` +-- + +DROP TABLE IF EXISTS `placealias`; +CREATE TABLE IF NOT EXISTS `placealias` ( + `aid` int(32) NOT NULL AUTO_INCREMENT, + `pid` int(32) NOT NULL, + `alias` varchar(250) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`aid`,`pid`), + KEY `pid` (`pid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ; + +-- -------------------------------------------------------- + +-- +-- Stellvertreter-Struktur des Views `placealiasview` +-- +DROP VIEW IF EXISTS `placealiasview`; +CREATE TABLE IF NOT EXISTS `placealiasview` ( +`alias` varchar(250) +,`plan` geometry +,`aid` int(32) +,`pid` int(32) +,`parent` int(32) +); +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `placedomain` +-- + +DROP TABLE IF EXISTS `placedomain`; +CREATE TABLE IF NOT EXISTS `placedomain` ( + `pid` int(32) NOT NULL, + `did` int(32) NOT NULL, + PRIMARY KEY (`pid`,`did`), + KEY `did` (`did`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- Stellvertreter-Struktur des Views `placedomainview` +-- +DROP VIEW IF EXISTS `placedomainview`; +CREATE TABLE IF NOT EXISTS `placedomainview` ( +`pid` int(32) +,`did` int(32) +,`name` varchar(50) +); +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `placeinformation` +-- + +DROP TABLE IF EXISTS `placeinformation`; +CREATE TABLE IF NOT EXISTS `placeinformation` ( + `pid` int(32) NOT NULL, + `iid` int(32) NOT NULL, + `value` varchar(500) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`pid`,`iid`), + KEY `iid` (`iid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- Stellvertreter-Struktur des Views `placeinformationview` +-- +DROP VIEW IF EXISTS `placeinformationview`; +CREATE TABLE IF NOT EXISTS `placeinformationview` ( +`pid` int(32) +,`iid` int(32) +,`name` varchar(50) +,`value` varchar(500) +); +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `placeservice` +-- + +DROP TABLE IF EXISTS `placeservice`; +CREATE TABLE IF NOT EXISTS `placeservice` ( + `pid` int(32) NOT NULL, + `sid` int(32) NOT NULL, + `request` varchar(250) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`pid`,`sid`), + KEY `sid` (`sid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- Stellvertreter-Struktur des Views `placeserviceview` +-- +DROP VIEW IF EXISTS `placeserviceview`; +CREATE TABLE IF NOT EXISTS `placeserviceview` ( +`pid` int(32) +,`sid` int(32) +,`name` varchar(50) +,`sap` varchar(250) +,`request` varchar(250) +); +-- -------------------------------------------------------- + +-- +-- Stellvertreter-Struktur des Views `pss` +-- +DROP VIEW IF EXISTS `pss`; +CREATE TABLE IF NOT EXISTS `pss` ( +`pid` int(32) +,`sid` int(32) +,`name` varchar(50) +,`sap` varchar(250) +,`request` varchar(250) +); +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `service` +-- + +DROP TABLE IF EXISTS `service`; +CREATE TABLE IF NOT EXISTS `service` ( + `id` int(32) NOT NULL AUTO_INCREMENT, + `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `sap` varchar(250) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ; + +-- -------------------------------------------------------- + +-- +-- Stellvertreter-Struktur des Views `sps` +-- +DROP VIEW IF EXISTS `sps`; +CREATE TABLE IF NOT EXISTS `sps` ( +`id` int(32) +,`plan` geometry +,`parent` int(32) +,`did` int(32) +,`dName` varchar(50) +,`aid` int(32) +,`alias` varchar(250) +); +-- -------------------------------------------------------- + +-- +-- Struktur des Views `pis` +-- +DROP TABLE IF EXISTS `pis`; + +CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `pis` AS select `placeinformation`.`pid` AS `pid`,`placeinformation`.`iid` AS `iid`,`information`.`name` AS `name`,`placeinformation`.`value` AS `value` from ((`placeinformation` left join `place` on((`place`.`id` = `placeinformation`.`pid`))) left join `information` on((`information`.`id` = `placeinformation`.`iid`))); + +-- -------------------------------------------------------- + +-- +-- Struktur des Views `placealiasview` +-- +DROP TABLE IF EXISTS `placealiasview`; + +CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `placealiasview` AS select `placealias`.`alias` AS `alias`,`place`.`plan` AS `plan`,`placealias`.`aid` AS `aid`,`placealias`.`pid` AS `pid`,`place`.`parent` AS `parent` from (`place` left join `placealias` on((`place`.`id` = `placealias`.`pid`))); + +-- -------------------------------------------------------- + +-- +-- Struktur des Views `placedomainview` +-- +DROP TABLE IF EXISTS `placedomainview`; + +CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `placedomainview` AS select `placedomain`.`pid` AS `pid`,`placedomain`.`did` AS `did`,`domain`.`name` AS `name` from ((`placedomain` left join `place` on((`place`.`id` = `placedomain`.`pid`))) left join `domain` on((`domain`.`id` = `placedomain`.`did`))); + +-- -------------------------------------------------------- + +-- +-- Struktur des Views `placeinformationview` +-- +DROP TABLE IF EXISTS `placeinformationview`; + +CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `placeinformationview` AS select `placeinformation`.`pid` AS `pid`,`placeinformation`.`iid` AS `iid`,`information`.`name` AS `name`,`placeinformation`.`value` AS `value` from ((`placeinformation` left join `place` on((`place`.`id` = `placeinformation`.`pid`))) left join `information` on((`information`.`id` = `placeinformation`.`iid`))); + +-- -------------------------------------------------------- + +-- +-- Struktur des Views `placeserviceview` +-- +DROP TABLE IF EXISTS `placeserviceview`; + +CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `placeserviceview` AS select `placeservice`.`pid` AS `pid`,`placeservice`.`sid` AS `sid`,`service`.`name` AS `name`,`service`.`sap` AS `sap`,`placeservice`.`request` AS `request` from ((`placeservice` left join `service` on((`service`.`id` = `placeservice`.`sid`))) left join `place` on((`place`.`id` = `placeservice`.`pid`))); + +-- -------------------------------------------------------- + +-- +-- Struktur des Views `pss` +-- +DROP TABLE IF EXISTS `pss`; + +CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `pss` AS select `placeservice`.`pid` AS `pid`,`placeservice`.`sid` AS `sid`,`service`.`name` AS `name`,`service`.`sap` AS `sap`,`placeservice`.`request` AS `request` from ((`placeservice` left join `service` on((`service`.`id` = `placeservice`.`sid`))) left join `place` on((`place`.`id` = `placeservice`.`pid`))); + +-- -------------------------------------------------------- + +-- +-- Struktur des Views `sps` +-- +DROP TABLE IF EXISTS `sps`; + +CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `sps` AS select `place`.`id` AS `id`,`place`.`plan` AS `plan`,`place`.`parent` AS `parent`,`placedomain`.`did` AS `did`,`domain`.`name` AS `dName`,`placealias`.`aid` AS `aid`,`placealias`.`alias` AS `alias` from (((`place` left join `placedomain` on((`place`.`id` = `placedomain`.`pid`))) left join `domain` on((`domain`.`id` = `placedomain`.`did`))) left join `placealias` on((`place`.`id` = `placealias`.`pid`))); + +-- +-- Constraints der exportierten Tabellen +-- + +-- +-- Constraints der Tabelle `placealias` +-- +ALTER TABLE `placealias` + ADD CONSTRAINT `placealias_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; + +-- +-- Constraints der Tabelle `placedomain` +-- +ALTER TABLE `placedomain` + ADD CONSTRAINT `placedomain_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + ADD CONSTRAINT `placedomain_ibfk_2` FOREIGN KEY (`did`) REFERENCES `domain` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; + +-- +-- Constraints der Tabelle `placeinformation` +-- +ALTER TABLE `placeinformation` + ADD CONSTRAINT `placeinformation_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + ADD CONSTRAINT `placeinformation_ibfk_2` FOREIGN KEY (`iid`) REFERENCES `information` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; + +-- +-- Constraints der Tabelle `placeservice` +-- +ALTER TABLE `placeservice` + ADD CONSTRAINT `placeservice_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `place` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + ADD CONSTRAINT `placeservice_ibfk_2` FOREIGN KEY (`sid`) REFERENCES `service` (`id`) ON DELETE CASCADE 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 */; diff --git a/sql/insert/example/insert-20130625.sql b/sql/insert/example/insert-20130625.sql new file mode 100644 index 0000000..8100f77 --- /dev/null +++ b/sql/insert/example/insert-20130625.sql @@ -0,0 +1,97 @@ +-- phpMyAdmin SQL Dump +-- version 3.5.2.2 +-- http://www.phpmyadmin.net +-- +-- Host: 127.0.0.1 +-- Erstellungszeit: 25. Jun 2013 um 13:38 +-- Server Version: 5.5.27 +-- PHP-Version: 5.4.7 + +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 */; + +-- +-- Datenbank: `geodb` +-- + +-- +-- Daten für Tabelle `domain` +-- + +INSERT INTO `domain` (`id`, `name`) VALUES +(1, 'public'), +(2, 'private'); + +-- +-- Daten für Tabelle `information` +-- + +INSERT INTO `information` (`id`, `name`) VALUES +(1, 'address'); + +-- +-- Daten für Tabelle `place` +-- + +INSERT INTO `place` (`id`, `plan`, `parent`) VALUES +(1, 0x00000000010300000001000000050000000000000000000000000000000000000000000000000059400000000000000000000000000000594000000000000059400000000000000000000000000000594000000000000000000000000000000000, NULL), +(2, 0x00000000010100000000000000000049400000000000004940, 1), +(5, 0x00000000010300000001000000050000000000000000000000000000000000000000000000000024400000000000000000000000000000244000000000000024400000000000000000000000000000244000000000000000000000000000000000, 1), +(6, 0x00000000010100000000000000000014400000000000001440, 5); + +-- +-- Daten für Tabelle `placealias` +-- + +INSERT INTO `placealias` (`aid`, `pid`, `alias`) VALUES +(1, 1, 'Campus'), +(2, 2, 'Mitte'), +(3, 5, 'MyHome'), +(4, 6, 'MyRoom'); + +-- +-- Daten für Tabelle `placedomain` +-- + +INSERT INTO `placedomain` (`pid`, `did`) VALUES +(1, 1), +(2, 1), +(5, 1), +(5, 2), +(6, 2); + +-- +-- Daten für Tabelle `placeinformation` +-- + +INSERT INTO `placeinformation` (`pid`, `iid`, `value`) VALUES +(1, 1, 'Unistraße'), +(2, 1, 'mitte straße'), +(5, 1, 'myStreet 3'), +(6, 1, 'room5'); + +-- +-- Daten für Tabelle `placeservice` +-- + +INSERT INTO `placeservice` (`pid`, `sid`, `request`) VALUES +(2, 2, '$center'), +(6, 1, '$temp1'); + +-- +-- Daten für Tabelle `service` +-- + +INSERT INTO `service` (`id`, `name`, `sap`) VALUES +(1, 'testService', 'https://myService//'), +(2, 'pService', 'https://publicService//'); + +/*!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 */;