ALTER TABLE `AuthItem` CHANGE COLUMN `name` `name` VARCHAR(255) NOT NULL  ;

ALTER TABLE `AuthItemChild` DROP FOREIGN KEY `AuthItemChild_ibfk_1` , DROP FOREIGN KEY `AuthItemChild_ibfk_2` ;
ALTER TABLE `AuthItemChild` CHANGE COLUMN `parent` `parent` VARCHAR(255) NOT NULL  , CHANGE COLUMN `child` `child` VARCHAR(255) NOT NULL  , 
  ADD CONSTRAINT `AuthItemChild_ibfk_1`
  FOREIGN KEY (`parent` )
  REFERENCES `AuthItem` (`name` )
  ON DELETE CASCADE
  ON UPDATE CASCADE, 
  ADD CONSTRAINT `AuthItemChild_ibfk_2`
  FOREIGN KEY (`child` )
  REFERENCES `AuthItem` (`name` )
  ON DELETE CASCADE
  ON UPDATE CASCADE;

ALTER TABLE `AuthAssignment` DROP FOREIGN KEY `AuthAssignment_ibfk_1` ;
ALTER TABLE `AuthAssignment` CHANGE COLUMN `itemname` `itemname` VARCHAR(255) NOT NULL  , 
  ADD CONSTRAINT `AuthAssignment_ibfk_1`
  FOREIGN KEY (`itemname` )
  REFERENCES `AuthItem` (`name` )
  ON DELETE CASCADE
  ON UPDATE CASCADE;
