ALTER TABLE `mst_client` CHANGE COLUMN `intelligent_alerts` `category_intelligent_alerts` TINYINT NOT NULL DEFAULT '0' ;

ALTER TABLE `mst_client` ADD COLUMN `country_intelligent_alerts` TINYINT NOT NULL DEFAULT '0' AFTER `category_intelligent_alerts`, 
ADD COLUMN `logistics_intelligent_alerts` TINYINT NOT NULL DEFAULT '0' AFTER `country_intelligent_alerts`;

ALTER TABLE `mst_user` 
ADD COLUMN `country_intelligent_alerts` TINYINT NOT NULL DEFAULT '0' AFTER `category_intelligent_alerts`,
ADD COLUMN `logistics_intelligent_alerts` TINYINT NOT NULL DEFAULT '0' AFTER `country_intelligent_alerts`,
CHANGE COLUMN `intelligent_alerts` `category_intelligent_alerts` TINYINT NOT NULL DEFAULT '0' ;


CREATE TABLE `client_supplier_pdf` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `client_id` INT UNSIGNED NOT NULL,
  `user_id` INT UNSIGNED NOT NULL,
  `job_id` INT NOT NULL,
  `client_supplier_id` INT UNSIGNED NOT NULL,
  `client_category_id` INT NOT NULL,
  `sourcing_country_id` INT NOT NULL,
  `file_name` VARCHAR(255) NULL,
  `status` VARCHAR(50) NOT NULL,
  `redownload_enabled` TINYINT NOT NULL DEFAULT '0',
  `is_active` BIT(1) NOT NULL DEFAULT b'1',
  `created_by` INT NOT NULL,
  `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_by` INT NULL DEFAULT NULL,
  `updated_at` TIMESTAMP NULL DEFAULT NULL,
  PRIMARY KEY (`id`));
  
CREATE TABLE `mst_adjusted_rating_datepoints` (
   `id` int NOT NULL AUTO_INCREMENT,
   `data_points` int NOT NULL,
   `is_active` bit(1) NOT NULL DEFAULT b'1',
   `created_by` int DEFAULT NULL,
   `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `updated_by` int DEFAULT NULL,
   `updated_at` timestamp NULL DEFAULT NULL,
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
INSERT INTO `mst_adjusted_rating_datepoints` (`id`, `data_points`, `is_active`) VALUES ('1', '7', b'1');
INSERT INTO `mst_adjusted_rating_datepoints` (`id`, `data_points`, `is_active`) VALUES ('2', '30', b'1');
INSERT INTO `mst_adjusted_rating_datepoints` (`id`, `data_points`, `is_active`) VALUES ('3', '90', b'1');