class for forwarding + db update

--HG--
branch : quitta-gsoc-2013
This commit is contained in:
Quitta 2013-07-22 13:19:07 +02:00
parent e9853f3262
commit 178d59caac
4 changed files with 51 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 122 KiB

View file

@ -275,13 +275,14 @@
INSERT IGNORE INTO `" . $cfg['db']['lib']['name'] ."`.`ticket_category` (`Name`) VALUES ('Hacking'),('Ingame-Bug'),('Website-Bug'),('Installation'); INSERT IGNORE INTO `" . $cfg['db']['lib']['name'] ."`.`ticket_category` (`Name`) VALUES ('Hacking'),('Ingame-Bug'),('Website-Bug'),('Installation');
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `" . $cfg['db']['lib']['name'] ."`.`support_group` -- Table `" . $cfg['db']['lib']['name'] ."`.`support_group`
-- ----------------------------------------------------- -- -----------------------------------------------------
DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`support_group` ; DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`support_group` ;
CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`support_group` ( CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`support_group` (
`SGroupId` INT(10) NOT NULL AUTO_INCREMENT , `SGroupId` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`Name` VARCHAR(22) NOT NULL , `Name` VARCHAR(22) NOT NULL ,
`Tag` VARCHAR(7) NOT NULL , `Tag` VARCHAR(7) NOT NULL ,
PRIMARY KEY (`SGroupId`) , PRIMARY KEY (`SGroupId`) ,
@ -297,7 +298,7 @@
CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`in_support_group` ( CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`in_support_group` (
`User` INT(10) UNSIGNED NOT NULL , `User` INT(10) UNSIGNED NOT NULL ,
`Group` INT(10) NOT NULL , `Group` INT(10) UNSIGNED NOT NULL ,
INDEX `fk_in_support_group_ticket_user1` (`User` ASC) , INDEX `fk_in_support_group_ticket_user1` (`User` ASC) ,
INDEX `fk_in_support_group_support_group1` (`Group` ASC) , INDEX `fk_in_support_group_support_group1` (`Group` ASC) ,
CONSTRAINT `fk_in_support_group_ticket_user1` CONSTRAINT `fk_in_support_group_ticket_user1`
@ -312,6 +313,28 @@
ON UPDATE NO ACTION) ON UPDATE NO ACTION)
ENGINE = InnoDB; ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `" . $cfg['db']['lib']['name'] ."`.`forwarded`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`forwarded` ;
CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`forwarded` (
`Group` INT(10) UNSIGNED NOT NULL ,
`Ticket` INT UNSIGNED NOT NULL ,
INDEX `fk_forwarded_support_group1` (`Group` ASC) ,
INDEX `fk_forwarded_ticket1` (`Ticket` ASC) ,
CONSTRAINT `fk_forwarded_support_group1`
FOREIGN KEY (`Group` )
REFERENCES `" . $cfg['db']['lib']['name'] ."`.`support_group` (`SGroupId` )
ON DELETE CASCADE
ON UPDATE NO ACTION,
CONSTRAINT `fk_forwarded_ticket1`
FOREIGN KEY (`Ticket` )
REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket` (`TId` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
"; ";

View file

@ -238,7 +238,7 @@ ENGINE = InnoDB;
DROP TABLE IF EXISTS `mydb`.`support_group` ; DROP TABLE IF EXISTS `mydb`.`support_group` ;
CREATE TABLE IF NOT EXISTS `mydb`.`support_group` ( CREATE TABLE IF NOT EXISTS `mydb`.`support_group` (
`SGroupId` INT(10) NOT NULL AUTO_INCREMENT , `SGroupId` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`Name` VARCHAR(22) NOT NULL , `Name` VARCHAR(22) NOT NULL ,
`Tag` VARCHAR(7) NOT NULL , `Tag` VARCHAR(7) NOT NULL ,
PRIMARY KEY (`SGroupId`) , PRIMARY KEY (`SGroupId`) ,
@ -254,7 +254,7 @@ DROP TABLE IF EXISTS `mydb`.`in_support_group` ;
CREATE TABLE IF NOT EXISTS `mydb`.`in_support_group` ( CREATE TABLE IF NOT EXISTS `mydb`.`in_support_group` (
`User` INT(10) UNSIGNED NOT NULL , `User` INT(10) UNSIGNED NOT NULL ,
`Group` INT(10) NOT NULL , `Group` INT(10) UNSIGNED NOT NULL ,
INDEX `fk_in_support_group_ticket_user1` (`User` ASC) , INDEX `fk_in_support_group_ticket_user1` (`User` ASC) ,
INDEX `fk_in_support_group_support_group1` (`Group` ASC) , INDEX `fk_in_support_group_support_group1` (`Group` ASC) ,
CONSTRAINT `fk_in_support_group_ticket_user1` CONSTRAINT `fk_in_support_group_ticket_user1`
@ -270,6 +270,29 @@ CREATE TABLE IF NOT EXISTS `mydb`.`in_support_group` (
ENGINE = InnoDB; ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`forwarded`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `mydb`.`forwarded` ;
CREATE TABLE IF NOT EXISTS `mydb`.`forwarded` (
`Group` INT(10) UNSIGNED NOT NULL ,
`Ticket` INT UNSIGNED NOT NULL ,
INDEX `fk_forwarded_support_group1` (`Group` ASC) ,
INDEX `fk_forwarded_ticket1` (`Ticket` ASC) ,
CONSTRAINT `fk_forwarded_support_group1`
FOREIGN KEY (`Group` )
REFERENCES `mydb`.`support_group` (`SGroupId` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_forwarded_ticket1`
FOREIGN KEY (`Ticket` )
REFERENCES `mydb`.`ticket` (`TId` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE; SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;