From e1ab1cb79068c4c46aa547cefc24da9c83cf1dd0 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Tue, 2 Aug 2011 17:06:59 +0200 Subject: some database changes, actions in eventform implemented, testevents are now displayed in the calendar --- setup/poolctrl.sql | 4 ++-- setup/poolctrl_data.sql | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'setup') diff --git a/setup/poolctrl.sql b/setup/poolctrl.sql index a6dfbe0..e395ac6 100644 --- a/setup/poolctrl.sql +++ b/setup/poolctrl.sql @@ -7,7 +7,7 @@ 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, - `action` varchar(30) COLLATE utf8_unicode_ci, + `action` int(11) NOT NULL DEFAULT '1', `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), @@ -227,6 +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_actionC` FOREIGN KEY (`action`) REFERENCES `poolctrl_eventaction` (`eventactionID`) 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 6ffb017..c802a56 100644 --- a/setup/poolctrl_data.sql +++ b/setup/poolctrl_data.sql @@ -120,21 +120,21 @@ INSERT INTO `poolctrl_eventcategory` (`eventcategoryID`, `title`) VALUES (3, 'Private'), (4, 'Public'); +-- Adding eventactions +INSERT INTO `poolctrl_eventaction` (`eventactionID`, `title`) VALUES +(1, 'None'), +(2, 'Boot'), +(3, 'Shutdown'), +(4, 'Maintenance'); + -- Adding events -INSERT INTO `poolctrl_event` (`eventID`, `title`, `start`, `end`, `category`, `pbs_poolID`, `pbs_membershipID`, `pbs_bootosID`, `note`, `pbs_bootmenuID`, `pbs_filterID`) VALUES -(1, 'Systeme I', '2011-06-24 12:10:00', '2011-06-24 14:00:00', '1', 1, 1, 1, 'Systeme I Vorlesung', 1, 1), -(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); +INSERT INTO `poolctrl_event` (`eventID`, `title`, `action`, `start`, `end`, `category`, `pbs_poolID`, `pbs_membershipID`, `pbs_bootosID`, `note`, `pbs_bootmenuID`, `pbs_filterID`) VALUES +(1, 'Systeme I', DEFAULT, '2011-06-24 12:10:00', '2011-06-24 14:00:00', '1', 1, 1, 1, 'Systeme I Vorlesung', 1, 1), +(2, 'Systeme II', 2, '2011-06-24 14:10:00', '2011-06-24 16:00:00', '1', 1, 1, 1, 'Systeme II Vorlesung', 1, 1), +(3, 'Systeme III', 3, '2011-06-24 16:10:00', '2011-06-24 18:00:00', '1', 1, 1, 1, 'Systeme III Vorlesung', 1, 1); -- 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