[aur-dev] [PATCH 1/2] UPGRADING: Add missing column to the instructions
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- UPGRADING | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/UPGRADING b/UPGRADING index d9860bb..71b3d1d 100644 --- a/UPGRADING +++ b/UPGRADING @@ -50,8 +50,9 @@ CREATE TABLE PackageBases ( 4. Migrate data from Packages to PackageBases: ---- -INSERT INTO PackageBases SELECT ID, Name, CategoryID, NumVotes, OutOfDateTS, - SubmittedTS, ModifiedTS, SubmitterUID, MaintainerUID FROM Packages; +INSERT INTO PackageBases + SELECT ID, Name, CategoryID, NumVotes, OutOfDateTS, SubmittedTS, + ModifiedTS, SubmitterUID, MaintainerUID, NULL FROM Packages; ---- 5. Delete unneeded foreign keys from Packages: -- 1.9.3
We cannot change a column after creating a foreign key: ERROR 1832 (HY000): Cannot change column 'PackageBaseID': used in a foreign key constraint 'Packages_ibfk_1' Delay the "ADD FOREIGN KEY" command to fix this. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- UPGRADING | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UPGRADING b/UPGRADING index 71b3d1d..a45c970 100644 --- a/UPGRADING +++ b/UPGRADING @@ -86,11 +86,11 @@ ALTER TABLE Packages 7. Add package base references to the Packages table: ---- +ALTER TABLE Packages ADD COLUMN PackageBaseID INTEGER UNSIGNED NULL; +UPDATE Packages SET PackageBaseID = ID; ALTER TABLE Packages - ADD COLUMN PackageBaseID INTEGER UNSIGNED NULL, + MODIFY PackageBaseID INTEGER UNSIGNED NOT NULL, ADD FOREIGN KEY (PackageBaseID) REFERENCES PackageBases(ID) ON DELETE CASCADE; -UPDATE Packages SET PackageBaseID = ID; -ALTER TABLE Packages MODIFY PackageBaseID INTEGER UNSIGNED NOT NULL; ---- 8. Delete foreign keys from PackageVotes, PackageComments and CommentNotify: -- 1.9.3
participants (1)
-
Lukas Fleischer