CREATE TABLE `sys_kanbangroup` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL,
  `region` mediumint(8) unsigned NOT NULL,
  `order` tinyint(3) unsigned NOT NULL,
  `name` varchar(60) NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `deleted` enum('0', '1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `project` (`project`),
  KEY `region` (`region`),
  KEY `order` (`order`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

ALTER TABLE `sys_task` ADD `kanbanGroup` mediumint(8) unsigned NOT NULL AFTER `kanbanRegion`;
ALTER TABLE `sys_task` ADD `color` varchar(10) NOT NULL DEFAULT '#FFFFFF' AFTER `name`;

ALTER TABLE `sys_kanbanlane` ADD `project` mediumint(8) unsigned NOT NULL AFTER `id`;
ALTER TABLE `sys_kanbanlane` MODIFY `group` mediumint(8) unsigned NOT NULL;
ALTER TABLE `sys_kanbanlane` MODIFY `color` varchar(10) NOT NULL DEFAULT '#3DC6FD';

ALTER TABLE `sys_kanbancolumn` ADD `project` mediumint(8) unsigned NOT NULL AFTER `id`;
ALTER TABLE `sys_kanbancolumn` MODIFY `group` mediumint(8) unsigned NOT NULL;
ALTER TABLE `sys_kanbancolumn` MODIFY `color` varchar(10) NOT NULL DEFAULT '#272E33';

UPDATE `sys_kanbanlane` SET `color` = UPPER(`color`);
UPDATE `sys_kanbancolumn` SET `color` = UPPER(`color`);
