CREATE TABLE IF NOT EXISTS `oa_lieuconversion` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `account` char(30) NOT NULL,
  `dept` mediumint(8) unsigned NOT NULL,
  `hours` float unsigned NOT NULL,
  `desc` text NOT NULL,
  `createdBy` char(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `oa_annualconversion` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `year` char(4) NOT NULL,
  `days` float unsigned NOT NULL,
  `dept` mediumint(8) unsigned NOT NULL,
  `status` enum('wait', 'draft', 'pass', 'reject', 'grant'),
  `desc` text NOT NULL,
  `reason` text NOT NULL,
  `createdBy` char(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `reviewedBy` char(30) NOT NULL,
  `reviewedDate` datetime NOT NULL,
  `grantedBy` char(30) NOT NULL,
  `grantedDate` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

ALTER TABLE `cash_trade` ADD `relatedType` varchar(30) NOT NULL AFTER `contract`;
ALTER TABLE `cash_trade` ADD `relatedID` mediumint(8) unsigned NOT NULL AFTER `relatedType`;
ALTER TABLE `sys_team` ADD `participation` decimal(6,2) unsigned NOT NULL AFTER `rate`;
ALTER TABLE `sys_group` ADD `order` smallint(5) unsigned NOT NULL AFTER `name`;

UPDATE `sys_group` SET `order` = `id`;
