DROP TABLE if exists saas_app_data_source;

CREATE TABLE `saas_app_data_source` (
  `id` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '主键',
  `micro_service_id` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '微服务',
  `data_source_cluster_id` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '数据源集群',
  `created_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建人',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '更新人',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_app_data_source` (`micro_service_id`,`data_source_cluster_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='微服务与数据源关系';

