1 | -- $Id: TestManagerDatabaseForeignKeyErHacks2.pgsql 106061 2024-09-16 14:03:52Z vboxsync $
|
---|
2 | --- @file
|
---|
3 | -- VBox Test Manager Database Addendum that adds non-unique foreign keys to Users.
|
---|
4 | --
|
---|
5 | -- This is for getting better visualization in reverse engeering ER tools,
|
---|
6 | -- it is not for production databases.
|
---|
7 | --
|
---|
8 |
|
---|
9 | --
|
---|
10 | -- Copyright (C) 2012-2024 Oracle and/or its affiliates.
|
---|
11 | --
|
---|
12 | -- This file is part of VirtualBox base platform packages, as
|
---|
13 | -- available from https://www.virtualbox.org.
|
---|
14 | --
|
---|
15 | -- This program is free software; you can redistribute it and/or
|
---|
16 | -- modify it under the terms of the GNU General Public License
|
---|
17 | -- as published by the Free Software Foundation, in version 3 of the
|
---|
18 | -- License.
|
---|
19 | --
|
---|
20 | -- This program is distributed in the hope that it will be useful, but
|
---|
21 | -- WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
22 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
23 | -- General Public License for more details.
|
---|
24 | --
|
---|
25 | -- You should have received a copy of the GNU General Public License
|
---|
26 | -- along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
27 | --
|
---|
28 | -- The contents of this file may alternatively be used under the terms
|
---|
29 | -- of the Common Development and Distribution License Version 1.0
|
---|
30 | -- (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
31 | -- in the VirtualBox distribution, in which case the provisions of the
|
---|
32 | -- CDDL are applicable instead of those of the GPL.
|
---|
33 | --
|
---|
34 | -- You may elect to license modified versions of this file under the
|
---|
35 | -- terms and conditions of either the GPL or the CDDL or both.
|
---|
36 | --
|
---|
37 | -- SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
38 | --
|
---|
39 |
|
---|
40 | \set ON_ERROR_STOP 1
|
---|
41 | \connect testmanager
|
---|
42 |
|
---|
43 | ALTER TABLE GlobalResources
|
---|
44 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsExpire) REFERENCES Users(uid, tsExpire) MATCH FULL;
|
---|
45 | ALTER TABLE BuildSources
|
---|
46 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsExpire) REFERENCES Users(uid, tsExpire) MATCH FULL;
|
---|
47 | ALTER TABLE RequirementSets
|
---|
48 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsCreated) REFERENCES Users(uid, tsExpire) MATCH FULL;
|
---|
49 | ALTER TABLE TestCases
|
---|
50 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsExpire) REFERENCES Users(uid, tsExpire) MATCH FULL;
|
---|
51 | ALTER TABLE TestCaseArgs
|
---|
52 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsExpire) REFERENCES Users(uid, tsExpire) MATCH FULL;
|
---|
53 | ALTER TABLE TestcaseDeps
|
---|
54 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsExpire) REFERENCES Users(uid, tsExpire) MATCH FULL;
|
---|
55 | ALTER TABLE TestCaseGlobalRsrcDeps
|
---|
56 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsExpire) REFERENCES Users(uid, tsExpire) MATCH FULL;
|
---|
57 | ALTER TABLE TestGroups
|
---|
58 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsExpire) REFERENCES Users(uid, tsExpire) MATCH FULL;
|
---|
59 | ALTER TABLE TestGroupMembers
|
---|
60 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsExpire) REFERENCES Users(uid, tsExpire) MATCH FULL;
|
---|
61 | ALTER TABLE SchedGroups
|
---|
62 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsExpire) REFERENCES Users(uid, tsExpire) MATCH SIMPLE;
|
---|
63 | ALTER TABLE SchedGroupMembers
|
---|
64 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsExpire) REFERENCES Users(uid, tsExpire) MATCH FULL;
|
---|
65 | ALTER TABLE TestBoxes
|
---|
66 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsExpire) REFERENCES Users(uid, tsExpire) MATCH FULL;
|
---|
67 | ALTER TABLE FailureCategories
|
---|
68 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsExpire) REFERENCES Users(uid, tsExpire) MATCH FULL;
|
---|
69 | ALTER TABLE FailureReasons
|
---|
70 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsExpire) REFERENCES Users(uid, tsExpire) MATCH FULL;
|
---|
71 | ALTER TABLE TestResultFailures
|
---|
72 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsExpire) REFERENCES Users(uid, tsExpire) MATCH FULL;
|
---|
73 | ALTER TABLE BuildBlacklist
|
---|
74 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsExpire) REFERENCES Users(uid, tsExpire) MATCH FULL;
|
---|
75 | ALTER TABLE Builds
|
---|
76 | ADD CONSTRAINT non_unique_fk9 FOREIGN KEY (uidAuthor, tsCreated) REFERENCES Users(uid, tsExpire) MATCH FULL;
|
---|
77 |
|
---|