//DB Table
  CREATE TABLE `bvd_client_supplier` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `client_id` int(10) unsigned NOT NULL,
    `client_name` varchar(255) NOT NULL,
    `supplier_name` varchar(255) DEFAULT NULL,
    `supplier_name_alias` varchar(255) DEFAULT NULL,
    `bvd_id` varchar(100) DEFAULT NULL,
    `ultimate_parent` varchar(255) DEFAULT NULL,
    `bvd_status` varchar(255) DEFAULT NULL,

    `corporate_type` varchar(255) DEFAULT NULL,
    `overview` text DEFAULT NULL,
    `trade_description` text DEFAULT NULL,

    `products_and_services` text DEFAULT NULL,
    `nace_core_code` varchar(255) DEFAULT NULL,
    `nace_core_code_desc` text DEFAULT NULL,
    `nace_primary_code` varchar(255) DEFAULT NULL,

    `nace_primary_code_desc` text DEFAULT NULL,

    `nace_secondary_code` varchar(255) DEFAULT NULL,
    `nace_secondary_code_desc` text DEFAULT NULL,
    
    `supplier_rating` text DEFAULT NULL,
    `share_holder` text DEFAULT NULL,
    `director_executive` text DEFAULT NULL,
    
    
    
    `is_active` tinyint(1) NOT NULL DEFAULT 1,
    `created_by` int(11) DEFAULT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_by` int(11) DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;


  CREATE TABLE `temp_bvd_client_supplier` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `client_id` int(10) unsigned NOT NULL,
    `client_name` varchar(255) NOT NULL,
    `supplier_name` varchar(255) DEFAULT NULL,
    `supplier_name_alias` varchar(255) DEFAULT NULL,
    `bvd_id` varchar(100) DEFAULT NULL,
    `ultimate_parent` varchar(255) DEFAULT NULL,
    `bvd_status` varchar(255) DEFAULT NULL,

    `corporate_type` varchar(255) DEFAULT NULL,
    `overview` text DEFAULT NULL,
    `trade_description` text DEFAULT NULL,

    `products_and_services` text DEFAULT NULL,
    `nace_core_code` varchar(255) DEFAULT NULL,
    `nace_core_code_desc` text DEFAULT NULL,
    `nace_primary_code` varchar(255) DEFAULT NULL,
    `nace_primary_code_desc` text DEFAULT NULL,

    `nace_secondary_code` varchar(255) DEFAULT NULL,
    `nace_secondary_code_desc` text DEFAULT NULL,
    
    `supplier_rating` text DEFAULT NULL,
    `share_holder` text DEFAULT NULL,
    `director_executive` text DEFAULT NULL,
    
    
    
    `is_active` tinyint(1) NOT NULL DEFAULT 1,
    `created_by` int(11) DEFAULT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_by` int(11) DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;


  CREATE TABLE `bvd_supplier_ratings` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `bvd_id` varchar(100) DEFAULT NULL,
    `more_risk_score` varchar(100) NOT NULL,
    `more_risk_score_year` BOOLEAN DEFAULT NULL,
    `more_confidence_percentage` varchar(100) DEFAULT NULL,
    `more_probability_of_default` varchar(100) NOT NULL,
    `more_credit_limit` varchar(100) DEFAULT NULL,
    `more_industry` varchar(100) NOT NULL,
    `moody_score` varchar(100) DEFAULT NULL,
    `moody_risk_year` varchar(100) DEFAULT NULL,
    `moody_env_score` varchar(100) NOT NULL,
    `moody_social_score` varchar(100) DEFAULT NULL,
    `moody_governance_score` varchar(100) DEFAULT NULL,
    `company_score` varchar(100) DEFAULT NULL,
    `peer_group_score` varchar(100) DEFAULT NULL,
    `year` varchar(100) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;


  CREATE TABLE `bvd_share_holder` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `bvd_id` varchar(100) DEFAULT NULL,
    `name` varchar(100) NOT NULL,
    `show_flag` BOOLEAN DEFAULT NULL,
    `country` varchar(100) NOT NULL,
    `type` varchar(100) DEFAULT NULL,
    `ownership_direct_percentage` varchar(100) NOT NULL,
    `ownership_total_percentage` varchar(100) DEFAULT NULL,
    `info_source` varchar(100) DEFAULT NULL,
    `info_date` varchar(100) NOT NULL,
    `op_rev_m_usd` varchar(100) DEFAULT NULL,
    `no_of_employees` varchar(100) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;


  CREATE TABLE `bvd_director_executive` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `bvd_id` varchar(100) DEFAULT NULL,
    `full_name` varchar(100) NOT NULL,
    `job_title` BOOLEAN DEFAULT NULL,
    `appointment_date` varchar(100) NOT NULL,
    `resignation_date` varchar(100) DEFAULT NULL,
    `show_flag` BOOLEAN DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
----------------
  CREATE TABLE `bvd_moore_risk_score_legends` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `moore_rating` varchar(100) NOT NULL,
    `description` varchar(255) DEFAULT NULL,
    `color_code` varchar(100) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

  CREATE TABLE `bvd_supplier_rating_esg_score_legends` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `esg_score` varchar(100) NOT NULL,
    `description` varchar(255) DEFAULT NULL,
    `color_code` varchar(100) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

  CREATE TABLE `bvd_dir_share_holder_source_legends` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `ip_code` varchar(100) NOT NULL,
    `ip_name` varchar(100) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

  CREATE TABLE `bvd_share_holder_type` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `type` varchar(100) NOT NULL,
    `description` varchar(255) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE `bvd_client_supplier` 
ADD COLUMN `nace_primary_code_desc` text NULL DEFAULT NULL COMMENT '' AFTER `nace_primary_code`;


ALTER TABLE `temp_bvd_client_supplier` 
ADD COLUMN `nace_primary_code_desc` text NULL DEFAULT NULL COMMENT '' AFTER `nace_primary_code`;
