-- ------------------------------------------------
-- Table for authorization values in roles 
-- Created 20140521
-- ------------------------------------------------

CREATE TABLE IF NOT EXISTS `um_role_auth` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `um_delete` TINYINT NOT NULL DEFAULT 0 ,
  `role_id` INT NOT NULL ,
  `object` CHAR(10) NOT NULL ,
  `auth` CHAR(12) NOT NULL ,
  `field` CHAR(10) NOT NULL ,
  `low` VARCHAR(40) NULL ,
  `high` VARCHAR(40) NULL ,
  PRIMARY KEY (`id`) ,
  INDEX `del` (`um_delete` ASC) ,
  INDEX `obj_auth_fld` (`object` ASC, `auth` ASC, `field` ASC) ,
  INDEX `role_idx` (`role_id` ASC) ,
  CONSTRAINT `role_auth_role_id`
    FOREIGN KEY (`role_id` )
    REFERENCES `um_role` (`id` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION
);
