Added drop and readd of foreign key on user ->userid

This fixes the issue that the upgrade seems to work but the change from permissions.user to permissions.userid is not applied because of the foreign key.
This commit is contained in:
Maurice Meyer 2017-03-07 21:38:47 +01:00 committed by GitHub
parent 5c9f0da3aa
commit 810a0867dd

View file

@ -131,8 +131,11 @@ if(isset($input->action) && $input->action == "requestUpgrade") {
}
if($currentVersion < 4) {
$sql["mysql"] = "
ALTER TABLE permissions DROP FOREIGN KEY permissions_ibfk_2;
RENAME TABLE user TO users;
ALTER TABLE permissions CHANGE user userid INT(11);
ALTER TABLE permissions
ADD CONSTRAINT permissions_ibfk_2 FOREIGN KEY (userid) REFERENCES users (id) ON DELETE CASCADE;
ALTER TABLE users ADD CONSTRAINT UNIQUE KEY user_name_index (name);