cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- $Id$
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @file
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- VBox Test Manager Database Addendum that adds non-unique foreign keys.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This is for getting better visualization in reverse engeering ER tools,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- it is not for production databases.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Copyright (C) 2012-2014 Oracle Corporation
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This file is part of VirtualBox Open Source Edition (OSE), as
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- available from http://www.virtualbox.org. This file is free software;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- you can redistribute it and/or modify it under the terms of the GNU
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- General Public License (GPL) as published by the Free Software
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Foundation, in version 2 as it comes in the "COPYING" file of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- VirtualBox OSE distribution. VirtualBox OSE is distributed in the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The contents of this file may alternatively be used under the terms
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- of the Common Development and Distribution License Version 1.0
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- (CDDL) only, as it comes in the "COPYING.CDDL" file of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- VirtualBox OSE distribution, in which case the provisions of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- CDDL are applicable instead of those of the GPL.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- You may elect to license modified versions of this file under the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- terms and conditions of either the GPL or the CDDL or both.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync\set ON_ERROR_STOP 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync\connect testmanager
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE TestCaseArgs
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk1 FOREIGN KEY (idTestCase, tsExpire) REFERENCES TestCases(idTestCase, tsExpire) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE TestcaseDeps
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk1 FOREIGN KEY (idTestCase, tsExpire) REFERENCES TestCases(idTestCase, tsExpire) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE TestcaseDeps
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk2 FOREIGN KEY (idTestCasePreReq,tsExpire) REFERENCES TestCases(idTestCase, tsExpire) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE TestCaseGlobalRsrcDeps
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk1 FOREIGN KEY (idTestCase, tsExpire) REFERENCES TestCases(idTestCase, tsExpire) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE TestCaseGlobalRsrcDeps
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk2 FOREIGN KEY (idGlobalRsrc, tsExpire) REFERENCES GlobalResources(idGlobalRsrc, tsExpire) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE TestGroupMembers
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk1 FOREIGN KEY (idTestGroup, tsExpire) REFERENCES TestGroups(idTestGroup, tsExpire) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE TestGroupMembers
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk2 FOREIGN KEY (idTestCase, tsExpire) REFERENCES TestCases(idTestCase, tsExpire) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE SchedGroups
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk1 FOREIGN KEY (idBuildSrc, tsExpire) REFERENCES BuildSources(idBuildSrc, tsExpire) MATCH SIMPLE;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE SchedGroups
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk2 FOREIGN KEY (idBuildSrcTestSuite, tsExpire) REFERENCES BuildSources(idBuildSrc, tsExpire) MATCH SIMPLE;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE SchedGroupMembers
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk1 FOREIGN KEY (idSchedGroup, tsExpire) REFERENCES SchedGroups(idSchedGroup, tsExpire) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE SchedGroupMembers
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk2 FOREIGN KEY (idTestGroup, tsExpire) REFERENCES TestGroups(idTestGroup, tsExpire) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE SchedGroupMembers
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk3 FOREIGN KEY (idTestGroupPreReq, tsExpire) REFERENCES TestGroups(idTestGroup, tsExpire) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE TestBoxes
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk1 FOREIGN KEY (idSchedGroup, tsExpire) REFERENCES SchedGroups(idSchedGroup, tsExpire) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE FailureReasons
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk1 FOREIGN KEY (idFailureCategory, tsExpire) REFERENCES FailureCategories(idFailureCategory, tsExpire) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE TestResultFailures
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk1 FOREIGN KEY (idFailureReason, tsExpire) REFERENCES FailureReasons(idFailureReason, tsExpire) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE BuildBlacklist
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk1 FOREIGN KEY (idFailureReason, tsExpire) REFERENCES FailureReasons(idFailureReason, tsExpire) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE GlobalResourceStatuses
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk1 FOREIGN KEY (idGlobalRsrc, tsAllocated) REFERENCES GlobalResources(idGlobalRsrc, tsExpire) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE SchedQueues
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT non_unique_fk1 FOREIGN KEY (idSchedGroup, tsLastScheduled) REFERENCES SchedGroups(idSchedGroup, tsExpire) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync