summaryrefslogtreecommitdiffstats
path: root/setup/poolctrl.sql
diff options
context:
space:
mode:
authorBjörn Geiger2011-06-29 17:04:33 +0200
committerBjörn Geiger2011-06-29 17:04:33 +0200
commit3c8f2a7c26ca065ef33e85661d3e9e299b9aeb3f (patch)
tree29bdb7082d69cf52ff2003cc9efd6bad95616d41 /setup/poolctrl.sql
parentEventformular created (diff)
downloadpoolctrl-3c8f2a7c26ca065ef33e85661d3e9e299b9aeb3f.tar.gz
poolctrl-3c8f2a7c26ca065ef33e85661d3e9e299b9aeb3f.tar.xz
poolctrl-3c8f2a7c26ca065ef33e85661d3e9e299b9aeb3f.zip
Eventcategory nun in eigener Tabelle
Diffstat (limited to 'setup/poolctrl.sql')
-rw-r--r--setup/poolctrl.sql14
1 files changed, 10 insertions, 4 deletions
diff --git a/setup/poolctrl.sql b/setup/poolctrl.sql
index c861bdf..9be8e3e 100644
--- a/setup/poolctrl.sql
+++ b/setup/poolctrl.sql
@@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS `poolctrl_event` (
`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),
- `category` varchar(30) COLLATE utf8_unicode_ci,
+ `category` int(11) NOT NULL,
`pbs_poolID` int(11) NOT NULL,
`pbs_membershipID` int(11) NOT NULL,
`pbs_bootosID` int(11) NOT NULL,
@@ -25,9 +25,14 @@ CREATE TABLE IF NOT EXISTS `poolctrl_eventreport` (
`report` varchar(140) COLLATE utf8_unicode_ci DEFAULT 'success',
`eventID` int(11) NOT NULL,
`timestamp` timestamp COLLATE utf8_unicode_ci NOT NULL DEFAULT CURRENT_TIMESTAMP(),
- PRIMARY KEY (`reportID`),
- FOREIGN KEY (`eventID`) references poolctrl_event(eventID)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5;
+ PRIMARY KEY (`reportID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
+
+CREATE TABLE IF NOT EXISTS `poolctrl_eventcategory` (
+ `eventcategoryID` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(30) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
+ PRIMARY KEY (`eventcategoryID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
-- PBS2 Tabellen
@@ -174,5 +179,6 @@ ALTER TABLE `poolctrl_event`
ADD CONSTRAINT `poolctrl_event_poolidC` FOREIGN KEY (`pbs_poolID`) REFERENCES `pbs_pool` (`poolID`) ON DELETE CASCADE,
ADD CONSTRAINT `poolctrl_event_membershipC` FOREIGN KEY (`pbs_membershipID`) REFERENCES `pbs_membership` (`membershipID`) ON DELETE CASCADE,
ADD CONSTRAINT `poolctrl_event_boolisoidC` FOREIGN KEY (`pbs_bootosID`) REFERENCES `pbs_bootos` (`bootosID`) ON DELETE CASCADE,
+ ADD CONSTRAINT `poolctrl_event_categoryC` FOREIGN KEY (`category`) REFERENCES `poolctrl_eventcategory` (`eventcategoryID`) ON DELETE CASCADE,
ADD CONSTRAINT `poolctrl_event_startC` CHECK (start > CURRENT_TIMESTAMP()),
ADD CONSTRAINT `poolctrl_event_endC` CHECK (end > start);