Author: jfthomps
Date: Mon Mar 30 17:41:54 2015
New Revision: 1670155

URL: http://svn.apache.org/r1670155
Log:
VCL-845 - Remove blockRequest.admingroupid column

vcl.sql:
-modified definition for blockRequest, removed admingroupid column
-removed ALTER TABLE ... ADD CONSTRAINT for blockRequest.admingroupid

update-vcl.sql:
-removed removed ALTER TABLE statement that changed blockRequest.admingroupd
-added DropColumnIfExists for blockRequest.admingroupid
-removed AddConstraintIfNotExists for blockRequest.admingroupid

groups.php: modified checkForGroupUsage: modified check of blockRequest table 
to not look at admingroupid

utils.php: modified getBlockTimeData - removed admingroupid from returned data

xmlrpcWrappers.php: modified XMLRPCblockAllocation: removed inserting 
admingroupid as part of insert query into blockRequest table

Modified:
    vcl/trunk/mysql/update-vcl.sql
    vcl/trunk/mysql/vcl.sql
    vcl/trunk/web/.ht-inc/groups.php
    vcl/trunk/web/.ht-inc/utils.php
    vcl/trunk/web/.ht-inc/xmlrpcWrappers.php

Modified: vcl/trunk/mysql/update-vcl.sql
URL: 
http://svn.apache.org/viewvc/vcl/trunk/mysql/update-vcl.sql?rev=1670155&r1=1670154&r2=1670155&view=diff
==============================================================================
--- vcl/trunk/mysql/update-vcl.sql (original)
+++ vcl/trunk/mysql/update-vcl.sql Mon Mar 30 17:41:54 2015
@@ -783,7 +783,7 @@ CALL AddColumnIfNotExists('blockComputer
 CALL AddColumnIfNotExists('blockRequest', 'status', 
"enum('requested','accepted','completed','rejected','deleted') NOT NULL DEFAULT 
'accepted'");
 CALL AddColumnIfNotExists('blockRequest', 'comments', "text");
 
-ALTER TABLE `blockRequest` CHANGE `admingroupid` `admingroupid` smallint(5) 
unsigned NOT NULL;
+CALL DropColumnIfExists('blockRequest', 'admingroupid');
 -- --------------------------------------------------------
 
 --
@@ -1896,7 +1896,6 @@ CALL DropExistingConstraints('blockReque
 CALL AddConstraintIfNotExists('blockRequest', 'imageid', 'image', 'id', 
'update', 'CASCADE');
 CALL AddConstraintIfNotExists('blockRequest', 'groupid', 'usergroup', 'id', 
'update', 'CASCADE');
 CALL AddConstraintIfNotExists('blockRequest', 'ownerid', 'user', 'id', 
'update', 'CASCADE');
-CALL AddConstraintIfNotExists('blockRequest', 'admingroupid', 'usergroup', 
'id', 'update', 'CASCADE');
 CALL AddConstraintIfNotExists('blockRequest', 'managementnodeid', 
'managementnode', 'id', 'update', 'CASCADE');
 
 -- --------------------------------------------------------

Modified: vcl/trunk/mysql/vcl.sql
URL: 
http://svn.apache.org/viewvc/vcl/trunk/mysql/vcl.sql?rev=1670155&r1=1670154&r2=1670155&view=diff
==============================================================================
--- vcl/trunk/mysql/vcl.sql (original)
+++ vcl/trunk/mysql/vcl.sql Mon Mar 30 17:41:54 2015
@@ -87,8 +87,7 @@ CREATE TABLE IF NOT EXISTS `blockRequest
   `groupid` smallint(5) unsigned NOT NULL,
   `repeating` enum('weekly','monthly','list') NOT NULL default 'weekly',
   `ownerid` mediumint(8) unsigned NOT NULL,
-  `admingroupid` smallint(5) unsigned NOT NULL,
-  `managementnodeid` smallint(5) unsigned NOT NULL,
+  `managementnodeid` smallint(5) unsigned default NULL,
   `expireTime` datetime NOT NULL,
   `processing` tinyint(1) unsigned NOT NULL,
   `status` enum('requested','accepted','completed','rejected','deleted') NOT 
NULL DEFAULT 'accepted',
@@ -2180,7 +2179,6 @@ ALTER TABLE `blockComputers` ADD CONSTRA
 ALTER TABLE `blockRequest` ADD CONSTRAINT FOREIGN KEY (`imageid`) REFERENCES 
`image` (`id`);
 ALTER TABLE `blockRequest` ADD CONSTRAINT FOREIGN KEY (`groupid`) REFERENCES 
`usergroup` (`id`);
 ALTER TABLE `blockRequest` ADD CONSTRAINT FOREIGN KEY (`ownerid`) REFERENCES 
`user` (`id`);
-ALTER TABLE `blockRequest` ADD CONSTRAINT FOREIGN KEY (`admingroupid`) 
REFERENCES `usergroup` (`id`);
 ALTER TABLE `blockRequest` ADD CONSTRAINT FOREIGN KEY (`managementnodeid`) 
REFERENCES `managementnode` (`id`);
 
 -- 

Modified: vcl/trunk/web/.ht-inc/groups.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/groups.php?rev=1670155&r1=1670154&r2=1670155&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/groups.php (original)
+++ vcl/trunk/web/.ht-inc/groups.php Mon Mar 30 17:41:54 2015
@@ -1274,8 +1274,7 @@ function checkForGroupUsage($groupid, $t
                # blockRequest.groupid
                $query = "SELECT name "
                       . "FROM blockRequest "
-                      . "WHERE (groupid = $groupid "
-                      .    "OR admingroupid = $groupid) "
+                      . "WHERE groupid = $groupid "
                       .   "AND status IN ('requested', 'accepted')";
                $qh = doQuery($query, 311);
                $usedby = array();

Modified: vcl/trunk/web/.ht-inc/utils.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/utils.php?rev=1670155&r1=1670154&r2=1670155&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/utils.php (original)
+++ vcl/trunk/web/.ht-inc/utils.php Mon Mar 30 17:41:54 2015
@@ -8768,7 +8768,6 @@ function getNATports($resid) {
 /// \b groupid - user group associated with allocation\n
 /// \b repeating - weekly, monthly, or list\n
 /// \b ownerid - id from user table of the owner\n
-/// \b admingroupid - admin user group associated with allocation\n
 /// \b managementnodeid - id of management node handling allocation\n
 /// \b expireTime - time at which the allocation will be completely finished\n
 /// \b timeid - id of blockTimes entry\n
@@ -8791,7 +8790,6 @@ function getBlockTimeData($start="", $en
               .        "r.groupid, "
               .        "r.repeating, "
               .        "r.ownerid, "
-              .        "r.admingroupid, "
               .        "r.managementnodeid, "
               .        "r.expireTime, "
               .        "t.id AS timeid, "

Modified: vcl/trunk/web/.ht-inc/xmlrpcWrappers.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/xmlrpcWrappers.php?rev=1670155&r1=1670154&r2=1670155&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/xmlrpcWrappers.php (original)
+++ vcl/trunk/web/.ht-inc/xmlrpcWrappers.php Mon Mar 30 17:41:54 2015
@@ -3270,7 +3270,6 @@ function XMLRPCblockAllocation($imageid,
               .        "groupid, "
               .        "repeating, "
               .        "ownerid, "
-              .        "admingroupid, "
               .        "managementnodeid, "
               .        "expireTime, "
               .        "status) "
@@ -3281,7 +3280,6 @@ function XMLRPCblockAllocation($imageid,
               .        "$usergroupid, "
               .        "'list', "
               .        "$ownerid, "
-              .        "0, "
               .        "$mnid, "
               .        "'$end', "
               .        "'accepted')";


Reply via email to