CREATE DATABASE /*!32312 IF NOT EXISTS*/ `master_biz` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `master_biz`;
DROP TABLE IF EXISTS `biz_service_state`;
CREATE TABLE `biz_service_state` (
  `service_id` varchar(32) NOT NULL,
  `d_health` tinyint(4) DEFAULT 0,
  `d_available` tinyint(4) DEFAULT 1,
  `d_risk` decimal(16,4) DEFAULT 0.0000,
  `collection_time` datetime NOT NULL,
  PRIMARY KEY (`service_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `biz_service_state` VALUES ('ckgbm10gb009no74dzys39ce8',100,NULL,0.0000,'2020-10-16 18:40:00');

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `master_ap2` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `master_ap2`;
DROP TABLE IF EXISTS `har_provider`;
CREATE TABLE `har_provider` (
  `guid` char(32) NOT NULL,
  `roa_id` int(11) NOT NULL,
  `policy_guid` char(32) NOT NULL,
  `filter_guid` char(32) NOT NULL,
  `contact_user_id` int(11) DEFAULT NULL,
  `contact_roa_id` int(11) DEFAULT NULL,
  `name` varchar(128) NOT NULL,
  `descr` text DEFAULT NULL,
  `type` tinyint(1) NOT NULL,
  `origin_guid` char(32) DEFAULT NULL,
  `reference_filter_guid` char(32) DEFAULT NULL,
  `rca_mode` tinyint(1) NOT NULL DEFAULT 0,
  `search_additional_orgs` smallint(1) DEFAULT 1,
  `apps_in_biz` smallint(1) DEFAULT 0,
  `create_date` datetime NOT NULL DEFAULT current_timestamp(),
  `edit_date` datetime NOT NULL DEFAULT current_timestamp(),
  `edited_by` int(11) DEFAULT NULL,
  PRIMARY KEY (`guid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `har_provider` VALUES ('ckgbm10gb009no74dzys39ce8',7,'ckgbji3nb008knt4d57b83n2r','ckgbji3yu00lont4d22tp96sm',NULL,7,'c9454d783fae7e46f59455bd23611490','fe0c79969b89eb69c32aee361e5bef9e',1,'ckfxi252b02ou1fq5odo82ii6',NULL,0,1,NULL,'2020-10-16 02:05:26','2020-10-16 02:05:26',NULL);

DROP TABLE IF EXISTS `har_provider_org`;
CREATE TABLE `har_provider_org` (
  `provider_guid` char(32) NOT NULL,
  `roa_id` int(11) NOT NULL,
  PRIMARY KEY (`provider_guid`,`roa_id`),
  KEY `provider_index` (`provider_guid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
