summaryrefslogtreecommitdiffstats
path: root/setup/poolctrl.sql
diff options
context:
space:
mode:
Diffstat (limited to 'setup/poolctrl.sql')
-rw-r--r--setup/poolctrl.sql21
1 files changed, 8 insertions, 13 deletions
diff --git a/setup/poolctrl.sql b/setup/poolctrl.sql
index 470716e..3580485 100644
--- a/setup/poolctrl.sql
+++ b/setup/poolctrl.sql
@@ -20,7 +20,7 @@ CREATE TABLE IF NOT EXISTS `poolctrl_event` (
`repeat` bool NOT NULL DEFAULT false,
`immediate` bool NOT NULL DEFAULT false,
`running` bool NOT NULL DEFAULT false,
- `runningtype` int(11) NOT NULL DEFAULT '0',
+ `runningtype` int(11) DEFAULT NULL,
PRIMARY KEY (`eventID`),
KEY `pbs_poolID` (`pbs_poolID`),
KEY `pbs_membershipID` (`pbs_membershipID`),
@@ -31,10 +31,10 @@ CREATE TABLE IF NOT EXISTS `poolctrl_event` (
KEY `runningtype` (`runningtype`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
-CREATE TABLE IF NOT EXISTS `poolctrl_runningtype` (
- `runningtypeID` int(11) NOT NULL AUTO_INCREMENT,
+CREATE TABLE IF NOT EXISTS `poolctrl_eventtype` (
+ `eventtypeID` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(30) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
- PRIMARY KEY (`runningTypID`)
+ PRIMARY KEY (`eventtypeID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
CREATE TABLE IF NOT EXISTS `poolctrl_eventcategory` (
@@ -45,7 +45,8 @@ CREATE TABLE IF NOT EXISTS `poolctrl_eventcategory` (
CREATE TABLE IF NOT EXISTS `poolctrl_eventreport` (
`reportID` int(11) NOT NULL AUTO_INCREMENT,
- `report` varchar(140) COLLATE utf8_unicode_ci DEFAULT 'success',
+ `result` varchar(140) COLLATE utf8_unicode_ci DEFAULT 'success',
+ `errors` varchar(140) COLLATE utf8_unicode_ci,
`type` int(11) NOT NULL,
`eventID` int(11) NOT NULL,
`timestamp` timestamp COLLATE utf8_unicode_ci NOT NULL DEFAULT CURRENT_TIMESTAMP(),
@@ -54,12 +55,6 @@ CREATE TABLE IF NOT EXISTS `poolctrl_eventreport` (
KEY `type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
-CREATE TABLE IF NOT EXISTS `poolctrl_reporttype` (
- `reporttypeID` int(11) NOT NULL AUTO_INCREMENT,
- `title` varchar(30) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
- PRIMARY KEY (`reporttypeID`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
-
-- PBS2 Tabellen
-- TO DO: Tabellen an dieser Stelle nicht per Hand erzeugen sondern von der PBS2-Datenbank kopieren, sodass diese auf dem neusten Stand sind
CREATE TABLE IF NOT EXISTS `pbs_bootos` (
@@ -194,13 +189,13 @@ ALTER TABLE `pbs_membership`
ALTER TABLE `poolctrl_eventreport`
ADD CONSTRAINT `pbs_eventreport_eventidC` FOREIGN KEY (`eventID`) REFERENCES `poolctrl_event` (`eventID`) ON DELETE CASCADE,
- ADD CONSTRAINT `pbs_eventreport_typeidC` FOREIGN KEY (`type`) REFERENCES `poolctrl_reporttype` (`reporttypeID`) ON DELETE CASCADE;
+ ADD CONSTRAINT `pbs_eventreport_typeidC` FOREIGN KEY (`type`) REFERENCES `poolctrl_eventtype` (`eventtypeID`) ON DELETE CASCADE;
ALTER TABLE `poolctrl_event`
ADD CONSTRAINT `poolctrl_event_poolidC` FOREIGN KEY (`pbs_poolID`) REFERENCES `pbs_pool` (`poolID`) ON DELETE CASCADE,
ADD CONSTRAINT `poolctrl_event_bootosidC` FOREIGN KEY (`pbs_bootosID`) REFERENCES `pbs_bootos` (`bootosID`) ON DELETE CASCADE,
ADD CONSTRAINT `poolctrl_event_membershipidC` FOREIGN KEY (`pbs_membershipID`) REFERENCES `pbs_membership` (`membershipID`) ON DELETE CASCADE,
ADD CONSTRAINT `poolctrl_event_categoryC` FOREIGN KEY (`category`) REFERENCES `poolctrl_eventcategory` (`eventcategoryID`) ON DELETE CASCADE,
- ADD CONSTRAINT `poolctrl_event_runningtypeC` FOREIGN KEY (`runningtype`) REFERENCES `poolctrl_runningtype` (`runningtype`) ON DELETE SET NULl,
+ ADD CONSTRAINT `poolctrl_event_runningtypeC` FOREIGN KEY (`runningtype`) REFERENCES `poolctrl_eventtype` (`eventtypeID`) ON DELETE SET NULL,
ADD CONSTRAINT `poolctrl_event_startC` CHECK (start > CURRENT_TIMESTAMP()),
ADD CONSTRAINT `poolctrl_event_endC` CHECK (end > start);