/*
SQLyog Community v12.09 (64 bit)
MySQL - 5.6.17 : Database - revotech_crm
*********************************************************************
*/


/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`revotech_crm` /*!40100 DEFAULT CHARACTER SET utf8 */;

USE `revotech_crm`;

/*Table structure for table `cron` */

DROP TABLE IF EXISTS `cron`;

CREATE TABLE `cron` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci NOT NULL,
  `category` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `class_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `function_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `parameter` text COLLATE utf8_unicode_ci NOT NULL,
  `max_execution_time` int(11) NOT NULL,
  `status` tinyint(4) NOT NULL,
  `weekly` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `monthly` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `yearly` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `minute` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `hour` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `last_run` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `cron` */

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

ALTER TABLE `revotech_crm`.`campaign_data_5`   
  ADD COLUMN `campaign_new_email` TEXT NOT NULL AFTER `campaign_new_ic`;

SELECT *
FROM campaign_data_2
WHERE DATE(campaign_progress_updated_at) = '2016-11-04'
AND campaign_progress_status IN (31,32,33)

ALTER TABLE `revotech_crm`.`campaign_data_2`   
  CHANGE `campaign_verify_status` `campaign_verify_status` ENUM('reject','pass','active','completed','pending','cancelled') CHARSET utf8 COLLATE utf8_unicode_ci DEFAULT 'active'  NOT NULL;

