forked from aces/Loris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
major changes to the script Major changes Everything works first of many renamed renamed
- Loading branch information
1 parent
efeb72a
commit 1693592
Showing
13 changed files
with
1,876 additions
and
432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
ALTER TABLE `permissions` DROP FOREIGN KEY `fk_permissions_1`; | ||
ALTER TABLE `permissions` DROP INDEX `fk_permissions_1_idx`; | ||
ALTER TABLE `permissions` DROP COLUMN `categoryID`; | ||
|
||
DROP TABLE `permissions_category`; | ||
|
||
CREATE TABLE `permission_category` ( | ||
`PermissionCategoryID` INTEGER unsigned NOT NULL AUTO_INCREMENT, | ||
`Category` varchar(255), | ||
`Label` varchar(255), | ||
PRIMARY KEY (`PermissionCategoryID`), | ||
UNIQUE KEY `UK_Category` (`Category`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
CREATE TABLE `permission_category_permissions_rel` ( | ||
`PermissionCategoryID` INTEGER unsigned NOT NULL, | ||
`PermissionID` INTEGER unsigned NOT NULL, | ||
PRIMARY KEY (`PermissionCategoryID`,`PermissionID`), | ||
CONSTRAINT `FK_permission_category_permissions_rel_PermissionCategoryID` FOREIGN KEY (`PermissionCategoryID`) REFERENCES `permission_category` (`PermissionCategoryID`) ON DELETE CASCADE ON UPDATE CASCADE, | ||
CONSTRAINT `FK_permission_category_permissions_rel_PermissionID` FOREIGN KEY (`PermissionID`) REFERENCES `permissions` (`permID`) ON DELETE CASCADE ON UPDATE CASCADE | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
CREATE TABLE `users_permission_category_rel` ( | ||
`UserID` INTEGER unsigned NOT NULL, | ||
`PermissionCategoryID` INTEGER unsigned NOT NULL, | ||
PRIMARY KEY (`UserID`,`PermissionCategoryID`), | ||
CONSTRAINT `FK_users_permission_category_rel_userID` FOREIGN KEY (`userID`) REFERENCES `users` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE, | ||
CONSTRAINT `FK_users_permission_category_rel_PermissionCategoryID` FOREIGN KEY (`PermissionCategoryID`) REFERENCES `permission_category` (`PermissionCategoryID`) ON DELETE CASCADE ON UPDATE CASCADE | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
Oops, something went wrong.