From 899bb687b6fba5fde390b024c731b90ae301e18a Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Tue, 2 Aug 2011 14:40:15 +0200 Subject: actions added to database --- setup/poolctrl.sql | 11 ++++++++++- setup/poolctrl_data.sql | 9 ++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'setup') diff --git a/setup/poolctrl.sql b/setup/poolctrl.sql index 66fbf04..a6dfbe0 100644 --- a/setup/poolctrl.sql +++ b/setup/poolctrl.sql @@ -6,7 +6,8 @@ SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; CREATE TABLE IF NOT EXISTS `poolctrl_event` ( `eventID` int(11) NOT NULL AUTO_INCREMENT, - `title` varchar(30) COLLATE utf8_unicode_ci NOT NULL UNIQUE, + `title` varchar(30) COLLATE utf8_unicode_ci NOT NULL UNIQUE, + `action` varchar(30) COLLATE utf8_unicode_ci, `start` timestamp COLLATE utf8_unicode_ci NOT NULL DEFAULT CURRENT_TIMESTAMP(), `end` timestamp COLLATE utf8_unicode_ci NOT NULL, `participants` int(4) NOT NULL DEFAULT 50 CHECK (participants > 0), @@ -22,6 +23,13 @@ CREATE TABLE IF NOT EXISTS `poolctrl_event` ( PRIMARY KEY (`eventID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1; +CREATE TABLE IF NOT EXISTS `poolctrl_eventaction` ( + `eventactionID` int(11) NOT NULL AUTO_INCREMENT, + `title` varchar(30) COLLATE utf8_unicode_ci NOT NULL UNIQUE, + PRIMARY KEY (`eventactionID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1; + + CREATE TABLE IF NOT EXISTS `poolctrl_eventreport` ( `reportID` int(11) NOT NULL AUTO_INCREMENT, `report` varchar(140) COLLATE utf8_unicode_ci DEFAULT 'success', @@ -219,5 +227,6 @@ ALTER TABLE `poolctrl_event` -- ADD CONSTRAINT `poolctrl_event_bootmenuidC` FOREIGN KEY (`pbs_bootmenuID`) REFERENCES `pbs_bootmenu` (`bootmenuID`) ON DELETE CASCADE, -- ADD CONSTRAINT `poolctrl_event_filteridC` FOREIGN KEY (`pbs_filterID`) REFERENCES `pbs_filter` (`filterID`) ON DELETE CASCADE, ADD CONSTRAINT `poolctrl_event_categoryC` FOREIGN KEY (`category`) REFERENCES `poolctrl_eventcategory` (`eventcategoryID`) ON DELETE CASCADE, + ADD CONSTRAINT `poolctrl_event_actionC` FOREIGN KEY (`action`) REFERENCES `poolctrl_eventaction` (`title`) ON DELETE CASCADE, ADD CONSTRAINT `poolctrl_event_startC` CHECK (start > CURRENT_TIMESTAMP()), ADD CONSTRAINT `poolctrl_event_endC` CHECK (end > start); diff --git a/setup/poolctrl_data.sql b/setup/poolctrl_data.sql index 34f2b88..6ffb017 100644 --- a/setup/poolctrl_data.sql +++ b/setup/poolctrl_data.sql @@ -126,8 +126,15 @@ INSERT INTO `poolctrl_event` (`eventID`, `title`, `start`, `end`, `category`, `p (2, 'Systeme II', '2011-06-24 14:10:00', '2011-06-24 16:00:00', '1', 1, 1, 1, 'Systeme II Vorlesung', 1, 1), (3, 'Systeme III', '2011-06-24 16:10:00', '2011-06-24 18:00:00', '1', 1, 1, 1, 'Systeme III Vorlesung', 1, 1); --- Adding eventreport +-- Adding eventreports INSERT INTO `poolctrl_eventreport` (`reportID`, `report`, `eventID`) VALUES (1, DEFAULT, 1), (2, DEFAULT, 2), (3, 'wake-on-lan failed', 3); + +-- Adding eventactions +INSERT INTO `poolctrl_eventaction` (`eventactionID`, `title`) VALUES +(1, 'Boot'), +(2, 'Shutdown'), +(3, 'Maintenance'); + -- cgit v1.2.3-55-g7522