mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Add missing foreign keys and constraints to the DB.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
e72f02872f
commit
ac632980c3
2 changed files with 37 additions and 5 deletions
26
UPGRADING
26
UPGRADING
|
@ -1,6 +1,32 @@
|
|||
Upgrading
|
||||
=========
|
||||
|
||||
From 1.8.0 to 1.8.1
|
||||
-------------------
|
||||
|
||||
1. Drop foreign keys from the "Sessions" table:
|
||||
|
||||
`ALTER TABLE Sessions DROP FOREIGN KEY Sessions_ibfk_1;` should work in most
|
||||
cases. Otherwise, check the output of `SHOW CREATE TABLE Sessions;` and use the
|
||||
foreign key name shown there.
|
||||
|
||||
2. Run the following MySQL statements:
|
||||
|
||||
----
|
||||
ALTER TABLE Sessions
|
||||
ADD FOREIGN KEY (UsersID) REFERENCES Users(ID) ON DELETE CASCADE;
|
||||
ALTER TABLE PackageDepends
|
||||
ADD FOREIGN KEY (PackageID) REFERENCES Packages(ID) ON DELETE CASCADE,
|
||||
ADD FOREIGN KEY (DepPkgID) REFERENCES Packages(ID) ON DELETE CASCADE;
|
||||
ALTER TABLE PackageSources
|
||||
ADD FOREIGN KEY (PackageID) REFERENCES Packages(ID) ON DELETE CASCADE;
|
||||
ALTER TABLE TU_VoteInfo
|
||||
ADD FOREIGN KEY (SubmitterID) REFERENCES Users(ID) ON DELETE CASCADE;
|
||||
ALTER TABLE TU_Votes
|
||||
ADD FOREIGN KEY (VoteID) REFERENCES TU_VoteInfo(ID) ON DELETE CASCADE,
|
||||
ADD FOREIGN KEY (UserID) REFERENCES Users(ID) ON DELETE CASCADE;
|
||||
----
|
||||
|
||||
From 1.7.0 to 1.8.0
|
||||
-------------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue