--
-- Host: 0    Database: mysql_innodb_cluster_metadata
-- ------------------------------------------------------

SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN;

--
-- Table structure for table `clusters`
--

CREATE TABLE `clusters` (
  `cluster_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `cluster_name` varchar(40) NOT NULL,
  `default_replicaset` int(10) unsigned DEFAULT NULL,
  `description` text,
  `mysql_user_accounts` blob,
  `options` json DEFAULT NULL,
  `attributes` json DEFAULT NULL,
  PRIMARY KEY (`cluster_id`),
  UNIQUE KEY `cluster_name` (`cluster_name`),
  KEY `default_replicaset` (`default_replicaset`),
  CONSTRAINT `clusters_ibfk_1` FOREIGN KEY (`default_replicaset`) REFERENCES `replicasets` (`replicaset_id`) ON DELETE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `clusters`
--

INSERT INTO `clusters` VALUES (1,'mycluster',1,'Default Cluster',NULL,'null','{\"default\": true, \"opt_gtidSetIsComplete\": false}');

--
-- Table structure for table `hosts`
--

CREATE TABLE `hosts` (
  `host_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `host_name` varchar(256) DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `public_ip_address` varchar(45) DEFAULT NULL,
  `location` varchar(256) NOT NULL,
  `attributes` json DEFAULT NULL,
  `admin_user_account` json DEFAULT NULL,
  PRIMARY KEY (`host_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `hosts`
--

INSERT INTO `hosts` VALUES (1,'127.0.0.1','',NULL,'',NULL,NULL);

--
-- Table structure for table `replicasets`
--

CREATE TABLE `replicasets` (
  `replicaset_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `cluster_id` int(10) unsigned NOT NULL,
  `replicaset_type` enum('gr') NOT NULL,
  `topology_type` enum('pm','mm') NOT NULL DEFAULT 'pm',
  `replicaset_name` varchar(40) NOT NULL,
  `active` tinyint(1) NOT NULL,
  `attributes` json DEFAULT NULL,
  `description` text,
  PRIMARY KEY (`replicaset_id`),
  KEY `cluster_id` (`cluster_id`),
  CONSTRAINT `replicasets_ibfk_1` FOREIGN KEY (`cluster_id`) REFERENCES `clusters` (`cluster_id`) ON DELETE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `replicasets`
--

INSERT INTO `replicasets` VALUES (1,1,'gr','pm','default',1,'{\"adopted\": \"0\", \"group_replication_group_name\": \"db7a793c-db3c-11e9-ae29-e6f1064a5f02\"}',NULL);

--
-- Table structure for table `routers`
--

CREATE TABLE `routers` (
  `router_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `router_name` varchar(256) NOT NULL,
  `host_id` int(10) unsigned NOT NULL,
  `attributes` json DEFAULT NULL,
  PRIMARY KEY (`router_id`),
  UNIQUE KEY `host_id` (`host_id`,`router_name`),
  CONSTRAINT `routers_ibfk_1` FOREIGN KEY (`host_id`) REFERENCES `hosts` (`host_id`) ON DELETE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `routers`
--


--
-- Temporary view structure for view `schema_version`
--

/*!50001 DROP VIEW IF EXISTS `schema_version`*/;
/*!50001 CREATE VIEW `schema_version` AS SELECT 
 1 AS `major`,
 1 AS `minor`,
 1 AS `patch`*/;

--
-- Final view structure for view `schema_version`
--

/*!50001 DROP VIEW IF EXISTS `schema_version`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `schema_version` (`major`,`minor`,`patch`) AS select 1 AS `1`,0 AS `0`,1 AS `1` */;


