You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by ar...@apache.org on 2014/06/06 16:48:51 UTC
svn commit: r1600901 - in /vcl/trunk/mysql: update-vcl.sql vcl.sql
Author: arkurth
Date: Fri Jun 6 14:48:51 2014
New Revision: 1600901
URL: http://svn.apache.org/r1600901
Log:
VCL-586
Fixed typo in vcl.sql in definition for imagemeta table introduced in previous commit.
VCL-753
Added connectlog table to vcl.sql and update-vcl.sql.
Added ignored_remote_ip_addresses to variable table.
VCL-763
Added constraints to computer table columns: vmhostid, imagerevisionid, nextimageid.
Modified:
vcl/trunk/mysql/update-vcl.sql
vcl/trunk/mysql/vcl.sql
Modified: vcl/trunk/mysql/update-vcl.sql
URL: http://svn.apache.org/viewvc/vcl/trunk/mysql/update-vcl.sql?rev=1600901&r1=1600900&r2=1600901&view=diff
==============================================================================
--- vcl/trunk/mysql/update-vcl.sql (original)
+++ vcl/trunk/mysql/update-vcl.sql Fri Jun 6 14:48:51 2014
@@ -765,6 +765,27 @@ CREATE TABLE IF NOT EXISTS `connectmetho
-- --------------------------------------------------------
+--
+-- Table structure for table 'connectlog'
+--
+
+CREATE TABLE IF NOT EXISTS connectlog (
+ id int(10) unsigned NOT NULL AUTO_INCREMENT,
+ logid int(10) unsigned NOT NULL,
+ reservationid mediumint(8) unsigned NOT NULL,
+ userid mediumint(8) unsigned DEFAULT NULL,
+ remoteIP varchar(39) NOT NULL,
+ verified tinyint(1) NOT NULL,
+ `timestamp` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ PRIMARY KEY (id),
+ UNIQUE KEY reservationid_2 (reservationid,userid,remoteIP),
+ KEY reservationid (reservationid),
+ KEY userid (userid),
+ KEY logid (logid)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
--
-- Table structure for table `image`
--
@@ -1407,6 +1428,7 @@ INSERT IGNORE INTO `variable` (`name`, `
INSERT IGNORE INTO `variable` (`name`, `serialization`, `value`) VALUES ('general_end_notice_first', 'none', '600');
INSERT IGNORE INTO `variable` (`name`, `serialization`, `value`) VALUES ('general_end_notice_second', 'none', '300');
INSERT IGNORE INTO `variable` (`name`, `serialization`, `value`) VALUES ('ignore_connections_gte', 'none', '1440');
+INSERT IGNORE INTO `variable` (`name`, `serialization`, `value`) VALUES ('ignored_remote_ip_addresses', 'none', '');
--
@@ -1424,6 +1446,9 @@ UPDATE vmprofile SET vmprofile.datastore
--
CALL AddConstraintIfNotExists('computer', 'currentimageid', 'image', 'id', 'update', 'CASCADE');
+CALL AddConstraintIfNotExists('computer', 'vmhostid', 'vmhost', 'id', 'update', 'CASCADE');
+CALL AddConstraintIfNotExists('computer', 'imagerevisionid', 'imagerevision', 'id', 'update', 'CASCADE');
+CALL AddConstraintIfNotExists('computer', 'nextimageid', 'image', 'id', 'update', 'CASCADE');
-- --------------------------------------------------------
@@ -1439,6 +1464,15 @@ CALL AddConstraintIfNotExists('connectme
-- --------------------------------------------------------
--
+-- Constraints for table `connectlog`
+--
+
+CALL AddConstraintIfNotExists('connectlog', 'logid', 'log', 'id', 'both', 'CASCADE');
+CALL AddConstraintIfNotExists('connectlog', 'userid', 'user', 'id', 'both', 'CASCADE');
+
+-- --------------------------------------------------------
+
+--
-- Constraints for table `image`
--
Modified: vcl/trunk/mysql/vcl.sql
URL: http://svn.apache.org/viewvc/vcl/trunk/mysql/vcl.sql?rev=1600901&r1=1600900&r2=1600901&view=diff
==============================================================================
--- vcl/trunk/mysql/vcl.sql (original)
+++ vcl/trunk/mysql/vcl.sql Fri Jun 6 14:48:51 2014
@@ -298,6 +298,27 @@ CREATE TABLE IF NOT EXISTS `computerload
-- --------------------------------------------------------
--
+-- Table structure for table 'connectlog'
+--
+
+CREATE TABLE IF NOT EXISTS connectlog (
+ id int(10) unsigned NOT NULL AUTO_INCREMENT,
+ logid int(10) unsigned NOT NULL,
+ reservationid mediumint(8) unsigned NOT NULL,
+ userid mediumint(8) unsigned DEFAULT NULL,
+ remoteIP varchar(39) NOT NULL,
+ verified tinyint(1) NOT NULL,
+ `timestamp` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ PRIMARY KEY (id),
+ UNIQUE KEY reservationid_1 (reservationid,userid,remoteIP),
+ KEY reservationid (reservationid),
+ KEY userid (userid),
+ KEY logid (logid)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
-- Table structure for table `connectmethod`
--
@@ -425,7 +446,7 @@ CREATE TABLE IF NOT EXISTS `imagemeta` (
`postoption` varchar(32) default NULL,
`architecture` varchar(10) default NULL,
`rootaccess` tinyint(1) unsigned NOT NULL default '1',
- PRIMARY KEY (`id`),
+ PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
@@ -1898,8 +1919,8 @@ INSERT INTO `variable` (`name`, `seriali
('general_end_notice_second', 'none', '300'),
('ignore_connections_gte', 'none', '1440'),
('xcat|timeout_error_limit', 'none', '5'),
-('xcat|rpower_error_limit', 'none', '3');
-
+('xcat|rpower_error_limit', 'none', '3'),
+('ignored_remote_ip_addresses', 'none', '');
--
-- Dumping data for table `vmprofile`
@@ -1967,12 +1988,15 @@ ALTER TABLE `blockWebTime`
-- Constraints for table `computer`
--
ALTER TABLE `computer`
- ADD CONSTRAINT `computer_ibfk_12` FOREIGN KEY (`ownerid`) REFERENCES `user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ ADD CONSTRAINT `computer_ibfk_40` FOREIGN KEY (vmhostid) REFERENCES vmhost (`id`) ON UPDATE CASCADE,
+ ADD CONSTRAINT `computer_ibfk_12` FOREIGN KEY (`ownerid`) REFERENCES `user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
ADD CONSTRAINT `computer_ibfk_30` FOREIGN KEY (`scheduleid`) REFERENCES `schedule` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
ADD CONSTRAINT `computer_ibfk_33` FOREIGN KEY (`stateid`) REFERENCES `state` (`id`) ON UPDATE CASCADE,
ADD CONSTRAINT `computer_ibfk_35` FOREIGN KEY (`platformid`) REFERENCES `platform` (`id`) ON UPDATE CASCADE,
ADD CONSTRAINT `computer_ibfk_36` FOREIGN KEY (`currentimageid`) REFERENCES `image` (`id`) ON UPDATE CASCADE,
- ADD CONSTRAINT `computer_ibfk_37` FOREIGN KEY (`provisioningid`) REFERENCES `provisioning` (`id`) ON UPDATE CASCADE;
+ ADD CONSTRAINT `computer_ibfk_37` FOREIGN KEY (`provisioningid`) REFERENCES `provisioning` (`id`) ON UPDATE CASCADE,
+ ADD CONSTRAINT `computer_ibfk_38` FOREIGN KEY (`imagerevisionid`) REFERENCES imagerevision (`id`) ON UPDATE CASCADE,
+ ADD CONSTRAINT `computer_ibfk_39` FOREIGN KEY (`nextimageid`) REFERENCES image (`id`) ON UPDATE CASCADE;
--
-- Constraints for table `computerloadlog`
@@ -1989,6 +2013,14 @@ ALTER TABLE `connectmethodmap`
ADD CONSTRAINT `connectmethodmap_ibfk_3` FOREIGN KEY (`OSid`) REFERENCES `OS` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `connectmethodmap_ibfk_4` FOREIGN KEY (`imagerevisionid`) REFERENCES `imagerevision` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
+
+--
+-- Constraints for table `connectlog`
+--
+ALTER TABLE `connectlog`
+ ADD CONSTRAINT `connectlog_ibfk_3` FOREIGN KEY (`logid`) REFERENCES `log` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ ADD CONSTRAINT `connectlog_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `user` (`id`) ON UPDATE CASCADE;
+
--
-- Constraints for table `continuations`
--