text: -- MySQL dump 10.13  Distrib 8.0.18, for macos10.14 (x86_64)
  --
  -- Host: localhost    Database: central_ledger
  -- ------------------------------------------------------
  -- Server version	8.0.13
  
  /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  /*!50503 SET NAMES utf8 */;
  /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
  /*!40103 SET TIME_ZONE='+00:00' */;
  /*!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 */;
  
  --
  -- Table structure for table `amountType`
  --
  
  DROP TABLE IF EXISTS `amountType`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `amountType` (
    `amountTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(256) NOT NULL,
    `description` varchar(1024) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
    PRIMARY KEY (`amountTypeId`),
    UNIQUE KEY `amounttype_name_unique` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `balanceOfPayments`
  --
  
  DROP TABLE IF EXISTS `balanceOfPayments`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `balanceOfPayments` (
    `balanceOfPaymentsId` int(10) unsigned NOT NULL,
    `name` varchar(256) NOT NULL,
    `description` varchar(1024) DEFAULT NULL COMMENT 'Possible values and meaning are defined in https://www.imf.org/external/np/sta/bopcode/',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
    PRIMARY KEY (`balanceOfPaymentsId`),
    UNIQUE KEY `balanceofpayments_name_unique` (`name`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='See https://www.imf.org/external/np/sta/bopcode/guide.htm';
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `bulkProcessingState`
  --
  
  DROP TABLE IF EXISTS `bulkProcessingState`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `bulkProcessingState` (
    `bulkProcessingStateId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `description` varchar(512) DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`bulkProcessingStateId`),
    UNIQUE KEY `bulkprocessingstate_name_unique` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `bulkTransfer`
  --
  
  DROP TABLE IF EXISTS `bulkTransfer`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `bulkTransfer` (
    `bulkTransferId` varchar(36) NOT NULL,
    `bulkQuoteId` varchar(36) DEFAULT NULL,
    `payerParticipantId` int(10) unsigned DEFAULT NULL,
    `payeeParticipantId` int(10) unsigned DEFAULT NULL,
    `expirationDate` datetime NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`bulkTransferId`),
    KEY `bulktransfer_payerparticipantid_index` (`payerParticipantId`),
    KEY `bulktransfer_payeeparticipantid_index` (`payeeParticipantId`),
    CONSTRAINT `bulktransfer_bulktransferid_foreign` FOREIGN KEY (`bulkTransferId`) REFERENCES `bulkTransferDuplicateCheck` (`bulktransferid`),
    CONSTRAINT `bulktransfer_payeeparticipantid_foreign` FOREIGN KEY (`payeeParticipantId`) REFERENCES `participant` (`participantid`),
    CONSTRAINT `bulktransfer_payerparticipantid_foreign` FOREIGN KEY (`payerParticipantId`) REFERENCES `participant` (`participantid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `bulkTransferAssociation`
  --
  
  DROP TABLE IF EXISTS `bulkTransferAssociation`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `bulkTransferAssociation` (
    `bulkTransferAssociationId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `transferId` varchar(36) NOT NULL,
    `bulkTransferId` varchar(36) NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `bulkProcessingStateId` int(10) unsigned NOT NULL,
    `lastProcessedDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `errorCode` int(10) unsigned DEFAULT NULL,
    `errorDescription` varchar(128) DEFAULT NULL,
    PRIMARY KEY (`bulkTransferAssociationId`),
    UNIQUE KEY `bulktransferassociation_transferid_bulktransferid_unique` (`transferId`,`bulkTransferId`),
    KEY `bulktransferassociation_bulktransferid_foreign` (`bulkTransferId`),
    KEY `bulktransferassociation_bulkprocessingstateid_foreign` (`bulkProcessingStateId`),
    CONSTRAINT `bulktransferassociation_bulkprocessingstateid_foreign` FOREIGN KEY (`bulkProcessingStateId`) REFERENCES `bulkProcessingState` (`bulkprocessingstateid`),
    CONSTRAINT `bulktransferassociation_bulktransferid_foreign` FOREIGN KEY (`bulkTransferId`) REFERENCES `bulkTransfer` (`bulktransferid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `bulkTransferDuplicateCheck`
  --
  
  DROP TABLE IF EXISTS `bulkTransferDuplicateCheck`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `bulkTransferDuplicateCheck` (
    `bulkTransferId` varchar(36) NOT NULL,
    `hash` varchar(256) NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`bulkTransferId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `bulkTransferError`
  --
  
  DROP TABLE IF EXISTS `bulkTransferError`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `bulkTransferError` (
    `bulkTransferErrorId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `bulkTransferStateChangeId` bigint(20) unsigned NOT NULL,
    `errorCode` int(10) unsigned NOT NULL,
    `errorDescription` varchar(128) NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`bulkTransferErrorId`),
    KEY `bulktransfererror_bulktransferstatechangeid_index` (`bulkTransferStateChangeId`),
    CONSTRAINT `bulktransfererror_bulktransferstatechangeid_foreign` FOREIGN KEY (`bulkTransferStateChangeId`) REFERENCES `bulkTransferStateChange` (`bulktransferstatechangeid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `bulkTransferExtension`
  --
  
  DROP TABLE IF EXISTS `bulkTransferExtension`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `bulkTransferExtension` (
    `bulkTransferExtensionId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `bulkTransferId` varchar(36) NOT NULL,
    `isFulfilment` tinyint(1) NOT NULL DEFAULT '0',
    `key` varchar(128) NOT NULL,
    `value` text NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`bulkTransferExtensionId`),
    KEY `bulktransferextension_bulktransferid_index` (`bulkTransferId`),
    CONSTRAINT `bulktransferextension_bulktransferid_foreign` FOREIGN KEY (`bulkTransferId`) REFERENCES `bulkTransfer` (`bulktransferid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `bulkTransferFulfilment`
  --
  
  DROP TABLE IF EXISTS `bulkTransferFulfilment`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `bulkTransferFulfilment` (
    `bulkTransferId` varchar(36) NOT NULL,
    `completedDate` datetime NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`bulkTransferId`),
    CONSTRAINT `bulktransferfulfilment_bulktransferid_foreign` FOREIGN KEY (`bulkTransferId`) REFERENCES `bulkTransferFulfilmentDuplicateCheck` (`bulktransferid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `bulkTransferFulfilmentDuplicateCheck`
  --
  
  DROP TABLE IF EXISTS `bulkTransferFulfilmentDuplicateCheck`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `bulkTransferFulfilmentDuplicateCheck` (
    `bulkTransferId` varchar(36) NOT NULL,
    `hash` varchar(256) NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`bulkTransferId`),
    CONSTRAINT `bulktransferfulfilmentduplicatecheck_bulktransferid_foreign` FOREIGN KEY (`bulkTransferId`) REFERENCES `bulkTransfer` (`bulktransferid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `bulkTransferState`
  --
  
  DROP TABLE IF EXISTS `bulkTransferState`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `bulkTransferState` (
    `bulkTransferStateId` varchar(50) NOT NULL,
    `enumeration` varchar(50) NOT NULL COMMENT 'bulkTransferState associated to the Mojaloop API',
    `description` varchar(512) DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`bulkTransferStateId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `bulkTransferStateChange`
  --
  
  DROP TABLE IF EXISTS `bulkTransferStateChange`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `bulkTransferStateChange` (
    `bulkTransferStateChangeId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `bulkTransferId` varchar(36) NOT NULL,
    `bulkTransferStateId` varchar(50) NOT NULL,
    `reason` varchar(512) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`bulkTransferStateChangeId`),
    KEY `bulktransferstatechange_bulktransferid_index` (`bulkTransferId`),
    KEY `bulktransferstatechange_bulktransferstateid_index` (`bulkTransferStateId`),
    CONSTRAINT `bulktransferstatechange_bulktransferid_foreign` FOREIGN KEY (`bulkTransferId`) REFERENCES `bulkTransfer` (`bulktransferid`),
    CONSTRAINT `bulktransferstatechange_bulktransferstateid_foreign` FOREIGN KEY (`bulkTransferStateId`) REFERENCES `bulkTransferState` (`bulktransferstateid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `contactType`
  --
  
  DROP TABLE IF EXISTS `contactType`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `contactType` (
    `contactTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `description` varchar(512) DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`contactTypeId`),
    UNIQUE KEY `contacttype_name_unique` (`name`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `currency`
  --
  
  DROP TABLE IF EXISTS `currency`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `currency` (
    `currencyId` varchar(3) NOT NULL,
    `name` varchar(128) DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `scale` int(10) unsigned NOT NULL DEFAULT '4',
    PRIMARY KEY (`currencyId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `endpointType`
  --
  
  DROP TABLE IF EXISTS `endpointType`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `endpointType` (
    `endpointTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `description` varchar(512) DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`endpointTypeId`),
    UNIQUE KEY `endpointtype_name_unique` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `event`
  --
  
  DROP TABLE IF EXISTS `event`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `event` (
    `eventId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(128) NOT NULL,
    `description` varchar(512) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`eventId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `expiringTransfer`
  --
  
  DROP TABLE IF EXISTS `expiringTransfer`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `expiringTransfer` (
    `expiringTransferId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `transferId` varchar(36) NOT NULL,
    `expirationDate` datetime NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`expiringTransferId`),
    UNIQUE KEY `expiringtransfer_transferid_unique` (`transferId`),
    KEY `expiringtransfer_expirationdate_index` (`expirationDate`),
    CONSTRAINT `expiringtransfer_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transfer` (`transferid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `geoCode`
  --
  
  DROP TABLE IF EXISTS `geoCode`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `geoCode` (
    `geoCodeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `quotePartyId` bigint(20) unsigned NOT NULL COMMENT 'Optionally the GeoCode for the Payer/Payee may have been provided. If the Quote Response has the GeoCode for the Payee, an additional row is added',
    `latitude` varchar(50) NOT NULL COMMENT 'Latitude of the initiating Party',
    `longitude` varchar(50) NOT NULL COMMENT 'Longitude of the initiating Party',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
    PRIMARY KEY (`geoCodeId`),
    KEY `geocode_quotepartyid_foreign` (`quotePartyId`),
    CONSTRAINT `geocode_quotepartyid_foreign` FOREIGN KEY (`quotePartyId`) REFERENCES `quoteParty` (`quotepartyid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `ilpPacket`
  --
  
  DROP TABLE IF EXISTS `ilpPacket`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `ilpPacket` (
    `transferId` varchar(36) NOT NULL,
    `value` text NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`transferId`),
    CONSTRAINT `ilppacket_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transfer` (`transferid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `ledgerAccountType`
  --
  
  DROP TABLE IF EXISTS `ledgerAccountType`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `ledgerAccountType` (
    `ledgerAccountTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `description` varchar(512) DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `isSettleable` tinyint(1) NOT NULL DEFAULT '0',
    PRIMARY KEY (`ledgerAccountTypeId`),
    UNIQUE KEY `ledgeraccounttype_name_unique` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `ledgerEntryType`
  --
  
  DROP TABLE IF EXISTS `ledgerEntryType`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `ledgerEntryType` (
    `ledgerEntryTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `description` varchar(512) DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `ledgerAccountTypeId` int(10) unsigned DEFAULT NULL,
    PRIMARY KEY (`ledgerEntryTypeId`),
    UNIQUE KEY `ledgerentrytype_name_unique` (`name`),
    KEY `ledgerentrytype_ledgeraccounttypeid_foreign` (`ledgerAccountTypeId`),
    CONSTRAINT `ledgerentrytype_ledgeraccounttypeid_foreign` FOREIGN KEY (`ledgerAccountTypeId`) REFERENCES `ledgerAccountType` (`ledgeraccounttypeid`)
  ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `migration`
  --
  
  DROP TABLE IF EXISTS `migration`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `migration` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(255) DEFAULT NULL,
    `batch` int(11) DEFAULT NULL,
    `migration_time` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=157 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `migration_lock`
  --
  
  DROP TABLE IF EXISTS `migration_lock`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `migration_lock` (
    `index` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `is_locked` int(11) DEFAULT NULL,
    PRIMARY KEY (`index`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `participant`
  --
  
  DROP TABLE IF EXISTS `participant`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `participant` (
    `participantId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(256) NOT NULL,
    `description` varchar(512) DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `createdBy` varchar(128) NOT NULL,
    PRIMARY KEY (`participantId`),
    UNIQUE KEY `participant_name_unique` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `participantContact`
  --
  
  DROP TABLE IF EXISTS `participantContact`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `participantContact` (
    `participantContactId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `participantId` int(10) unsigned NOT NULL,
    `contactTypeId` int(10) unsigned NOT NULL,
    `value` varchar(256) NOT NULL,
    `priorityPreference` int(11) NOT NULL DEFAULT '9',
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `createdBy` varchar(128) NOT NULL,
    PRIMARY KEY (`participantContactId`),
    KEY `participantcontact_participantid_index` (`participantId`),
    KEY `participantcontact_contacttypeid_index` (`contactTypeId`),
    CONSTRAINT `participantcontact_contacttypeid_foreign` FOREIGN KEY (`contactTypeId`) REFERENCES `contactType` (`contacttypeid`),
    CONSTRAINT `participantcontact_participantid_foreign` FOREIGN KEY (`participantId`) REFERENCES `participant` (`participantid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `participantCurrency`
  --
  
  DROP TABLE IF EXISTS `participantCurrency`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `participantCurrency` (
    `participantCurrencyId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `participantId` int(10) unsigned NOT NULL,
    `currencyId` varchar(3) NOT NULL,
    `ledgerAccountTypeId` int(10) unsigned NOT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `createdBy` varchar(128) NOT NULL,
    PRIMARY KEY (`participantCurrencyId`),
    UNIQUE KEY `participantcurrency_pcl_unique` (`participantId`,`currencyId`,`ledgerAccountTypeId`),
    KEY `participantcurrency_ledgeraccounttypeid_foreign` (`ledgerAccountTypeId`),
    KEY `participantcurrency_participantid_index` (`participantId`),
    KEY `participantcurrency_currencyid_index` (`currencyId`),
    CONSTRAINT `participantcurrency_currencyid_foreign` FOREIGN KEY (`currencyId`) REFERENCES `currency` (`currencyid`),
    CONSTRAINT `participantcurrency_ledgeraccounttypeid_foreign` FOREIGN KEY (`ledgerAccountTypeId`) REFERENCES `ledgerAccountType` (`ledgeraccounttypeid`),
    CONSTRAINT `participantcurrency_participantid_foreign` FOREIGN KEY (`participantId`) REFERENCES `participant` (`participantid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `participantEndpoint`
  --
  
  DROP TABLE IF EXISTS `participantEndpoint`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `participantEndpoint` (
    `participantEndpointId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `participantId` int(10) unsigned NOT NULL,
    `endpointTypeId` int(10) unsigned NOT NULL,
    `value` varchar(512) NOT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `createdBy` varchar(128) NOT NULL,
    PRIMARY KEY (`participantEndpointId`),
    KEY `participantendpoint_participantid_index` (`participantId`),
    KEY `participantendpoint_endpointtypeid_index` (`endpointTypeId`),
    CONSTRAINT `participantendpoint_endpointtypeid_foreign` FOREIGN KEY (`endpointTypeId`) REFERENCES `endpointType` (`endpointtypeid`),
    CONSTRAINT `participantendpoint_participantid_foreign` FOREIGN KEY (`participantId`) REFERENCES `participant` (`participantid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `participantLimit`
  --
  
  DROP TABLE IF EXISTS `participantLimit`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `participantLimit` (
    `participantLimitId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `participantCurrencyId` int(10) unsigned NOT NULL,
    `participantLimitTypeId` int(10) unsigned NOT NULL,
    `value` decimal(18,4) NOT NULL DEFAULT '0.0000',
    `thresholdAlarmPercentage` decimal(5,2) NOT NULL DEFAULT '10.00',
    `startAfterParticipantPositionChangeId` bigint(20) unsigned DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `createdBy` varchar(128) NOT NULL,
    PRIMARY KEY (`participantLimitId`),
    KEY `participantlimit_participantcurrencyid_index` (`participantCurrencyId`),
    KEY `participantlimit_participantlimittypeid_index` (`participantLimitTypeId`),
    KEY `participantlimit_startafterparticipantpositionchangeid_index` (`startAfterParticipantPositionChangeId`),
    CONSTRAINT `participantlimit_participantcurrencyid_foreign` FOREIGN KEY (`participantCurrencyId`) REFERENCES `participantCurrency` (`participantcurrencyid`),
    CONSTRAINT `participantlimit_participantlimittypeid_foreign` FOREIGN KEY (`participantLimitTypeId`) REFERENCES `participantLimitType` (`participantlimittypeid`),
    CONSTRAINT `participantlimit_startafterparticipantpositionchangeid_foreign` FOREIGN KEY (`startAfterParticipantPositionChangeId`) REFERENCES `participantPositionChange` (`participantpositionchangeid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `participantLimitType`
  --
  
  DROP TABLE IF EXISTS `participantLimitType`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `participantLimitType` (
    `participantLimitTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `description` varchar(512) DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`participantLimitTypeId`),
    UNIQUE KEY `participantlimittype_name_unique` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `participantParty`
  --
  
  DROP TABLE IF EXISTS `participantParty`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `participantParty` (
    `participantPartyId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `participantId` int(10) unsigned NOT NULL,
    `partyId` bigint(20) unsigned NOT NULL,
    PRIMARY KEY (`participantPartyId`),
    UNIQUE KEY `participantparty_participantid_partyid_unique` (`participantId`,`partyId`),
    KEY `participantparty_participantid_index` (`participantId`),
    CONSTRAINT `participantparty_participantid_foreign` FOREIGN KEY (`participantId`) REFERENCES `participant` (`participantid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `participantPosition`
  --
  
  DROP TABLE IF EXISTS `participantPosition`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `participantPosition` (
    `participantPositionId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `participantCurrencyId` int(10) unsigned NOT NULL,
    `value` decimal(18,4) NOT NULL,
    `reservedValue` decimal(18,4) NOT NULL,
    `changedDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`participantPositionId`),
    KEY `participantposition_participantcurrencyid_index` (`participantCurrencyId`),
    CONSTRAINT `participantposition_participantcurrencyid_foreign` FOREIGN KEY (`participantCurrencyId`) REFERENCES `participantCurrency` (`participantcurrencyid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `participantPositionChange`
  --
  
  DROP TABLE IF EXISTS `participantPositionChange`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `participantPositionChange` (
    `participantPositionChangeId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `participantPositionId` bigint(20) unsigned NOT NULL,
    `transferStateChangeId` bigint(20) unsigned NOT NULL,
    `value` decimal(18,4) NOT NULL,
    `reservedValue` decimal(18,4) NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`participantPositionChangeId`),
    KEY `participantpositionchange_participantpositionid_index` (`participantPositionId`),
    KEY `participantpositionchange_transferstatechangeid_index` (`transferStateChangeId`),
    CONSTRAINT `participantpositionchange_participantpositionid_foreign` FOREIGN KEY (`participantPositionId`) REFERENCES `participantPosition` (`participantpositionid`),
    CONSTRAINT `participantpositionchange_transferstatechangeid_foreign` FOREIGN KEY (`transferStateChangeId`) REFERENCES `transferStateChange` (`transferstatechangeid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `party`
  --
  
  DROP TABLE IF EXISTS `party`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `party` (
    `partyId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `quotePartyId` bigint(20) unsigned NOT NULL,
    `firstName` varchar(128) DEFAULT NULL,
    `middleName` varchar(128) DEFAULT NULL,
    `lastName` varchar(128) DEFAULT NULL,
    `dateOfBirth` datetime DEFAULT NULL,
    PRIMARY KEY (`partyId`),
    KEY `party_quotepartyid_foreign` (`quotePartyId`),
    CONSTRAINT `party_quotepartyid_foreign` FOREIGN KEY (`quotePartyId`) REFERENCES `quoteParty` (`quotepartyid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Optional pers. data provided during Quote Request & Response';
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `partyIdentifierType`
  --
  
  DROP TABLE IF EXISTS `partyIdentifierType`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `partyIdentifierType` (
    `partyIdentifierTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `description` varchar(512) NOT NULL,
    PRIMARY KEY (`partyIdentifierTypeId`),
    UNIQUE KEY `partyidentifiertype_name_unique` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `partyType`
  --
  
  DROP TABLE IF EXISTS `partyType`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `partyType` (
    `partyTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(128) NOT NULL,
    `description` varchar(256) NOT NULL,
    PRIMARY KEY (`partyTypeId`),
    UNIQUE KEY `partytype_name_unique` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `quote`
  --
  
  DROP TABLE IF EXISTS `quote`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `quote` (
    `quoteId` varchar(36) NOT NULL,
    `transactionReferenceId` varchar(36) NOT NULL COMMENT 'Common ID (decided by the Payer FSP) between the FSPs for the future transaction object',
    `transactionRequestId` varchar(36) DEFAULT NULL COMMENT 'Optional previously-sent transaction request',
    `note` text COMMENT 'A memo that will be attached to the transaction',
    `expirationDate` datetime DEFAULT NULL COMMENT 'Optional expiration for the requested transaction',
    `transactionInitiatorId` int(10) unsigned NOT NULL COMMENT 'This is part of the transaction initiator',
    `transactionInitiatorTypeId` int(10) unsigned NOT NULL COMMENT 'This is part of the transaction initiator type',
    `transactionScenarioId` int(10) unsigned NOT NULL COMMENT 'This is part of the transaction scenario',
    `balanceOfPaymentsId` int(10) unsigned DEFAULT NULL COMMENT 'This is part of the transaction type that contains the elements- balance of payment',
    `transactionSubScenarioId` int(10) unsigned DEFAULT NULL COMMENT 'This is part of the transaction type sub scenario as defined by the local scheme',
    `amountTypeId` int(10) unsigned NOT NULL COMMENT 'This is part of the transaction type that contains valid elements for - Amount Type',
    `amount` decimal(18,4) NOT NULL DEFAULT '0.0000' COMMENT 'The amount that the quote is being requested for. Need to be interpert in accordance with the amount type',
    `currencyId` varchar(255) DEFAULT NULL COMMENT 'Trading currency pertaining to the Amount',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
    PRIMARY KEY (`quoteId`),
    KEY `quote_transactionreferenceid_foreign` (`transactionReferenceId`),
    KEY `quote_transactionrequestid_foreign` (`transactionRequestId`),
    KEY `quote_transactioninitiatorid_foreign` (`transactionInitiatorId`),
    KEY `quote_transactioninitiatortypeid_foreign` (`transactionInitiatorTypeId`),
    KEY `quote_transactionscenarioid_foreign` (`transactionScenarioId`),
    KEY `quote_balanceofpaymentsid_foreign` (`balanceOfPaymentsId`),
    KEY `quote_transactionsubscenarioid_foreign` (`transactionSubScenarioId`),
    KEY `quote_amounttypeid_foreign` (`amountTypeId`),
    KEY `quote_currencyid_foreign` (`currencyId`),
    CONSTRAINT `quote_amounttypeid_foreign` FOREIGN KEY (`amountTypeId`) REFERENCES `amountType` (`amounttypeid`),
    CONSTRAINT `quote_balanceofpaymentsid_foreign` FOREIGN KEY (`balanceOfPaymentsId`) REFERENCES `balanceOfPayments` (`balanceofpaymentsid`),
    CONSTRAINT `quote_currencyid_foreign` FOREIGN KEY (`currencyId`) REFERENCES `currency` (`currencyid`),
    CONSTRAINT `quote_transactioninitiatorid_foreign` FOREIGN KEY (`transactionInitiatorId`) REFERENCES `transactionInitiator` (`transactioninitiatorid`),
    CONSTRAINT `quote_transactioninitiatortypeid_foreign` FOREIGN KEY (`transactionInitiatorTypeId`) REFERENCES `transactionInitiatorType` (`transactioninitiatortypeid`),
    CONSTRAINT `quote_transactionreferenceid_foreign` FOREIGN KEY (`transactionReferenceId`) REFERENCES `transactionReference` (`transactionreferenceid`),
    CONSTRAINT `quote_transactionrequestid_foreign` FOREIGN KEY (`transactionRequestId`) REFERENCES `transactionReference` (`transactionreferenceid`),
    CONSTRAINT `quote_transactionscenarioid_foreign` FOREIGN KEY (`transactionScenarioId`) REFERENCES `transactionScenario` (`transactionscenarioid`),
    CONSTRAINT `quote_transactionsubscenarioid_foreign` FOREIGN KEY (`transactionSubScenarioId`) REFERENCES `transactionSubScenario` (`transactionsubscenarioid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `quoteDuplicateCheck`
  --
  
  DROP TABLE IF EXISTS `quoteDuplicateCheck`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `quoteDuplicateCheck` (
    `quoteId` varchar(36) NOT NULL COMMENT 'Common ID between the FSPs for the quote object, decided by the Payer FSP',
    `hash` varchar(1024) DEFAULT NULL COMMENT 'hash value received for the quote request',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
    PRIMARY KEY (`quoteId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `quoteError`
  --
  
  DROP TABLE IF EXISTS `quoteError`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `quoteError` (
    `quoteErrorId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `quoteId` varchar(36) NOT NULL COMMENT 'Common ID between the FSPs for the quote object, decided by the Payer FSP',
    `quoteResponseId` bigint(20) unsigned DEFAULT NULL COMMENT 'The response to the intial quote',
    `errorCode` int(10) unsigned NOT NULL,
    `errorDescription` varchar(128) NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`quoteErrorId`),
    KEY `quoteerror_quoteid_foreign` (`quoteId`),
    KEY `quoteerror_quoteresponseid_foreign` (`quoteResponseId`),
    CONSTRAINT `quoteerror_quoteid_foreign` FOREIGN KEY (`quoteId`) REFERENCES `quote` (`quoteid`),
    CONSTRAINT `quoteerror_quoteresponseid_foreign` FOREIGN KEY (`quoteResponseId`) REFERENCES `quoteResponse` (`quoteresponseid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `quoteExtension`
  --
  
  DROP TABLE IF EXISTS `quoteExtension`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `quoteExtension` (
    `quoteExtensionId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `quoteId` varchar(36) NOT NULL COMMENT 'Common ID between the FSPs for the quote object, decided by the Payer FSP',
    `quoteResponseId` bigint(20) unsigned NOT NULL COMMENT 'The response to the intial quote',
    `transactionId` varchar(36) NOT NULL COMMENT 'The transaction reference that is part of the initial quote',
    `key` varchar(128) NOT NULL,
    `value` text NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
    PRIMARY KEY (`quoteExtensionId`),
    KEY `quoteextension_quoteid_foreign` (`quoteId`),
    KEY `quoteextension_quoteresponseid_foreign` (`quoteResponseId`),
    KEY `quoteextension_transactionid_foreign` (`transactionId`),
    CONSTRAINT `quoteextension_quoteid_foreign` FOREIGN KEY (`quoteId`) REFERENCES `quote` (`quoteid`),
    CONSTRAINT `quoteextension_quoteresponseid_foreign` FOREIGN KEY (`quoteResponseId`) REFERENCES `quoteResponse` (`quoteresponseid`),
    CONSTRAINT `quoteextension_transactionid_foreign` FOREIGN KEY (`transactionId`) REFERENCES `transactionReference` (`transactionreferenceid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `quoteParty`
  --
  
  DROP TABLE IF EXISTS `quoteParty`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `quoteParty` (
    `quotePartyId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `quoteId` varchar(36) NOT NULL COMMENT 'Common ID between the FSPs for the quote object, decided by the Payer FSP',
    `partyTypeId` int(10) unsigned NOT NULL COMMENT 'Specifies the type of party this row relates to; typically PAYER or PAYEE',
    `partyIdentifierTypeId` int(10) unsigned NOT NULL COMMENT 'Specifies the type of identifier used to identify this party e.g. MSISDN, IBAN etc...',
    `partyIdentifierValue` varchar(128) NOT NULL COMMENT 'The value of the identifier used to identify this party',
    `partySubIdOrTypeId` int(10) unsigned DEFAULT NULL COMMENT 'A sub-identifier or sub-type for the Party',
    `fspId` varchar(255) DEFAULT NULL COMMENT 'This is the FSP ID as provided in the quote. For the switch between multi-parties it is required',
    `participantId` int(10) unsigned DEFAULT NULL COMMENT 'Reference to the resolved FSP ID (if supplied/known). If not an error will be reported',
    `merchantClassificationCode` varchar(4) DEFAULT NULL COMMENT 'Used in the context of Payee Information, where the Payee happens to be a merchant accepting merchant payments',
    `partyName` varchar(128) DEFAULT NULL COMMENT 'Display name of the Party, could be a real name or a nick name',
    `transferParticipantRoleTypeId` int(10) unsigned NOT NULL COMMENT 'The role this Party is playing in the transaction',
    `ledgerEntryTypeId` int(10) unsigned NOT NULL COMMENT 'The type of financial entry this Party is presenting',
    `amount` decimal(18,4) NOT NULL,
    `currencyId` varchar(3) NOT NULL COMMENT 'Trading currency pertaining to the party amount',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
    PRIMARY KEY (`quotePartyId`),
    KEY `quoteparty_quoteid_foreign` (`quoteId`),
    KEY `quoteparty_partytypeid_foreign` (`partyTypeId`),
    KEY `quoteparty_partyidentifiertypeid_foreign` (`partyIdentifierTypeId`),
    KEY `quoteparty_partysubidortypeid_foreign` (`partySubIdOrTypeId`),
    KEY `quoteparty_participantid_foreign` (`participantId`),
    KEY `quoteparty_transferparticipantroletypeid_foreign` (`transferParticipantRoleTypeId`),
    KEY `quoteparty_ledgerentrytypeid_foreign` (`ledgerEntryTypeId`),
    KEY `quoteparty_currencyid_foreign` (`currencyId`),
    CONSTRAINT `quoteparty_currencyid_foreign` FOREIGN KEY (`currencyId`) REFERENCES `currency` (`currencyid`),
    CONSTRAINT `quoteparty_ledgerentrytypeid_foreign` FOREIGN KEY (`ledgerEntryTypeId`) REFERENCES `ledgerEntryType` (`ledgerentrytypeid`),
    CONSTRAINT `quoteparty_participantid_foreign` FOREIGN KEY (`participantId`) REFERENCES `participant` (`participantid`),
    CONSTRAINT `quoteparty_partyidentifiertypeid_foreign` FOREIGN KEY (`partyIdentifierTypeId`) REFERENCES `partyIdentifierType` (`partyidentifiertypeid`),
    CONSTRAINT `quoteparty_partysubidortypeid_foreign` FOREIGN KEY (`partySubIdOrTypeId`) REFERENCES `partyIdentifierType` (`partyidentifiertypeid`),
    CONSTRAINT `quoteparty_partytypeid_foreign` FOREIGN KEY (`partyTypeId`) REFERENCES `partyType` (`partytypeid`),
    CONSTRAINT `quoteparty_quoteid_foreign` FOREIGN KEY (`quoteId`) REFERENCES `quote` (`quoteid`),
    CONSTRAINT `quoteparty_transferparticipantroletypeid_foreign` FOREIGN KEY (`transferParticipantRoleTypeId`) REFERENCES `transferParticipantRoleType` (`transferparticipantroletypeid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Temporary view structure for view `quotePartyView`
  --
  
  DROP TABLE IF EXISTS `quotePartyView`;
  /*!50001 DROP VIEW IF EXISTS `quotePartyView`*/;
  SET @saved_cs_client     = @@character_set_client;
  /*!50503 SET character_set_client = utf8mb4 */;
  /*!50001 CREATE VIEW `quotePartyView` AS SELECT 
   1 AS `quoteId`,
   1 AS `quotePartyId`,
   1 AS `partyType`,
   1 AS `identifierType`,
   1 AS `partyIdentifierValue`,
   1 AS `partySubIdOrType`,
   1 AS `fspId`,
   1 AS `merchantClassificationCode`,
   1 AS `partyName`,
   1 AS `firstName`,
   1 AS `lastName`,
   1 AS `middleName`,
   1 AS `dateOfBirth`,
   1 AS `longitude`,
   1 AS `latitude`*/;
  SET character_set_client = @saved_cs_client;
  
  --
  -- Table structure for table `quoteResponse`
  --
  
  DROP TABLE IF EXISTS `quoteResponse`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `quoteResponse` (
    `quoteResponseId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `quoteId` varchar(36) NOT NULL COMMENT 'Common ID between the FSPs for the quote object, decided by the Payer FSP',
    `transferAmountCurrencyId` varchar(3) NOT NULL COMMENT 'CurrencyId of the transfer amount',
    `transferAmount` decimal(18,4) NOT NULL COMMENT 'The amount of money that the Payer FSP should transfer to the Payee FSP',
    `payeeReceiveAmountCurrencyId` varchar(3) DEFAULT NULL COMMENT 'CurrencyId of the payee receive amount',
    `payeeReceiveAmount` decimal(18,4) DEFAULT NULL COMMENT 'The amount of Money that the Payee should receive in the end-to-end transaction. Optional as the Payee FSP might not want to disclose any optional Payee fees',
    `payeeFspFeeCurrencyId` varchar(3) DEFAULT NULL COMMENT 'CurrencyId of the payee fsp fee amount',
    `payeeFspFeeAmount` decimal(18,4) DEFAULT NULL COMMENT 'Payee FSP’s part of the transaction fee',
    `payeeFspCommissionCurrencyId` varchar(3) DEFAULT NULL COMMENT 'CurrencyId of the payee fsp commission amount',
    `payeeFspCommissionAmount` decimal(18,4) DEFAULT NULL COMMENT 'Transaction commission from the Payee FSP',
    `ilpCondition` varchar(256) NOT NULL,
    `responseExpirationDate` datetime DEFAULT NULL COMMENT 'Optional expiration for the requested transaction',
    `isValid` tinyint(1) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
    PRIMARY KEY (`quoteResponseId`),
    KEY `quoteresponse_quoteid_foreign` (`quoteId`),
    KEY `quoteresponse_transferamountcurrencyid_foreign` (`transferAmountCurrencyId`),
    KEY `quoteresponse_payeereceiveamountcurrencyid_foreign` (`payeeReceiveAmountCurrencyId`),
    KEY `quoteresponse_payeefspcommissioncurrencyid_foreign` (`payeeFspCommissionCurrencyId`),
    CONSTRAINT `quoteresponse_payeefspcommissioncurrencyid_foreign` FOREIGN KEY (`payeeFspCommissionCurrencyId`) REFERENCES `currency` (`currencyid`),
    CONSTRAINT `quoteresponse_payeereceiveamountcurrencyid_foreign` FOREIGN KEY (`payeeReceiveAmountCurrencyId`) REFERENCES `currency` (`currencyid`),
    CONSTRAINT `quoteresponse_quoteid_foreign` FOREIGN KEY (`quoteId`) REFERENCES `quote` (`quoteid`),
    CONSTRAINT `quoteresponse_transferamountcurrencyid_foreign` FOREIGN KEY (`transferAmountCurrencyId`) REFERENCES `currency` (`currencyid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='This table is the primary store for quote responses';
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `quoteResponseDuplicateCheck`
  --
  
  DROP TABLE IF EXISTS `quoteResponseDuplicateCheck`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `quoteResponseDuplicateCheck` (
    `quoteResponseId` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'The response to the intial quote',
    `quoteId` varchar(36) NOT NULL COMMENT 'Common ID between the FSPs for the quote object, decided by the Payer FSP',
    `hash` varchar(255) DEFAULT NULL COMMENT 'hash value received for the quote response',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
    PRIMARY KEY (`quoteResponseId`),
    KEY `quoteresponseduplicatecheck_quoteid_foreign` (`quoteId`),
    CONSTRAINT `quoteresponseduplicatecheck_quoteid_foreign` FOREIGN KEY (`quoteId`) REFERENCES `quote` (`quoteid`),
    CONSTRAINT `quoteresponseduplicatecheck_quoteresponseid_foreign` FOREIGN KEY (`quoteResponseId`) REFERENCES `quoteResponse` (`quoteresponseid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `quoteResponseIlpPacket`
  --
  
  DROP TABLE IF EXISTS `quoteResponseIlpPacket`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `quoteResponseIlpPacket` (
    `quoteResponseId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `value` text NOT NULL COMMENT 'ilpPacket returned from Payee in response to a quote request',
    PRIMARY KEY (`quoteResponseId`),
    CONSTRAINT `quoteresponseilppacket_quoteresponseid_foreign` FOREIGN KEY (`quoteResponseId`) REFERENCES `quoteResponse` (`quoteresponseid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Temporary view structure for view `quoteResponseView`
  --
  
  DROP TABLE IF EXISTS `quoteResponseView`;
  /*!50001 DROP VIEW IF EXISTS `quoteResponseView`*/;
  SET @saved_cs_client     = @@character_set_client;
  /*!50503 SET character_set_client = utf8mb4 */;
  /*!50001 CREATE VIEW `quoteResponseView` AS SELECT 
   1 AS `quoteResponseId`,
   1 AS `quoteId`,
   1 AS `transferAmountCurrencyId`,
   1 AS `transferAmount`,
   1 AS `payeeReceiveAmountCurrencyId`,
   1 AS `payeeReceiveAmount`,
   1 AS `payeeFspFeeCurrencyId`,
   1 AS `payeeFspFeeAmount`,
   1 AS `payeeFspCommissionCurrencyId`,
   1 AS `payeeFspCommissionAmount`,
   1 AS `ilpCondition`,
   1 AS `responseExpirationDate`,
   1 AS `isValid`,
   1 AS `createdDate`,
   1 AS `ilpPacket`,
   1 AS `longitude`,
   1 AS `latitude`*/;
  SET character_set_client = @saved_cs_client;
  
  --
  -- Temporary view structure for view `quoteView`
  --
  
  DROP TABLE IF EXISTS `quoteView`;
  /*!50001 DROP VIEW IF EXISTS `quoteView`*/;
  SET @saved_cs_client     = @@character_set_client;
  /*!50503 SET character_set_client = utf8mb4 */;
  /*!50001 CREATE VIEW `quoteView` AS SELECT 
   1 AS `quoteId`,
   1 AS `transactionReferenceId`,
   1 AS `transactionRequestId`,
   1 AS `note`,
   1 AS `expirationDate`,
   1 AS `transactionInitiator`,
   1 AS `transactionInitiatorType`,
   1 AS `transactionScenario`,
   1 AS `balanceOfPaymentsId`,
   1 AS `transactionSubScenario`,
   1 AS `amountType`,
   1 AS `amount`,
   1 AS `currency`*/;
  SET character_set_client = @saved_cs_client;
  
  --
  -- Table structure for table `segment`
  --
  
  DROP TABLE IF EXISTS `segment`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `segment` (
    `segmentId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `segmentType` varchar(50) NOT NULL,
    `enumeration` int(11) NOT NULL DEFAULT '0',
    `tableName` varchar(50) NOT NULL,
    `value` bigint(20) NOT NULL,
    `changedDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`segmentId`),
    KEY `segment_keys_index` (`segmentType`,`enumeration`,`tableName`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlement`
  --
  
  DROP TABLE IF EXISTS `settlement`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlement` (
    `settlementId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `reason` varchar(512) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `currentStateChangeId` bigint(20) unsigned DEFAULT NULL,
    `settlementModelId` int(10) unsigned DEFAULT NULL,
    PRIMARY KEY (`settlementId`),
    KEY `settlement_currentstatechangeid_foreign` (`currentStateChangeId`),
    KEY `settlement_settlementmodelid_foreign` (`settlementModelId`),
    CONSTRAINT `settlement_currentstatechangeid_foreign` FOREIGN KEY (`currentStateChangeId`) REFERENCES `settlementStateChange` (`settlementstatechangeid`),
    CONSTRAINT `settlement_settlementmodelid_foreign` FOREIGN KEY (`settlementModelId`) REFERENCES `settlementModel` (`settlementmodelid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlementContentAggregation`
  --
  
  DROP TABLE IF EXISTS `settlementContentAggregation`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlementContentAggregation` (
    `settlementContentAggregationId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `settlementWindowContentId` bigint(20) unsigned NOT NULL,
    `participantCurrencyId` int(10) unsigned NOT NULL,
    `transferParticipantRoleTypeId` int(10) unsigned NOT NULL,
    `ledgerEntryTypeId` int(10) unsigned NOT NULL,
    `amount` decimal(18,2) NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `currentStateId` varchar(50) NOT NULL,
    `settlementId` bigint(20) unsigned DEFAULT NULL,
    PRIMARY KEY (`settlementContentAggregationId`),
    KEY `settlementcontentaggregation_settlementwindowcontentid_index` (`settlementWindowContentId`),
    KEY `settlementcontentaggregation_participantcurrencyid_index` (`participantCurrencyId`),
    KEY `settlementcontentaggregation_transferparticipantroletypeid_index` (`transferParticipantRoleTypeId`),
    KEY `settlementcontentaggregation_ledgerentrytypeid_index` (`ledgerEntryTypeId`),
    KEY `settlementcontentaggregation_currentstateid_index` (`currentStateId`),
    KEY `settlementcontentaggregation_settlementid_index` (`settlementId`),
    CONSTRAINT `sca_transferparticipantroletypeid_foreign` FOREIGN KEY (`transferParticipantRoleTypeId`) REFERENCES `transferParticipantRoleType` (`transferparticipantroletypeid`),
    CONSTRAINT `settlementcontentaggregation_currentstateid_foreign` FOREIGN KEY (`currentStateId`) REFERENCES `settlementWindowState` (`settlementwindowstateid`),
    CONSTRAINT `settlementcontentaggregation_ledgerentrytypeid_foreign` FOREIGN KEY (`ledgerEntryTypeId`) REFERENCES `ledgerEntryType` (`ledgerentrytypeid`),
    CONSTRAINT `settlementcontentaggregation_participantcurrencyid_foreign` FOREIGN KEY (`participantCurrencyId`) REFERENCES `participantCurrency` (`participantcurrencyid`),
    CONSTRAINT `settlementcontentaggregation_settlementid_foreign` FOREIGN KEY (`settlementId`) REFERENCES `settlement` (`settlementid`),
    CONSTRAINT `settlementcontentaggregation_settlementwindowcontentid_foreign` FOREIGN KEY (`settlementWindowContentId`) REFERENCES `settlementWindowContent` (`settlementwindowcontentid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlementDelay`
  --
  
  DROP TABLE IF EXISTS `settlementDelay`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlementDelay` (
    `settlementDelayId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `description` varchar(512) DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
    PRIMARY KEY (`settlementDelayId`),
    UNIQUE KEY `settlementdelay_name_unique` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlementGranularity`
  --
  
  DROP TABLE IF EXISTS `settlementGranularity`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlementGranularity` (
    `settlementGranularityId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `description` varchar(512) DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
    PRIMARY KEY (`settlementGranularityId`),
    UNIQUE KEY `settlementgranularity_name_unique` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlementInterchange`
  --
  
  DROP TABLE IF EXISTS `settlementInterchange`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlementInterchange` (
    `settlementInterchangeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `description` varchar(512) DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
    PRIMARY KEY (`settlementInterchangeId`),
    UNIQUE KEY `settlementinterchange_name_unique` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlementModel`
  --
  
  DROP TABLE IF EXISTS `settlementModel`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlementModel` (
    `settlementModelId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `settlementGranularityId` int(10) unsigned NOT NULL,
    `settlementInterchangeId` int(10) unsigned NOT NULL,
    `settlementDelayId` int(10) unsigned NOT NULL,
    `currencyId` varchar(3) DEFAULT NULL,
    `requireLiquidityCheck` tinyint(1) NOT NULL DEFAULT '1',
    `ledgerAccountTypeId` int(10) unsigned NOT NULL,
    `autoPositionReset` tinyint(1) NOT NULL DEFAULT '0',
    PRIMARY KEY (`settlementModelId`),
    UNIQUE KEY `settlementmodel_name_unique` (`name`),
    KEY `settlementmodel_settlementgranularityid_index` (`settlementGranularityId`),
    KEY `settlementmodel_settlementinterchangeid_index` (`settlementInterchangeId`),
    KEY `settlementmodel_settlementdelayid_index` (`settlementDelayId`),
    KEY `settlementmodel_currencyid_index` (`currencyId`),
    KEY `settlementmodel_ledgeraccounttypeid_index` (`ledgerAccountTypeId`),
    CONSTRAINT `settlementmodel_currencyid_foreign` FOREIGN KEY (`currencyId`) REFERENCES `currency` (`currencyid`),
    CONSTRAINT `settlementmodel_ledgeraccounttypeid_foreign` FOREIGN KEY (`ledgerAccountTypeId`) REFERENCES `ledgerAccountType` (`ledgeraccounttypeid`),
    CONSTRAINT `settlementmodel_settlementdelayid_foreign` FOREIGN KEY (`settlementDelayId`) REFERENCES `settlementDelay` (`settlementdelayid`),
    CONSTRAINT `settlementmodel_settlementgranularityid_foreign` FOREIGN KEY (`settlementGranularityId`) REFERENCES `settlementGranularity` (`settlementgranularityid`),
    CONSTRAINT `settlementmodel_settlementinterchangeid_foreign` FOREIGN KEY (`settlementInterchangeId`) REFERENCES `settlementInterchange` (`settlementinterchangeid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlementParticipantCurrency`
  --
  
  DROP TABLE IF EXISTS `settlementParticipantCurrency`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlementParticipantCurrency` (
    `settlementParticipantCurrencyId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `settlementId` bigint(20) unsigned NOT NULL,
    `participantCurrencyId` int(10) unsigned NOT NULL,
    `netAmount` decimal(18,4) NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `currentStateChangeId` bigint(20) unsigned DEFAULT NULL,
    `settlementTransferId` varchar(36) DEFAULT NULL,
    PRIMARY KEY (`settlementParticipantCurrencyId`),
    KEY `settlementparticipantcurrency_settlementid_index` (`settlementId`),
    KEY `settlementparticipantcurrency_participantcurrencyid_index` (`participantCurrencyId`),
    KEY `settlementparticipantcurrency_settlementtransferid_index` (`settlementTransferId`),
    KEY `spc_currentstatechangeid_foreign` (`currentStateChangeId`),
    CONSTRAINT `settlementparticipantcurrency_participantcurrencyid_foreign` FOREIGN KEY (`participantCurrencyId`) REFERENCES `participantCurrency` (`participantcurrencyid`),
    CONSTRAINT `settlementparticipantcurrency_settlementid_foreign` FOREIGN KEY (`settlementId`) REFERENCES `settlement` (`settlementid`),
    CONSTRAINT `spc_currentstatechangeid_foreign` FOREIGN KEY (`currentStateChangeId`) REFERENCES `settlementParticipantCurrencyStateChange` (`settlementparticipantcurrencystatechangeid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlementParticipantCurrencyStateChange`
  --
  
  DROP TABLE IF EXISTS `settlementParticipantCurrencyStateChange`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlementParticipantCurrencyStateChange` (
    `settlementParticipantCurrencyStateChangeId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `settlementParticipantCurrencyId` bigint(20) unsigned NOT NULL,
    `settlementStateId` varchar(50) NOT NULL,
    `reason` varchar(512) DEFAULT NULL,
    `externalReference` varchar(50) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`settlementParticipantCurrencyStateChangeId`),
    KEY `spcsc_settlementparticipantcurrencyid_index` (`settlementParticipantCurrencyId`),
    KEY `spcsc_settlementstateid_index` (`settlementStateId`),
    CONSTRAINT `spcsc_settlementparticipantcurrencyid_foreign` FOREIGN KEY (`settlementParticipantCurrencyId`) REFERENCES `settlementParticipantCurrency` (`settlementparticipantcurrencyid`),
    CONSTRAINT `spcsc_settlementstateid_foreign` FOREIGN KEY (`settlementStateId`) REFERENCES `settlementState` (`settlementstateid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlementSettlementWindow`
  --
  
  DROP TABLE IF EXISTS `settlementSettlementWindow`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlementSettlementWindow` (
    `settlementSettlementWindowId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `settlementId` bigint(20) unsigned NOT NULL,
    `settlementWindowId` bigint(20) unsigned NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`settlementSettlementWindowId`),
    UNIQUE KEY `settlementsettlementwindow_unique` (`settlementId`,`settlementWindowId`),
    KEY `settlementsettlementwindow_settlementid_index` (`settlementId`),
    KEY `settlementsettlementwindow_settlementwindowid_index` (`settlementWindowId`),
    CONSTRAINT `settlementsettlementwindow_settlementid_foreign` FOREIGN KEY (`settlementId`) REFERENCES `settlement` (`settlementid`),
    CONSTRAINT `settlementsettlementwindow_settlementwindowid_foreign` FOREIGN KEY (`settlementWindowId`) REFERENCES `settlementWindow` (`settlementwindowid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlementState`
  --
  
  DROP TABLE IF EXISTS `settlementState`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlementState` (
    `settlementStateId` varchar(50) NOT NULL,
    `enumeration` varchar(50) NOT NULL,
    `description` varchar(512) DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`settlementStateId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlementStateChange`
  --
  
  DROP TABLE IF EXISTS `settlementStateChange`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlementStateChange` (
    `settlementStateChangeId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `settlementId` bigint(20) unsigned NOT NULL,
    `settlementStateId` varchar(50) NOT NULL,
    `reason` varchar(512) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`settlementStateChangeId`),
    KEY `settlementstatechange_settlementid_index` (`settlementId`),
    KEY `settlementstatechange_settlementstateid_index` (`settlementStateId`),
    CONSTRAINT `settlementstatechange_settlementid_foreign` FOREIGN KEY (`settlementId`) REFERENCES `settlement` (`settlementid`),
    CONSTRAINT `settlementstatechange_settlementstateid_foreign` FOREIGN KEY (`settlementStateId`) REFERENCES `settlementState` (`settlementstateid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlementTransferParticipant`
  --
  
  DROP TABLE IF EXISTS `settlementTransferParticipant`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlementTransferParticipant` (
    `settlementTransferParticipantId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `settlementId` bigint(20) unsigned NOT NULL,
    `settlementWindowId` bigint(20) unsigned NOT NULL,
    `participantCurrencyId` int(10) unsigned NOT NULL,
    `transferParticipantRoleTypeId` int(10) unsigned NOT NULL,
    `ledgerEntryTypeId` int(10) unsigned NOT NULL,
    `amount` decimal(18,4) NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`settlementTransferParticipantId`),
    KEY `settlementtransferparticipant_settlementid_index` (`settlementId`),
    KEY `settlementtransferparticipant_settlementwindowid_index` (`settlementWindowId`),
    KEY `settlementtransferparticipant_participantcurrencyid_index` (`participantCurrencyId`),
    KEY `stp_transferparticipantroletypeid_index` (`transferParticipantRoleTypeId`),
    KEY `settlementtransferparticipant_ledgerentrytypeid_index` (`ledgerEntryTypeId`),
    CONSTRAINT `settlementtransferparticipant_ledgerentrytypeid_foreign` FOREIGN KEY (`ledgerEntryTypeId`) REFERENCES `ledgerEntryType` (`ledgerentrytypeid`),
    CONSTRAINT `settlementtransferparticipant_participantcurrencyid_foreign` FOREIGN KEY (`participantCurrencyId`) REFERENCES `participantCurrency` (`participantcurrencyid`),
    CONSTRAINT `settlementtransferparticipant_settlementid_foreign` FOREIGN KEY (`settlementId`) REFERENCES `settlement` (`settlementid`),
    CONSTRAINT `settlementtransferparticipant_settlementwindowid_foreign` FOREIGN KEY (`settlementWindowId`) REFERENCES `settlementWindow` (`settlementwindowid`),
    CONSTRAINT `stp_transferparticipantroletypeid_foreign` FOREIGN KEY (`transferParticipantRoleTypeId`) REFERENCES `transferParticipantRoleType` (`transferparticipantroletypeid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlementWindow`
  --
  
  DROP TABLE IF EXISTS `settlementWindow`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlementWindow` (
    `settlementWindowId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `reason` varchar(512) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `currentStateChangeId` bigint(20) unsigned DEFAULT NULL,
    PRIMARY KEY (`settlementWindowId`),
    KEY `settlementwindow_currentstatechangeid_foreign` (`currentStateChangeId`),
    CONSTRAINT `settlementwindow_currentstatechangeid_foreign` FOREIGN KEY (`currentStateChangeId`) REFERENCES `settlementWindowStateChange` (`settlementwindowstatechangeid`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlementWindowContent`
  --
  
  DROP TABLE IF EXISTS `settlementWindowContent`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlementWindowContent` (
    `settlementWindowContentId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `settlementWindowId` bigint(20) unsigned NOT NULL,
    `ledgerAccountTypeId` int(10) unsigned NOT NULL,
    `currencyId` varchar(3) NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `currentStateChangeId` bigint(20) unsigned DEFAULT NULL,
    `settlementId` bigint(20) unsigned DEFAULT NULL,
    PRIMARY KEY (`settlementWindowContentId`),
    KEY `settlementwindowcontent_settlementwindowid_index` (`settlementWindowId`),
    KEY `settlementwindowcontent_ledgeraccounttypeid_index` (`ledgerAccountTypeId`),
    KEY `settlementwindowcontent_currencyid_index` (`currencyId`),
    KEY `settlementwindowcontent_currentstatechangeid_index` (`currentStateChangeId`),
    KEY `settlementwindowcontent_settlementid_index` (`settlementId`),
    CONSTRAINT `settlementwindowcontent_currencyid_foreign` FOREIGN KEY (`currencyId`) REFERENCES `currency` (`currencyid`),
    CONSTRAINT `settlementwindowcontent_currentstatechangeid_foreign` FOREIGN KEY (`currentStateChangeId`) REFERENCES `settlementWindowContentStateChange` (`settlementwindowcontentstatechangeid`),
    CONSTRAINT `settlementwindowcontent_ledgeraccounttypeid_foreign` FOREIGN KEY (`ledgerAccountTypeId`) REFERENCES `ledgerAccountType` (`ledgeraccounttypeid`),
    CONSTRAINT `settlementwindowcontent_settlementid_foreign` FOREIGN KEY (`settlementId`) REFERENCES `settlement` (`settlementid`),
    CONSTRAINT `settlementwindowcontent_settlementwindowid_foreign` FOREIGN KEY (`settlementWindowId`) REFERENCES `settlementWindow` (`settlementwindowid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlementWindowContentStateChange`
  --
  
  DROP TABLE IF EXISTS `settlementWindowContentStateChange`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlementWindowContentStateChange` (
    `settlementWindowContentStateChangeId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `settlementWindowContentId` bigint(20) unsigned NOT NULL,
    `settlementWindowStateId` varchar(50) NOT NULL,
    `reason` varchar(512) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`settlementWindowContentStateChangeId`),
    KEY `swcsc_settlementwindowcontentid_index` (`settlementWindowContentId`),
    KEY `swcsc_settlementwindowstateid_index` (`settlementWindowStateId`),
    CONSTRAINT `swc_settlementwindowcontentid_foreign` FOREIGN KEY (`settlementWindowContentId`) REFERENCES `settlementWindowContent` (`settlementwindowcontentid`),
    CONSTRAINT `sws1_settlementwindowstateid_foreign` FOREIGN KEY (`settlementWindowStateId`) REFERENCES `settlementWindowState` (`settlementwindowstateid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlementWindowState`
  --
  
  DROP TABLE IF EXISTS `settlementWindowState`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlementWindowState` (
    `settlementWindowStateId` varchar(50) NOT NULL,
    `enumeration` varchar(50) NOT NULL,
    `description` varchar(512) DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`settlementWindowStateId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `settlementWindowStateChange`
  --
  
  DROP TABLE IF EXISTS `settlementWindowStateChange`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `settlementWindowStateChange` (
    `settlementWindowStateChangeId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `settlementWindowId` bigint(20) unsigned NOT NULL,
    `settlementWindowStateId` varchar(50) NOT NULL,
    `reason` varchar(512) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`settlementWindowStateChangeId`),
    KEY `settlementwindowstatechange_settlementwindowid_index` (`settlementWindowId`),
    KEY `settlementwindowstatechange_settlementwindowstateid_index` (`settlementWindowStateId`),
    CONSTRAINT `settlementwindowstatechange_settlementwindowid_foreign` FOREIGN KEY (`settlementWindowId`) REFERENCES `settlementWindow` (`settlementwindowid`),
    CONSTRAINT `settlementwindowstatechange_settlementwindowstateid_foreign` FOREIGN KEY (`settlementWindowStateId`) REFERENCES `settlementWindowState` (`settlementwindowstateid`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `token`
  --
  
  DROP TABLE IF EXISTS `token`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `token` (
    `tokenId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `participantId` int(10) unsigned NOT NULL,
    `value` varchar(256) NOT NULL,
    `expiration` bigint(20) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`tokenId`),
    UNIQUE KEY `token_value_unique` (`value`),
    KEY `token_participantid_index` (`participantId`),
    CONSTRAINT `token_participantid_foreign` FOREIGN KEY (`participantId`) REFERENCES `participant` (`participantid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transactionInitiator`
  --
  
  DROP TABLE IF EXISTS `transactionInitiator`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transactionInitiator` (
    `transactionInitiatorId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(256) NOT NULL,
    `description` varchar(1024) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
    PRIMARY KEY (`transactionInitiatorId`),
    UNIQUE KEY `transactioninitiator_name_unique` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transactionInitiatorType`
  --
  
  DROP TABLE IF EXISTS `transactionInitiatorType`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transactionInitiatorType` (
    `transactionInitiatorTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(256) NOT NULL,
    `description` varchar(1024) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
    PRIMARY KEY (`transactionInitiatorTypeId`),
    UNIQUE KEY `transactioninitiatortype_name_unique` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transactionReference`
  --
  
  DROP TABLE IF EXISTS `transactionReference`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transactionReference` (
    `transactionReferenceId` varchar(36) NOT NULL COMMENT 'Common ID (decided by the Payer FSP) between the FSPs for the future transaction object',
    `quoteId` varchar(36) DEFAULT NULL COMMENT 'Common ID between the FSPs for the quote object, decided by the Payer FSP',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System row creation timestamp',
    PRIMARY KEY (`transactionReferenceId`),
    KEY `transactionreference_quoteid_index` (`quoteId`),
    CONSTRAINT `transactionreference_quoteid_foreign` FOREIGN KEY (`quoteId`) REFERENCES `quoteDuplicateCheck` (`quoteid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transactionScenario`
  --
  
  DROP TABLE IF EXISTS `transactionScenario`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transactionScenario` (
    `transactionScenarioId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(256) NOT NULL,
    `description` varchar(1024) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
    PRIMARY KEY (`transactionScenarioId`),
    UNIQUE KEY `transactionscenario_name_unique` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transactionSubScenario`
  --
  
  DROP TABLE IF EXISTS `transactionSubScenario`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transactionSubScenario` (
    `transactionSubScenarioId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(256) NOT NULL,
    `description` varchar(1024) DEFAULT NULL COMMENT 'Possible sub-scenario, defined locally within the scheme',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'System dateTime stamp pertaining to the inserted record',
    PRIMARY KEY (`transactionSubScenarioId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transfer`
  --
  
  DROP TABLE IF EXISTS `transfer`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transfer` (
    `transferId` varchar(36) NOT NULL,
    `amount` decimal(18,4) NOT NULL,
    `currencyId` varchar(3) NOT NULL,
    `ilpCondition` varchar(256) NOT NULL,
    `expirationDate` datetime NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`transferId`),
    KEY `transfer_currencyid_index` (`currencyId`),
    CONSTRAINT `transfer_currencyid_foreign` FOREIGN KEY (`currencyId`) REFERENCES `currency` (`currencyid`),
    CONSTRAINT `transfer_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transferDuplicateCheck` (`transferid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transferDuplicateCheck`
  --
  
  DROP TABLE IF EXISTS `transferDuplicateCheck`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transferDuplicateCheck` (
    `transferId` varchar(36) NOT NULL,
    `hash` varchar(256) NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`transferId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transferError`
  --
  
  DROP TABLE IF EXISTS `transferError`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transferError` (
    `transferId` varchar(36) NOT NULL,
    `transferStateChangeId` bigint(20) unsigned NOT NULL,
    `errorCode` int(10) unsigned NOT NULL,
    `errorDescription` varchar(128) NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`transferId`),
    KEY `transfererror_transferstatechangeid_foreign` (`transferStateChangeId`),
    CONSTRAINT `transfererror_transferstatechangeid_foreign` FOREIGN KEY (`transferStateChangeId`) REFERENCES `transferStateChange` (`transferstatechangeid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transferErrorDuplicateCheck`
  --
  
  DROP TABLE IF EXISTS `transferErrorDuplicateCheck`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transferErrorDuplicateCheck` (
    `transferId` varchar(36) NOT NULL,
    `hash` varchar(256) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`transferId`),
    CONSTRAINT `transfererrorduplicatecheck_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transfer` (`transferid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transferExtension`
  --
  
  DROP TABLE IF EXISTS `transferExtension`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transferExtension` (
    `transferExtensionId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `transferId` varchar(36) NOT NULL,
    `key` varchar(128) NOT NULL,
    `value` text NOT NULL,
    `isFulfilment` tinyint(1) NOT NULL DEFAULT '0',
    `isError` tinyint(1) NOT NULL DEFAULT '0',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`transferExtensionId`),
    KEY `transferextension_transferid_foreign` (`transferId`),
    CONSTRAINT `transferextension_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transfer` (`transferid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transferFulfilment`
  --
  
  DROP TABLE IF EXISTS `transferFulfilment`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transferFulfilment` (
    `transferId` varchar(36) NOT NULL,
    `ilpFulfilment` varchar(256) DEFAULT NULL,
    `completedDate` datetime NOT NULL,
    `isValid` tinyint(1) DEFAULT NULL,
    `settlementWindowId` bigint(20) unsigned DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`transferId`),
    KEY `transferfulfilment_settlementwindowid_foreign` (`settlementWindowId`),
    CONSTRAINT `transferfulfilment_settlementwindowid_foreign` FOREIGN KEY (`settlementWindowId`) REFERENCES `settlementWindow` (`settlementwindowid`),
    CONSTRAINT `transferfulfilment_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transferFulfilmentDuplicateCheck` (`transferid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transferFulfilmentDuplicateCheck`
  --
  
  DROP TABLE IF EXISTS `transferFulfilmentDuplicateCheck`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transferFulfilmentDuplicateCheck` (
    `transferId` varchar(36) NOT NULL,
    `hash` varchar(256) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`transferId`),
    CONSTRAINT `transferfulfilmentduplicatecheck_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transfer` (`transferid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transferParticipant`
  --
  
  DROP TABLE IF EXISTS `transferParticipant`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transferParticipant` (
    `transferParticipantId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `transferId` varchar(36) NOT NULL,
    `participantCurrencyId` int(10) unsigned NOT NULL,
    `transferParticipantRoleTypeId` int(10) unsigned NOT NULL,
    `ledgerEntryTypeId` int(10) unsigned NOT NULL,
    `amount` decimal(18,4) NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `currentStateChangeId` bigint(20) unsigned DEFAULT NULL,
    PRIMARY KEY (`transferParticipantId`),
    KEY `transferparticipant_transferid_index` (`transferId`),
    KEY `transferparticipant_participantcurrencyid_index` (`participantCurrencyId`),
    KEY `transferparticipant_transferparticipantroletypeid_index` (`transferParticipantRoleTypeId`),
    KEY `transferparticipant_ledgerentrytypeid_index` (`ledgerEntryTypeId`),
    KEY `transferparticipant_currentstatechangeid_foreign` (`currentStateChangeId`),
    CONSTRAINT `transferparticipant_currentstatechangeid_foreign` FOREIGN KEY (`currentStateChangeId`) REFERENCES `transferParticipantStateChange` (`transferparticipantstatechangeid`),
    CONSTRAINT `transferparticipant_ledgerentrytypeid_foreign` FOREIGN KEY (`ledgerEntryTypeId`) REFERENCES `ledgerEntryType` (`ledgerentrytypeid`),
    CONSTRAINT `transferparticipant_participantcurrencyid_foreign` FOREIGN KEY (`participantCurrencyId`) REFERENCES `participantCurrency` (`participantcurrencyid`),
    CONSTRAINT `transferparticipant_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transfer` (`transferid`),
    CONSTRAINT `transferparticipant_transferparticipantroletypeid_foreign` FOREIGN KEY (`transferParticipantRoleTypeId`) REFERENCES `transferParticipantRoleType` (`transferparticipantroletypeid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transferParticipantRoleType`
  --
  
  DROP TABLE IF EXISTS `transferParticipantRoleType`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transferParticipantRoleType` (
    `transferParticipantRoleTypeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `description` varchar(512) DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`transferParticipantRoleTypeId`),
    UNIQUE KEY `transferparticipantroletype_name_unique` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transferParticipantStateChange`
  --
  
  DROP TABLE IF EXISTS `transferParticipantStateChange`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transferParticipantStateChange` (
    `transferParticipantStateChangeId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `transferParticipantId` bigint(20) unsigned NOT NULL,
    `settlementWindowStateId` varchar(50) NOT NULL,
    `reason` varchar(512) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`transferParticipantStateChangeId`),
    KEY `transferparticipantstatechange_transferparticipantid_index` (`transferParticipantId`),
    KEY `transferparticipantstatechange_settlementwindowstateid_index` (`settlementWindowStateId`),
    CONSTRAINT `transferparticipantstatechange_settlementwindowstateid_foreign` FOREIGN KEY (`settlementWindowStateId`) REFERENCES `settlementWindowState` (`settlementwindowstateid`),
    CONSTRAINT `transferparticipantstatechange_transferparticipantid_foreign` FOREIGN KEY (`transferParticipantId`) REFERENCES `transferParticipant` (`transferparticipantid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transferRules`
  --
  
  DROP TABLE IF EXISTS `transferRules`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transferRules` (
    `transferRulesId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(128) NOT NULL,
    `description` varchar(512) DEFAULT NULL,
    `rule` text NOT NULL,
    `enabled` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`transferRulesId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transferState`
  --
  
  DROP TABLE IF EXISTS `transferState`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transferState` (
    `transferStateId` varchar(50) NOT NULL,
    `enumeration` varchar(50) NOT NULL COMMENT 'transferState associated to the Mojaloop API',
    `description` varchar(512) DEFAULT NULL,
    `isActive` tinyint(1) NOT NULL DEFAULT '1',
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`transferStateId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transferStateChange`
  --
  
  DROP TABLE IF EXISTS `transferStateChange`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transferStateChange` (
    `transferStateChangeId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `transferId` varchar(36) NOT NULL,
    `transferStateId` varchar(50) NOT NULL,
    `reason` varchar(512) DEFAULT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`transferStateChangeId`),
    KEY `transferstatechange_transferid_index` (`transferId`),
    KEY `transferstatechange_transferstateid_index` (`transferStateId`),
    CONSTRAINT `transferstatechange_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transfer` (`transferid`),
    CONSTRAINT `transferstatechange_transferstateid_foreign` FOREIGN KEY (`transferStateId`) REFERENCES `transferState` (`transferstateid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `transferTimeout`
  --
  
  DROP TABLE IF EXISTS `transferTimeout`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `transferTimeout` (
    `transferTimeoutId` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `transferId` varchar(36) NOT NULL,
    `expirationDate` datetime NOT NULL,
    `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`transferTimeoutId`),
    UNIQUE KEY `transfertimeout_transferid_unique` (`transferId`),
    CONSTRAINT `transfertimeout_transferid_foreign` FOREIGN KEY (`transferId`) REFERENCES `transfer` (`transferid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Final view structure for view `quotePartyView`
  --
  
  /*!50001 DROP VIEW IF EXISTS `quotePartyView`*/;
  /*!50001 SET @saved_cs_client          = @@character_set_client */;
  /*!50001 SET @saved_cs_results         = @@character_set_results */;
  /*!50001 SET @saved_col_connection     = @@collation_connection */;
  /*!50001 SET character_set_client      = utf8 */;
  /*!50001 SET character_set_results     = utf8 */;
  /*!50001 SET collation_connection      = utf8_general_ci */;
  /*!50001 CREATE ALGORITHM=UNDEFINED */
  /*!50013 DEFINER=`central_ledger`@`%` SQL SECURITY DEFINER */
  /*!50001 VIEW `quotePartyView` AS select `qp`.`quoteId` AS `quoteId`,`qp`.`quotePartyId` AS `quotePartyId`,`pt`.`name` AS `partyType`,`pit`.`name` AS `identifierType`,`qp`.`partyIdentifierValue` AS `partyIdentifierValue`,`spit`.`name` AS `partySubIdOrType`,`qp`.`fspId` AS `fspId`,`qp`.`merchantClassificationCode` AS `merchantClassificationCode`,`qp`.`partyName` AS `partyName`,`p`.`firstName` AS `firstName`,`p`.`lastName` AS `lastName`,`p`.`middleName` AS `middleName`,`p`.`dateOfBirth` AS `dateOfBirth`,`gc`.`longitude` AS `longitude`,`gc`.`latitude` AS `latitude` from (((((`quoteParty` `qp` join `partyType` `pt` on((`pt`.`partyTypeId` = `qp`.`partyTypeId`))) join `partyIdentifierType` `pit` on((`pit`.`partyIdentifierTypeId` = `qp`.`partyIdentifierTypeId`))) left join `party` `p` on((`p`.`quotePartyId` = `qp`.`quotePartyId`))) left join `partyIdentifierType` `spit` on((`spit`.`partyIdentifierTypeId` = `qp`.`partySubIdOrTypeId`))) left join `geoCode` `gc` on((`gc`.`quotePartyId` = `qp`.`quotePartyId`))) */;
  /*!50001 SET character_set_client      = @saved_cs_client */;
  /*!50001 SET character_set_results     = @saved_cs_results */;
  /*!50001 SET collation_connection      = @saved_col_connection */;
  
  --
  -- Final view structure for view `quoteResponseView`
  --
  
  /*!50001 DROP VIEW IF EXISTS `quoteResponseView`*/;
  /*!50001 SET @saved_cs_client          = @@character_set_client */;
  /*!50001 SET @saved_cs_results         = @@character_set_results */;
  /*!50001 SET @saved_col_connection     = @@collation_connection */;
  /*!50001 SET character_set_client      = utf8 */;
  /*!50001 SET character_set_results     = utf8 */;
  /*!50001 SET collation_connection      = utf8_general_ci */;
  /*!50001 CREATE ALGORITHM=UNDEFINED */
  /*!50013 DEFINER=`central_ledger`@`%` SQL SECURITY DEFINER */
  /*!50001 VIEW `quoteResponseView` AS select `qr`.`quoteResponseId` AS `quoteResponseId`,`qr`.`quoteId` AS `quoteId`,`qr`.`transferAmountCurrencyId` AS `transferAmountCurrencyId`,`qr`.`transferAmount` AS `transferAmount`,`qr`.`payeeReceiveAmountCurrencyId` AS `payeeReceiveAmountCurrencyId`,`qr`.`payeeReceiveAmount` AS `payeeReceiveAmount`,`qr`.`payeeFspFeeCurrencyId` AS `payeeFspFeeCurrencyId`,`qr`.`payeeFspFeeAmount` AS `payeeFspFeeAmount`,`qr`.`payeeFspCommissionCurrencyId` AS `payeeFspCommissionCurrencyId`,`qr`.`payeeFspCommissionAmount` AS `payeeFspCommissionAmount`,`qr`.`ilpCondition` AS `ilpCondition`,`qr`.`responseExpirationDate` AS `responseExpirationDate`,`qr`.`isValid` AS `isValid`,`qr`.`createdDate` AS `createdDate`,`qrilp`.`value` AS `ilpPacket`,`gc`.`longitude` AS `longitude`,`gc`.`latitude` AS `latitude` from ((((`quoteResponse` `qr` join `quoteResponseIlpPacket` `qrilp` on((`qrilp`.`quoteResponseId` = `qr`.`quoteResponseId`))) join `quoteParty` `qp` on((`qp`.`quoteId` = `qr`.`quoteId`))) join `partyType` `pt` on((`pt`.`partyTypeId` = `qp`.`partyTypeId`))) left join `geoCode` `gc` on((`gc`.`quotePartyId` = `qp`.`quotePartyId`))) where (`pt`.`name` = 'PAYEE') */;
  /*!50001 SET character_set_client      = @saved_cs_client */;
  /*!50001 SET character_set_results     = @saved_cs_results */;
  /*!50001 SET collation_connection      = @saved_col_connection */;
  
  --
  -- Final view structure for view `quoteView`
  --
  
  /*!50001 DROP VIEW IF EXISTS `quoteView`*/;
  /*!50001 SET @saved_cs_client          = @@character_set_client */;
  /*!50001 SET @saved_cs_results         = @@character_set_results */;
  /*!50001 SET @saved_col_connection     = @@collation_connection */;
  /*!50001 SET character_set_client      = utf8 */;
  /*!50001 SET character_set_results     = utf8 */;
  /*!50001 SET collation_connection      = utf8_general_ci */;
  /*!50001 CREATE ALGORITHM=UNDEFINED */
  /*!50013 DEFINER=`central_ledger`@`%` SQL SECURITY DEFINER */
  /*!50001 VIEW `quoteView` AS select `q`.`quoteId` AS `quoteId`,`q`.`transactionReferenceId` AS `transactionReferenceId`,`q`.`transactionRequestId` AS `transactionRequestId`,`q`.`note` AS `note`,`q`.`expirationDate` AS `expirationDate`,`ti`.`name` AS `transactionInitiator`,`tit`.`name` AS `transactionInitiatorType`,`ts`.`name` AS `transactionScenario`,`q`.`balanceOfPaymentsId` AS `balanceOfPaymentsId`,`tss`.`name` AS `transactionSubScenario`,`amt`.`name` AS `amountType`,`q`.`amount` AS `amount`,`q`.`currencyId` AS `currency` from (((((`quote` `q` join `transactionInitiator` `ti` on((`ti`.`transactionInitiatorId` = `q`.`transactionInitiatorId`))) join `transactionInitiatorType` `tit` on((`tit`.`transactionInitiatorTypeId` = `q`.`transactionInitiatorTypeId`))) join `transactionScenario` `ts` on((`ts`.`transactionScenarioId` = `q`.`transactionScenarioId`))) join `amountType` `amt` on((`amt`.`amountTypeId` = `q`.`amountTypeId`))) left join `transactionSubScenario` `tss` on((`tss`.`transactionSubScenarioId` = `q`.`transactionSubScenarioId`))) */;
  /*!50001 SET character_set_client      = @saved_cs_client */;
  /*!50001 SET character_set_results     = @saved_cs_results */;
  /*!50001 SET collation_connection      = @saved_col_connection */;
  /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
  
  /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  
  -- Dump completed on 2020-02-20 22:51:43
  