Author: jfthomps
Date: Fri Oct 28 16:41:20 2011
New Revision: 1190433

URL: http://svn.apache.org/viewvc?rev=1190433&view=rev
Log:
VCL-463
add ability to deploy images as servers

-added serverprofileid to serverrequest table
-added keys for admingroupid, logingroupid, serverprofileid for serverrequest 
table
-added constraints for admingroupid and logingroupid for serverrequest table

Modified:
    incubator/vcl/trunk/mysql/update-vcl.sql
    incubator/vcl/trunk/mysql/vcl.sql

Modified: incubator/vcl/trunk/mysql/update-vcl.sql
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/mysql/update-vcl.sql?rev=1190433&r1=1190432&r2=1190433&view=diff
==============================================================================
--- incubator/vcl/trunk/mysql/update-vcl.sql (original)
+++ incubator/vcl/trunk/mysql/update-vcl.sql Fri Oct 28 16:41:20 2011
@@ -408,6 +408,7 @@ CREATE TABLE IF NOT EXISTS `serverprofil
 
 CREATE TABLE IF NOT EXISTS `serverrequest` (
   `id` mediumint(8) unsigned NOT NULL auto_increment,
+  `serverprofileid` smallint(5) unsigned NOT NULL default '0',
   `requestid` mediumint(8) unsigned NOT NULL,
   `fixedIP` varchar(15) default NULL,
   `fixedMAC` varchar(17) default NULL,
@@ -415,7 +416,10 @@ CREATE TABLE IF NOT EXISTS `serverreques
   `logingroupid` smallint(5) unsigned default NULL,
   `monitored` tinyint(1) unsigned NOT NULL default '0',
   PRIMARY KEY  (`id`),
-  UNIQUE KEY `requestid` (`requestid`)
+  UNIQUE KEY `requestid` (`requestid`),
+  KEY `admingroupid` (`admingroupid`),
+  KEY `logingroupid` (`logingroupid`),
+  KEY `serverprofileid` (`serverprofileid`)
 ) ENGINE=InnoDB  DEFAULT CHARSET=latin1;
 
 -- --------------------------------------------------------
@@ -754,6 +758,8 @@ CALL AddConstraintIfNotExists('serverpro
 --
 
 CALL AddConstraintIfNotExists('serverrequest', 'requestid', 'request', 'id');
+CALL AddConstraintIfNotExists('serverrequest', 'admingroupid', 'usergroup', 
'id');
+CALL AddConstraintIfNotExists('serverrequest', 'logingroupid', 'usergroup', 
'id');
 
 -- --------------------------------------------------------
 

Modified: incubator/vcl/trunk/mysql/vcl.sql
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/mysql/vcl.sql?rev=1190433&r1=1190432&r2=1190433&view=diff
==============================================================================
--- incubator/vcl/trunk/mysql/vcl.sql (original)
+++ incubator/vcl/trunk/mysql/vcl.sql Fri Oct 28 16:41:20 2011
@@ -907,6 +907,7 @@ CREATE TABLE IF NOT EXISTS `serverprofil
 
 CREATE TABLE IF NOT EXISTS `serverrequest` (
   `id` mediumint(8) unsigned NOT NULL auto_increment,
+  `serverprofileid` smallint(5) unsigned NOT NULL default '0',
   `requestid` mediumint(8) unsigned NOT NULL,
   `fixedIP` varchar(15) default NULL,
   `fixedMAC` varchar(17) default NULL,
@@ -914,7 +915,10 @@ CREATE TABLE IF NOT EXISTS `serverreques
   `logingroupid` smallint(5) unsigned default NULL,
   `monitored` tinyint(1) unsigned NOT NULL default '0',
   PRIMARY KEY  (`id`),
-  UNIQUE KEY `requestid` (`requestid`)
+  UNIQUE KEY `requestid` (`requestid`),
+  KEY `admingroupid` (`admingroupid`),
+  KEY `logingroupid` (`logingroupid`),
+  KEY `serverprofileid` (`serverprofileid`)
 ) ENGINE=InnoDB  DEFAULT CHARSET=latin1;
 
 -- --------------------------------------------------------
@@ -2030,7 +2034,9 @@ ALTER TABLE `serverprofile`
 -- Constraints for table `serverrequest`
 --
 ALTER TABLE `serverrequest`
-  ADD CONSTRAINT `serverrequest_ibfk_1` FOREIGN KEY (`requestid`) REFERENCES 
`request` (`id`) ON DELETE CASCADE;
+  ADD CONSTRAINT `serverrequest_ibfk_1` FOREIGN KEY (`requestid`) REFERENCES 
`request` (`id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `serverrequest_ibfk_2` FOREIGN KEY (`admingroupid`) 
REFERENCES `usergroup` (`id`) ON UPDATE CASCADE,
+  ADD CONSTRAINT `serverrequest_ibfk_3` FOREIGN KEY (`logingroupid`) 
REFERENCES `usergroup` (`id`) ON UPDATE CASCADE;
 
 -- 
 -- Constraints for table `user`


Reply via email to