summaryrefslogtreecommitdiffstats
path: root/setup
diff options
context:
space:
mode:
authorSebastian Wagner2011-08-02 14:40:15 +0200
committerSebastian Wagner2011-08-02 14:40:15 +0200
commit899bb687b6fba5fde390b024c731b90ae301e18a (patch)
treee4e4e94dafd83ad80a99ed5e580dea2a4dce5635 /setup
parentsome debugging (diff)
downloadpoolctrl-899bb687b6fba5fde390b024c731b90ae301e18a.tar.gz
poolctrl-899bb687b6fba5fde390b024c731b90ae301e18a.tar.xz
poolctrl-899bb687b6fba5fde390b024c731b90ae301e18a.zip
actions added to database
Diffstat (limited to 'setup')
-rw-r--r--setup/poolctrl.sql11
-rw-r--r--setup/poolctrl_data.sql9
2 files changed, 18 insertions, 2 deletions
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');
+