summaryrefslogtreecommitdiffstats
path: root/setup
diff options
context:
space:
mode:
authorBjörn Geiger2011-09-22 17:56:43 +0200
committerBjörn Geiger2011-09-22 17:56:43 +0200
commit54da4fa07b925badf406c8fae8daa48d26224d41 (patch)
treee311d0719496a09762267bcec56629e502b57d47 /setup
parentweitere Korrektur (diff)
downloadpoolctrl-54da4fa07b925badf406c8fae8daa48d26224d41.tar.gz
poolctrl-54da4fa07b925badf406c8fae8daa48d26224d41.tar.xz
poolctrl-54da4fa07b925badf406c8fae8daa48d26224d41.zip
Repeat Optionen werden nun in der DB gespeichert, achtung DB Update
Diffstat (limited to 'setup')
-rwxr-xr-xsetup/poolctrl.sql54
-rwxr-xr-xsetup/poolctrl_data.sql12
2 files changed, 49 insertions, 17 deletions
diff --git a/setup/poolctrl.sql b/setup/poolctrl.sql
index c50d266..5d9a75f 100755
--- a/setup/poolctrl.sql
+++ b/setup/poolctrl.sql
@@ -18,7 +18,10 @@ CREATE TABLE IF NOT EXISTS `poolctrl_event` (
`pbs_bootmenuID` int(11) NOT NULL,
`pbs_filterID` int(11) NOT NULL,
`repeat` bool NOT NULL DEFAULT false,
- `repeatEnd` timestamp COLLATE utf8_unicode_ci NULL,
+ `repeattype` int(11) NULL,
+ `repeatend` int(11) NULL,
+ `repeatdate` timestamp COLLATE utf8_unicode_ci NULL,
+ `repeatings` int(4) NULL,
`immediate` bool NOT NULL DEFAULT false,
`running` bool NOT NULL DEFAULT false,
`runningtype` int(11) DEFAULT NULL,
@@ -31,12 +34,26 @@ CREATE TABLE IF NOT EXISTS `poolctrl_event` (
KEY `pbs_filterID` (`pbs_filterID`),
KEY `category` (`category`),
KEY `runningtype` (`runningtype`)
+ KEY `repeattype` (`repeattype`)
+ KEY `repeatend` (`repeatend`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
-CREATE TABLE IF NOT EXISTS `poolctrl_eventtype` (
+CREATE TABLE IF NOT EXISTS `poolctrl_runningtype` (
`eventtypeID` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(30) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
- PRIMARY KEY (`eventtypeID`)
+ PRIMARY KEY (`runningtypeID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
+
+CREATE TABLE IF NOT EXISTS `poolctrl_repeattype` (
+ `repeattypeID` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(30) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
+ PRIMARY KEY (`repeattypeID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
+
+CREATE TABLE IF NOT EXISTS `poolctrl_repeatend` (
+ `repeatendID` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(30) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
+ PRIMARY KEY (`repeatendID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
CREATE TABLE IF NOT EXISTS `poolctrl_eventcategory` (
@@ -135,10 +152,37 @@ ALTER TABLE `pbs_poolentries`
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_eventtype` (`eventtypeID`) ON DELETE CASCADE;
+ ADD CONSTRAINT `pbs_eventreport_typeidC` FOREIGN KEY (`type`) REFERENCES `poolctrl_runningtype` (`runningtypeID`) ON DELETE CASCADE;
ALTER TABLE `poolctrl_event`
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_eventtype` (`eventtypeID`) ON DELETE SET NULL,
+ ADD CONSTRAINT `poolctrl_event_repeattypeC` FOREIGN KEY (`repeattype`) REFERENCES `poolctrl_repeattype` (`repeattypeID`) ON DELETE SET NULL,
+ ADD CONSTRAINT `poolctrl_event_runningtypeC` FOREIGN KEY (`runningtype`) REFERENCES `poolctrl_runningtype` (`runningtypeID`) ON DELETE SET NULL,
+ ADD CONSTRAINT `poolctrl_event_repeatendC` FOREIGN KEY (`repeatend`) REFERENCES `poolctrl_repeatend` (`repeatendID`) ON DELETE SET NULL,
ADD CONSTRAINT `poolctrl_event_startC` CHECK (start > CURRENT_TIMESTAMP()),
ADD CONSTRAINT `poolctrl_event_endC` CHECK (end > start);
+
+--Adding Data
+-- Adding eventcategories
+INSERT INTO `poolctrl_eventcategory` (`eventcategoryID`, `title`) VALUES
+(1, 'Lecture'),
+(2, 'Maintenance'),
+(3, 'Boot'),
+(4, 'Shutdown');
+
+-- Adding runningtypes
+INSERT INTO `poolctrl_runningtype` (`eventtypeID`, `title`) VALUES
+(1, 'Boot'),
+(2, 'Shutdown');
+
+-- Adding repeattypes
+INSERT INTO `poolctrl_repeattype` (`repeattypeID`, `title`) VALUES
+(1, 'Daily'),
+(2, 'Once a week'),
+(3, 'Every couple of weeks'),
+(4, 'Every month');
+
+-- Adding repeatend
+INSERT INTO `poolctrl_repeatend` (`repeatendID`, `title`) VALUES
+(1, 'After'),
+(2, 'Date');
diff --git a/setup/poolctrl_data.sql b/setup/poolctrl_data.sql
index 5715ec9..079b53d 100755
--- a/setup/poolctrl_data.sql
+++ b/setup/poolctrl_data.sql
@@ -56,18 +56,6 @@ INSERT INTO `pbs_poolentries` (`poolentriesID`, `poolID`, `clientID`) VALUES
(9, 4, 9),
(10, 4, 10);
--- Adding eventcategories
-INSERT INTO `poolctrl_eventcategory` (`eventcategoryID`, `title`) VALUES
-(1, 'Lecture'),
-(2, 'Maintenance'),
-(3, 'Boot'),
-(4, 'Shutdown');
-
--- Adding eventtypes
-INSERT INTO `poolctrl_eventtype` (`eventtypeID`, `title`) VALUES
-(1, 'Boot'),
-(2, 'Shutdown');
-
-- Adding events
INSERT INTO `poolctrl_event` (`eventID`, `title`, `start`, `end`, `category`, `pbs_poolID`, `pbs_membershipID`, `pbs_bootosID`, `note`, `pbs_bootmenuID`, `pbs_filterID`, `created`) 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, 1308583320),