SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';

ALTER TABLE `sog`.`glam_his_access_point` CHANGE COLUMN `his_action` `his_action` ENUM('ADDED','UPDATED','DELETED','LOCK_REPLACED','LATCH_REPLACED','VALIDATED') NULL DEFAULT NULL  ;

ALTER TABLE `sog`.`glam_his_access_object_key` ADD COLUMN `user_id` CHAR(36) NULL DEFAULT NULL  AFTER `his_action` , ADD COLUMN `access_obj_serial_no` INT(11) NULL DEFAULT NULL  AFTER `user_id` , CHANGE COLUMN `his_action` `his_action` ENUM('ADDED','UPDATED','DELETED','ASSIGNED','DEASSIGNED') NULL DEFAULT NULL  ;

ALTER TABLE `sog`.`glam_supervisor_schedule` CHANGE COLUMN `transaction_location` `transaction_location` POINT NULL  ;

DROP TABLE IF EXISTS `sog`.`glam_his_access_object` ;

DROP TRIGGER IF EXISTS `sog`.`apUpdate` ;

DELIMITER $$

USE `sog`$$
DROP TRIGGER IF EXISTS `sog`.`aoUpdate` $$


DELIMITER ;


DELIMITER $$

USE `sog`$$
DROP TRIGGER IF EXISTS `sog`.`aoInsert` $$


DELIMITER ;


DELIMITER $$

USE `sog`$$
DROP TRIGGER IF EXISTS `sog`.`aoKeyUpdate` $$


DELIMITER ;


DELIMITER $$

USE `sog`$$
DROP TRIGGER IF EXISTS `sog`.`aoKeyInsert` $$


DELIMITER ;


SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
