-- ------------------------------------------------
-- Obsolete "promote roles"
-- Created 20131003
-- ------------------------------------------------

ALTER TABLE `um_role`
  ADD COLUMN `license_category_id` INT(10) UNSIGNED NOT NULL DEFAULT 0  AFTER `um_delete`, 
  ADD INDEX `sys_cli_cat` (`system` ASC, `client` ASC, `license_category_id` ASC);
  
ALTER TABLE `license_category`
  CHANGE COLUMN `id` `id` INT(10) UNSIGNED NOT NULL,
  ADD COLUMN `system` VARCHAR(8) NOT NULL DEFAULT '---'  AFTER `id`,
  ADD COLUMN `client` CHAR(3) NOT NULL DEFAULT '---'  AFTER `system`, 
  DROP PRIMARY KEY, 
  ADD PRIMARY KEY (`id`, `client`, `system`);
  
ALTER TABLE `um_dash_roles_per_license_category` 
  ADD COLUMN `system` VARCHAR(8) NOT NULL DEFAULT '---'  AFTER `date`, 
  ADD COLUMN `client` CHAR(3) NOT NULL DEFAULT '---'  AFTER `system`, 
  DROP PRIMARY KEY, 
  ADD PRIMARY KEY (`date`, `category_id`, `system`, `client`);
