Author: jfthomps
Date: Fri Apr 3 18:15:38 2015
New Revision: 1671119
URL: http://svn.apache.org/r1671119
Log:
VCL-763 - Add missing constraints to database tables
vcl.sql and update-vcl.sql: modified foreign key constraint for
nathostcomputermap.nathostid to be ON DELETE SET NULL ON UPDATE CASCADE
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=1671119&r1=1671118&r2=1671119&view=diff
==============================================================================
--- vcl/trunk/mysql/update-vcl.sql (original)
+++ vcl/trunk/mysql/update-vcl.sql Fri Apr 3 18:15:38 2015
@@ -2069,7 +2069,7 @@ CALL AddConstraintIfNotExists('natlog',
-- Constraints for table `nathostcomputermap`
--
-CALL AddConstraintIfNotExists('nathostcomputermap', 'nathostid', 'nathost',
'id', 'UPDATE', 'CASCADE');
+CALL AddConstraintIfNotExists('nathostcomputermap', 'nathostid', 'nathost',
'id', 'both', 'nullCASCADE');
CALL AddConstraintIfNotExists('nathostcomputermap', 'computerid', 'computer',
'id', 'both', 'CASCADE');
-- --------------------------------------------------------
Modified: vcl/trunk/mysql/vcl.sql
URL:
http://svn.apache.org/viewvc/vcl/trunk/mysql/vcl.sql?rev=1671119&r1=1671118&r2=1671119&view=diff
==============================================================================
--- vcl/trunk/mysql/vcl.sql (original)
+++ vcl/trunk/mysql/vcl.sql Fri Apr 3 18:15:38 2015
@@ -2317,7 +2317,7 @@ ALTER TABLE `natlog` ADD CONSTRAINT FORE
--
-- Constraints for table `nathostcomputermap`
--
-ALTER TABLE `nathostcomputermap` ADD CONSTRAINT FOREIGN KEY (`nathostid`)
REFERENCES `nathost` (`id`) ON UPDATE CASCADE;
+ALTER TABLE `nathostcomputermap` ADD CONSTRAINT FOREIGN KEY (`nathostid`)
REFERENCES `nathost` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `nathostcomputermap` ADD CONSTRAINT FOREIGN KEY (`computerid`)
REFERENCES `computer` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--