CREATE TABLE IF NOT EXISTS `sys_gift` (
   `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
   `name` varchar(150) NOT NULL,
   `score` smallint(5) unsigned NOT NULL,
   `amount` decimal(15,2) NOT NULL,
   `status` enum('normal', 'offline') NOT NULL,
   `limit` smallint(5) unsigned NOT NULL,
   `desc` text NOT NULL,
   `scoreGift` tinyint(1) NOT NULL DEFAULT 1,
   `createdBy` varchar(30) NOT NULL,
   `createdDate` datetime NOT NULL,
   `editedBy` varchar(30) NOT NULL,
   `editedDate` datetime NOT NULL,
   `deleted` enum('0','1') NOT NULL,
   PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

ALTER TABLE `crm_customer` ADD `recommendationRate` char(2) NOT NULL AFTER `public`;
ALTER TABLE `crm_customer` ADD `sourceType` varchar(30) NOT NULL AFTER `relation`;
ALTER TABLE `crm_contract` ADD `signType` varchar(30) NOT NULL AFTER `handlers`;
