-- --------------------------------------------------------
-- Host:                         127.0.0.1
-- Server version:               8.0.29 - MySQL Community Server - GPL
-- Server OS:                    Win64
-- HeidiSQL Version:             11.2.0.6213
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!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 */;

ALTER TABLE `agents`
ADD COLUMN `sst_reg_no` varchar(191) DEFAULT NULL AFTER `ic_number`,
ADD COLUMN `bus_address` varchar(191) DEFAULT NULL AFTER `address`,
ADD COLUMN `fax_no` varchar(191) DEFAULT NULL AFTER `contact_number`,
ADD COLUMN `contact_person_name_1` varchar(191) DEFAULT NULL AFTER `upload_ssm_path`,
ADD COLUMN `contact_person_designation_1` varchar(191) DEFAULT NULL AFTER `contact_person_name_1`,
ADD COLUMN `contact_person_email_address_1` varchar(191) DEFAULT NULL AFTER `contact_person_designation_1`,
ADD COLUMN `contact_person_contact_no_1` varchar(191) DEFAULT NULL AFTER `contact_person_email_address_1`,
ADD COLUMN `contact_person_signature_1` varchar(191) DEFAULT NULL AFTER `contact_person_contact_no_1`,
ADD COLUMN `contact_person_stamp_1` varchar(191) DEFAULT NULL AFTER `contact_person_signature_1`,
ADD COLUMN `contact_person_name_2` varchar(191) DEFAULT NULL AFTER `contact_person_stamp_1`,
ADD COLUMN `contact_person_designation_2` varchar(191) DEFAULT NULL AFTER `contact_person_name_2`,
ADD COLUMN `contact_person_email_address_2` varchar(191) DEFAULT NULL AFTER `contact_person_designation_2`,
ADD COLUMN `contact_person_contact_no_2` varchar(191) DEFAULT NULL AFTER `contact_person_email_address_2`,
ADD COLUMN `contact_person_signature_2` varchar(191) DEFAULT NULL AFTER `contact_person_contact_no_2`,
ADD COLUMN `contact_person_stamp_2` varchar(191) DEFAULT NULL AFTER `contact_person_signature_2`,
ADD COLUMN `bank_beneficiary_name` varchar(191) DEFAULT NULL AFTER `contact_person_stamp_2`,
ADD COLUMN `bank_name` varchar(191) DEFAULT NULL AFTER `bank_beneficiary_name`,
ADD COLUMN `bank_account_no` varchar(191) DEFAULT NULL AFTER `bank_name`;


ALTER TABLE `agents` ADD COLUMN  `bus_state_id` bigint(20) UNSIGNED NULL AFTER `bus_address`;

ALTER TABLE `agents`
ADD CONSTRAINT `agents_bus_state_id_foreign`
FOREIGN KEY (`bus_state_id`) REFERENCES `states` (`id`);


ALTER TABLE `agents` ADD COLUMN  `bus_city_id` bigint(20) UNSIGNED NULL AFTER `bus_state_id`;

ALTER TABLE `agents`
ADD CONSTRAINT `agents_bus_city_id_foreign`
FOREIGN KEY (`bus_city_id`) REFERENCES `cities` (`id`);

-- Dumping structure for table hgagent.agent_customer_documents
CREATE TABLE IF NOT EXISTS `agent_customer_documents` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `filename` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `agent_id` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `agent_customer_documents_agent_id_foreign` (`agent_id`),
  CONSTRAINT `agent_customer_documents_agent_id_foreign` FOREIGN KEY (`agent_id`) REFERENCES `agents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
