1.add h2 db migration file directory
diff --git a/adapter/persistence/src/main/resources/db/h2-migration/V1__baseline.sql b/adapter/persistence/src/main/resources/db/h2-migration/V1__baseline.sql
new file mode 100644
index 0000000..3909293
--- /dev/null
+++ b/adapter/persistence/src/main/resources/db/h2-migration/V1__baseline.sql
@@ -0,0 +1,165 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+CREATE TABLE IF NOT EXISTS `event_bus` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) NOT NULL COMMENT 'bus account id',
+ `name` varchar(255) NOT NULL COMMENT 'bus name',
+ `description` varchar(256) DEFAULT NULL COMMENT 'bus description',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key_event_bus` (`account_id`,`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `event_topic` (
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) DEFAULT 'SYSTEM' COMMENT 'source account id',
+ `bus` varchar(255) NOT NULL COMMENT 'bus name',
+ `name` varchar(255) NOT NULL COMMENT 'topic name',
+ `msg_ttl` int(11) NOT NULL COMMENT 'msg ttl',
+ `cluster` varchar(255) NOT NULL COMMENT 'the cluster of topic',
+ `status` tinyint(4) NOT NULL COMMENT '0:disable, 1:enable',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key_event_topicdd` (`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `event_source` (
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) DEFAULT 'SYSTEM' COMMENT 'source account id',
+ `bus` varchar(255) NOT NULL COMMENT 'bus name',
+ `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'source name',
+ `status` int(11) NOT NULL DEFAULT '0' COMMENT '0:disable, 1:enable',
+ `type` int(11) NOT NULL DEFAULT '1' COMMENT 'event source type',
+ `class_name` varchar(255) COMMENT 'event source class name',
+ `config` text COMMENT 'event source runner config',
+ `description` varchar(1024) DEFAULT NULL COMMENT 'event source description',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key_event_source` (`account_id`,`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+;
+
+CREATE TABLE IF NOT EXISTS `event_type` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) NOT NULL COMMENT 'bus account id',
+ `bus` varchar(255) NOT NULL COMMENT 'bus name',
+ `source` varchar(255) NOT NULL DEFAULT '' COMMENT 'event source name',
+ `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'event type name',
+ `description` varchar(255) DEFAULT NULL COMMENT 'a description about the event type',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key_event_type` (`source`,`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+;
+
+CREATE TABLE IF NOT EXISTS `event_rule` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) NOT NULL COMMENT 'bus account id',
+ `bus` varchar(255) NOT NULL COMMENT 'bus name',
+ `name` varchar(255) NOT NULL COMMENT 'rule name',
+ `filter_pattern` varchar(4096) DEFAULT NULL COMMENT 'event filter pattern',
+ `status` tinyint(4) NOT NULL COMMENT '0:disable, 1:enable',
+ `description` varchar(255) DEFAULT NULL COMMENT 'a description about the event rule',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ UNIQUE KEY `id` (`id`),
+ UNIQUE KEY `name_uniq_key_event_rule` (`account_id`,`name`,`bus`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+;
+
+CREATE TABLE IF NOT EXISTS `event_source_runner` (
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) DEFAULT 'SYSTEM' COMMENT 'source account id',
+ `bus` varchar(255) NOT NULL COMMENT 'bus name',
+ `source` varchar(255) NOT NULL DEFAULT '' COMMENT 'source name',
+ `run_options` varchar(1024) DEFAULT NULL COMMENT 'event source runner options',
+ `run_context` varchar(1024) DEFAULT NULL COMMENT 'event source running context',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key_event_source_runner` (`account_id`,`bus`,`source`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+;
+
+CREATE TABLE IF NOT EXISTS `event_target` (
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) DEFAULT 'SYSTEM' COMMENT 'target account id',
+ `bus` varchar(255) NOT NULL COMMENT 'bus name',
+ `rule` varchar(255) NOT NULL DEFAULT '' COMMENT 'rule name',
+ `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'target name',
+ `class_name` varchar(255) NOT NULL COMMENT 'event target class name',
+ `config` text NOT NULL COMMENT 'event target runner config',
+ `run_options` varchar(1024) DEFAULT NULL COMMENT 'event target runner options',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key_event_target` (`account_id`,`bus`,`rule`,`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+;
+
+
+
+CREATE TABLE IF NOT EXISTS `event_target_runner` (
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) DEFAULT 'SYSTEM' COMMENT 'target account id',
+ `bus` varchar(255) NOT NULL COMMENT 'bus name',
+ `rule` varchar(255) NOT NULL DEFAULT '' COMMENT 'rule name',
+ `target` varchar(255) NOT NULL DEFAULT '' COMMENT 'target name',
+ `run_context` varchar(1024) DEFAULT NULL COMMENT 'event target running context',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key_event_target_runner` (`account_id`,`bus`,`rule`,`target`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+;
+
+
+CREATE TABLE IF NOT EXISTS `event_source_class` (
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'source class name',
+ `api_params` text NOT NULL COMMENT 'event source api params',
+ `required_params` text NOT NULL COMMENT 'event source required params',
+ `transform` text NOT NULL COMMENT 'transform the event source data',
+ `visual_config` text DEFAULT NULL COMMENT 'event source fore-end visual config',
+ `description` varchar(255) DEFAULT NULL COMMENT 'a description about the source class',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key_event_source_class` (`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+;
+
+
+CREATE TABLE IF NOT EXISTS `event_target_class` (
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'target class name',
+ `api_params` text NOT NULL COMMENT 'event target api params',
+ `target_transform` text NOT NULL COMMENT 'event target required data',
+ `required_params` text NOT NULL COMMENT 'event target required params',
+ `visual_config` text DEFAULT NULL COMMENT 'event target fore-end visual config',
+ `description` varchar(255) DEFAULT NULL COMMENT 'a description about the target class',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key_event_target_class` (`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+;
diff --git a/adapter/persistence/src/main/resources/db/h2-migration/V2__baseline.sql b/adapter/persistence/src/main/resources/db/h2-migration/V2__baseline.sql
new file mode 100644
index 0000000..c70912c
--- /dev/null
+++ b/adapter/persistence/src/main/resources/db/h2-migration/V2__baseline.sql
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+CREATE TABLE IF NOT EXISTS `event_connection` (
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) NOT NULL COMMENT 'event_connection account id',
+ `name` varchar(128) NOT NULL DEFAULT '' COMMENT '名称',
+ `authorization_type` varchar(128) DEFAULT NULL COMMENT '授权类型',
+ `auth_parameters` text DEFAULT NULL COMMENT '',
+ `network_type` varchar(128) NOT NULL DEFAULT '' COMMENT '网络类型',
+ `network_parameters` text DEFAULT NULL COMMENT '网络配置',
+ `description` varchar(255) DEFAULT NULL COMMENT 'a description about the event_connection',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key_event_connection` (`name`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8
+;
+
+
+CREATE TABLE IF NOT EXISTS `event_api_destination` (
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) NOT NULL COMMENT 'event_api_destination account id',
+ `name` varchar(128) NOT NULL DEFAULT '' COMMENT '名称',
+ `protocol` varchar(128) NOT NULL DEFAULT '' COMMENT '类型',
+ `api_params` text NOT NULL COMMENT 'API 参数',
+ `connection_name` varchar(128) DEFAULT NULL COMMENT '连接信息',
+ `invocation_rate_limit_per_second` int(11) COMMENT '每秒推送速率',
+ `description` varchar(255) DEFAULT NULL COMMENT 'a description about the event_api_destination',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key_event_api_destination` (`name`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8
+;
diff --git a/adapter/persistence/src/main/resources/db/h2-migration/V3__change_target_transform_type.sql b/adapter/persistence/src/main/resources/db/h2-migration/V3__change_target_transform_type.sql
new file mode 100644
index 0000000..b2a18c2
--- /dev/null
+++ b/adapter/persistence/src/main/resources/db/h2-migration/V3__change_target_transform_type.sql
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ALTER TABLE `event_target_class`
+CHANGE COLUMN `target_transform` `target_transform` TEXT NULL DEFAULT NULL ;
diff --git a/adapter/persistence/src/main/resources/db/h2-migration/V4__register_source_acs_mns.sql b/adapter/persistence/src/main/resources/db/h2-migration/V4__register_source_acs_mns.sql
new file mode 100644
index 0000000..1ad499a
--- /dev/null
+++ b/adapter/persistence/src/main/resources/db/h2-migration/V4__register_source_acs_mns.sql
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+INSERT INTO `event_source_class` (`name`,`api_params`,`required_params`,`transform`,`visual_config`,`description`,`gmt_create`,`gmt_modify`) VALUES ('acs.mns','{\n \"RegionId\":{\n \"type\":\"String\",\n \"desc\":\"the region of aliyun mns.\",\n \"required\":true,\n \"defaultValue\":\"\"\n },\n \"QueueName\":{\n \"type\":\"String\",\n \"desc\":\"the queue name of aliyun mns.\",\n \"required\":true,\n \"defaultValue\":\"\"\n },\n \"IsBase64Decode\":{\n \"type\":\"boolean\",\n \"desc\":\"base64 decode or not\"\n },\n \"AliyunAccountId\":{\n \"type\":\"String\",\n \"desc\":\"the account id of aliyun mns.\",\n \"required\":true\n },\n \"AccessKeyId\":{\n \"type\":\"String\",\n \"desc\":\"the access key id of aliyun mns.\",\n \"required\":true\n },\n \"AccessKeySecret\":{\n \"type\":\"String\",\n \"desc\":\"the access key idsecret of aliyun mns.\",\n \"required\":true\n }\n}','{\n \"accountEndpoint\":\"http://${AliyunAccountId}.mns.${RegionId}.aliyuncs.com\",\n \"accountId\":\"${AliyunAccountId}\",\n \"queueName\":\"${QueueName}\",\n \"isBase64Decode\":\"${IsBase64Decode}\",\n \"accessKeyId\":\"${AccessKeyId}\",\n \"accessKeySecret\":\"${AccessKeySecret}\",\n \"class\":\"org.apache.rocketmq.connect.mns.source.MNSSourceConnector\"\n}','{\n \"data\":\"{\\\"value\\\":\\\"$.data\\\",\\\"form\\\":\\\"JSONPATH\\\"}\",\n \"subject\":\"{\\\"value\\\":\\\"acs:mns:${RegionId}:${AliyunAccountId}:queues/${QueueName}\\\",\\\"form\\\":\\\"CONSTANT\\\"}\",\n \"type\":\"{\\\"value\\\":\\\"mns.sendMsg\\\",\\\"form\\\":\\\"CONSTANT\\\"}\"\n}',NULL,'aliyun mns source',now(),now());
diff --git a/adapter/persistence/src/main/resources/db/h2-migration/V5__register_target_acs_dingtalk.sql b/adapter/persistence/src/main/resources/db/h2-migration/V5__register_target_acs_dingtalk.sql
new file mode 100644
index 0000000..1d8a643
--- /dev/null
+++ b/adapter/persistence/src/main/resources/db/h2-migration/V5__register_target_acs_dingtalk.sql
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+INSERT INTO `event_target_class` (`name`,`api_params`,`target_transform`,`required_params`,`visual_config`,`description`,`gmt_create`,`gmt_modify`)
+VALUES
+('acs.dingtalk','{\n \"WebHook\":{\n \"type\":\"String\",\n \"desc\":\"the endpoint of webhook.\",\n \"required\":true\n },\n \"SecretKey\":{\n \"type\":\"String\",\n \"desc\":\"the secret key.\",\n \"required\":true\n },\n \"Body\":{\n \"type\":\"boolean\",\n \"desc\":\"the content of request\"\n }\n}','{ \"data\":\"${Body}\" }','{\n \"webHook\":\"${WebHook}\",\n \"secretKey\":\"${SecretKey}\",\n \"class\":\"org.apache.rocketmq.connect.dingtalk.sink.DingTalkSinkConnector\"\n}',NULL,'aliyun dingtalk connector config',now(),now());
\ No newline at end of file
diff --git a/adapter/persistence/src/main/resources/db/h2-migration/V6__register_target_acs_eventbridge.sql b/adapter/persistence/src/main/resources/db/h2-migration/V6__register_target_acs_eventbridge.sql
new file mode 100644
index 0000000..b7587a0
--- /dev/null
+++ b/adapter/persistence/src/main/resources/db/h2-migration/V6__register_target_acs_eventbridge.sql
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+INSERT INTO `event_target_class` (`name`,`api_params`,`target_transform`,`required_params`,`visual_config`,`description`,`gmt_create`,`gmt_modify`)
+VALUES
+('acs.eventbridge','{\n \"RegionId\":{\n \"type\":\"String\",\n \"desc\":\"the region of aliyun eventbridge.\",\n \"required\":true\n },\n \"AliyunAccountId\":{\n \"type\":\"String\",\n \"desc\":\"the account id of aliyun eventbridge.\",\n \"required\":true\n },\n \"AliyunEventBus\":{\n \"type\":\"String\",\n \"desc\":\"the bus of aliyun eventbridge.\",\n \"required\":true\n },\n \"AccessKeyId\":{\n \"type\":\"String\",\n \"desc\":\"the accessKeyId of aliyun eventbridge.\",\n \"required\":true\n },\n \"AccessKeySecret\":{\n \"type\":\"String\",\n \"desc\":\"the accessKeySecret of aliyun eventbridge.\",\n \"required\":true\n }\n}','{\n \"data\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$.data\\\"}\",\n \"id\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$.id\\\"}\",\n \"type\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$.type\\\"}\",\n \"specversion\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$. specversion\\\"}\",\n \"subject\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$.subject\\\"}\",\n \"source\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$.source\\\"}\"\n}','{\n \"aliyuneventbusname\":\"${AliyunEventBus}\",\n \"accessKeyId\":\"${AccessKeyId}\",\n \"accessKeySecret\":\"${AccessKeySecret}\",\n \"accountEndpoint\":\"${AliyunAccountId}.eventbridge.${RegionId}.aliyuncs.com\",\n \"class\":\"org.apache.rocketmq.connect.eventbridge.sink.EventBridgeSinkConnector\"\n}',NULL,'aliyun eventbridge connector config',now(),now());
diff --git a/adapter/persistence/src/main/resources/db/h2-migration/V7__update_event_connection_table_structure.sql b/adapter/persistence/src/main/resources/db/h2-migration/V7__update_event_connection_table_structure.sql
new file mode 100644
index 0000000..e98bbf0
--- /dev/null
+++ b/adapter/persistence/src/main/resources/db/h2-migration/V7__update_event_connection_table_structure.sql
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+--ALTER TABLE `event_connection` MODIFY COLUMN `authorization_type` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '授权类型' AFTER `name`;
+--ALTER TABLE `event_connection` MODIFY COLUMN `auth_parameters` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `authorization_type`;
\ No newline at end of file
diff --git a/adapter/persistence/src/main/resources/db/h2-migration/V8__update_unique_key.sql b/adapter/persistence/src/main/resources/db/h2-migration/V8__update_unique_key.sql
new file mode 100644
index 0000000..2e9098e
--- /dev/null
+++ b/adapter/persistence/src/main/resources/db/h2-migration/V8__update_unique_key.sql
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ALTER TABLE `event_connection` DROP INDEX `name_uniq_key_event_connection`;
+ALTER TABLE `event_connection` ADD UNIQUE INDEX `name_uniq_key_event_connection`(`name`, `account_id`) USING BTREE;
+
+ALTER TABLE `event_api_destination` DROP INDEX `name_uniq_key_event_api_destination`;
+ALTER TABLE `event_api_destination` ADD UNIQUE INDEX `name_uniq_key_event_api_destination`(`name`, `account_id`) USING BTREE;
\ No newline at end of file
diff --git a/adapter/persistence/src/main/resources/db/migration/V1__baseline.sql b/adapter/persistence/src/main/resources/db/migration/V1__baseline.sql
index 3909293..e301d56 100644
--- a/adapter/persistence/src/main/resources/db/migration/V1__baseline.sql
+++ b/adapter/persistence/src/main/resources/db/migration/V1__baseline.sql
@@ -1,19 +1,17 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
CREATE TABLE IF NOT EXISTS `event_bus` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
@@ -23,143 +21,145 @@
`gmt_create` datetime DEFAULT NULL COMMENT 'create time',
`gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
PRIMARY KEY (`id`),
- UNIQUE KEY `name_uniq_key_event_bus` (`account_id`,`name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ UNIQUE KEY `name_uniq_key` (`account_id`,`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='event bus meta'
+;
-CREATE TABLE IF NOT EXISTS `event_topic` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `account_id` varchar(255) DEFAULT 'SYSTEM' COMMENT 'source account id',
- `bus` varchar(255) NOT NULL COMMENT 'bus name',
- `name` varchar(255) NOT NULL COMMENT 'topic name',
- `msg_ttl` int(11) NOT NULL COMMENT 'msg ttl',
- `cluster` varchar(255) NOT NULL COMMENT 'the cluster of topic',
- `status` tinyint(4) NOT NULL COMMENT '0:disable, 1:enable',
- `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
- `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
- PRIMARY KEY (`id`),
- UNIQUE KEY `name_uniq_key_event_topicdd` (`name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE TABLE `event_topic` (
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) DEFAULT 'SYSTEM' COMMENT 'source account id',
+ `bus` varchar(255) NOT NULL COMMENT 'bus name',
+ `name` varchar(255) NOT NULL COMMENT 'topic name',
+ `msg_ttl` int(11) NOT NULL COMMENT 'msg ttl',
+ `cluster` varchar(255) NOT NULL COMMENT 'the cluster of topic',
+ `status` tinyint(4) NOT NULL COMMENT '0:disable, 1:enable',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key` (`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+;
CREATE TABLE IF NOT EXISTS `event_source` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `account_id` varchar(255) DEFAULT 'SYSTEM' COMMENT 'source account id',
- `bus` varchar(255) NOT NULL COMMENT 'bus name',
- `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'source name',
- `status` int(11) NOT NULL DEFAULT '0' COMMENT '0:disable, 1:enable',
- `type` int(11) NOT NULL DEFAULT '1' COMMENT 'event source type',
- `class_name` varchar(255) COMMENT 'event source class name',
- `config` text COMMENT 'event source runner config',
- `description` varchar(1024) DEFAULT NULL COMMENT 'event source description',
- `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
- `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
- PRIMARY KEY (`id`),
- UNIQUE KEY `name_uniq_key_event_source` (`account_id`,`name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) DEFAULT 'SYSTEM' COMMENT 'source account id',
+ `bus` varchar(255) NOT NULL COMMENT 'bus name',
+ `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'source name',
+ `status` int(11) NOT NULL DEFAULT '0' COMMENT '0:disable, 1:enable',
+ `type` int(11) NOT NULL DEFAULT '1' COMMENT 'event source type',
+ `class_name` varchar(255) COMMENT 'event source class name',
+ `config` text COMMENT 'event source runner config',
+ `description` varchar(1024) DEFAULT NULL COMMENT 'event source description',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key` (`account_id`,`name`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='event source meta'
;
CREATE TABLE IF NOT EXISTS `event_type` (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
- `account_id` varchar(255) NOT NULL COMMENT 'bus account id',
- `bus` varchar(255) NOT NULL COMMENT 'bus name',
- `source` varchar(255) NOT NULL DEFAULT '' COMMENT 'event source name',
- `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'event type name',
- `description` varchar(255) DEFAULT NULL COMMENT 'a description about the event type',
- `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
- `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
- PRIMARY KEY (`id`),
- UNIQUE KEY `name_uniq_key_event_type` (`source`,`name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) NOT NULL COMMENT 'bus account id',
+ `bus` varchar(255) NOT NULL COMMENT 'bus name',
+ `source` varchar(255) NOT NULL DEFAULT '' COMMENT 'event source name',
+ `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'event type name',
+ `description` varchar(255) DEFAULT NULL COMMENT 'a description about the event type',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key` (`source`,`name`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='event type meta'
;
CREATE TABLE IF NOT EXISTS `event_rule` (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
- `account_id` varchar(255) NOT NULL COMMENT 'bus account id',
- `bus` varchar(255) NOT NULL COMMENT 'bus name',
- `name` varchar(255) NOT NULL COMMENT 'rule name',
- `filter_pattern` varchar(4096) DEFAULT NULL COMMENT 'event filter pattern',
- `status` tinyint(4) NOT NULL COMMENT '0:disable, 1:enable',
- `description` varchar(255) DEFAULT NULL COMMENT 'a description about the event rule',
- `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
- `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
- UNIQUE KEY `id` (`id`),
- UNIQUE KEY `name_uniq_key_event_rule` (`account_id`,`name`,`bus`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) NOT NULL COMMENT 'bus account id',
+ `bus` varchar(255) NOT NULL COMMENT 'bus name',
+ `name` varchar(255) NOT NULL COMMENT 'rule name',
+ `filter_pattern` varchar(4096) DEFAULT NULL COMMENT 'event filter pattern',
+ `status` tinyint(4) NOT NULL COMMENT '0:disable, 1:enable',
+ `description` varchar(255) DEFAULT NULL COMMENT 'a description about the event rule',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ UNIQUE KEY `id` (`id`),
+ UNIQUE KEY `name_uniq_key` (`account_id`,`name`,`bus`)
+ ) ENGINE=InnoDB AUTO_INCREMENT=51815 DEFAULT CHARSET=utf8 COMMENT='event rule meta'
;
CREATE TABLE IF NOT EXISTS `event_source_runner` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `account_id` varchar(255) DEFAULT 'SYSTEM' COMMENT 'source account id',
- `bus` varchar(255) NOT NULL COMMENT 'bus name',
- `source` varchar(255) NOT NULL DEFAULT '' COMMENT 'source name',
- `run_options` varchar(1024) DEFAULT NULL COMMENT 'event source runner options',
- `run_context` varchar(1024) DEFAULT NULL COMMENT 'event source running context',
- `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
- `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
- PRIMARY KEY (`id`),
- UNIQUE KEY `name_uniq_key_event_source_runner` (`account_id`,`bus`,`source`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) DEFAULT 'SYSTEM' COMMENT 'source account id',
+ `bus` varchar(255) NOT NULL COMMENT 'bus name',
+ `source` varchar(255) NOT NULL DEFAULT '' COMMENT 'source name',
+ `run_options` varchar(1024) DEFAULT NULL COMMENT 'event source runner options',
+ `run_context` varchar(1024) DEFAULT NULL COMMENT 'event source running context',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key` (`account_id`,`bus`,`source`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='event source runner meta'
;
CREATE TABLE IF NOT EXISTS `event_target` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `account_id` varchar(255) DEFAULT 'SYSTEM' COMMENT 'target account id',
- `bus` varchar(255) NOT NULL COMMENT 'bus name',
- `rule` varchar(255) NOT NULL DEFAULT '' COMMENT 'rule name',
- `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'target name',
- `class_name` varchar(255) NOT NULL COMMENT 'event target class name',
- `config` text NOT NULL COMMENT 'event target runner config',
- `run_options` varchar(1024) DEFAULT NULL COMMENT 'event target runner options',
- `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
- `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
- PRIMARY KEY (`id`),
- UNIQUE KEY `name_uniq_key_event_target` (`account_id`,`bus`,`rule`,`name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) DEFAULT 'SYSTEM' COMMENT 'target account id',
+ `bus` varchar(255) NOT NULL COMMENT 'bus name',
+ `rule` varchar(255) NOT NULL DEFAULT '' COMMENT 'rule name',
+ `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'target name',
+ `class_name` varchar(255) NOT NULL COMMENT 'event target class name',
+ `config` text NOT NULL COMMENT 'event target runner config',
+ `run_options` varchar(1024) DEFAULT NULL COMMENT 'event target runner options',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key` (`account_id`,`bus`,`rule`,`name`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='event target meta'
;
CREATE TABLE IF NOT EXISTS `event_target_runner` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `account_id` varchar(255) DEFAULT 'SYSTEM' COMMENT 'target account id',
- `bus` varchar(255) NOT NULL COMMENT 'bus name',
- `rule` varchar(255) NOT NULL DEFAULT '' COMMENT 'rule name',
- `target` varchar(255) NOT NULL DEFAULT '' COMMENT 'target name',
- `run_context` varchar(1024) DEFAULT NULL COMMENT 'event target running context',
- `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
- `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
- PRIMARY KEY (`id`),
- UNIQUE KEY `name_uniq_key_event_target_runner` (`account_id`,`bus`,`rule`,`target`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `account_id` varchar(255) DEFAULT 'SYSTEM' COMMENT 'target account id',
+ `bus` varchar(255) NOT NULL COMMENT 'bus name',
+ `rule` varchar(255) NOT NULL DEFAULT '' COMMENT 'rule name',
+ `target` varchar(255) NOT NULL DEFAULT '' COMMENT 'target name',
+ `run_context` varchar(1024) DEFAULT NULL COMMENT 'event target running context',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key` (`account_id`,`bus`,`rule`,`target`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='event target runner meta'
;
CREATE TABLE IF NOT EXISTS `event_source_class` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'source class name',
- `api_params` text NOT NULL COMMENT 'event source api params',
- `required_params` text NOT NULL COMMENT 'event source required params',
- `transform` text NOT NULL COMMENT 'transform the event source data',
- `visual_config` text DEFAULT NULL COMMENT 'event source fore-end visual config',
- `description` varchar(255) DEFAULT NULL COMMENT 'a description about the source class',
- `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
- `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
- PRIMARY KEY (`id`),
- UNIQUE KEY `name_uniq_key_event_source_class` (`name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'source class name',
+ `api_params` text NOT NULL COMMENT 'event source api params',
+ `required_params` text NOT NULL COMMENT 'event source required params',
+ `transform` text NOT NULL COMMENT 'transform the event source data',
+ `visual_config` text DEFAULT NULL COMMENT 'event source fore-end visual config',
+ `description` varchar(255) DEFAULT NULL COMMENT 'a description about the source class',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key` (`name`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='event source class meta'
;
CREATE TABLE IF NOT EXISTS `event_target_class` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'target class name',
- `api_params` text NOT NULL COMMENT 'event target api params',
- `target_transform` text NOT NULL COMMENT 'event target required data',
- `required_params` text NOT NULL COMMENT 'event target required params',
- `visual_config` text DEFAULT NULL COMMENT 'event target fore-end visual config',
- `description` varchar(255) DEFAULT NULL COMMENT 'a description about the target class',
- `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
- `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
- PRIMARY KEY (`id`),
- UNIQUE KEY `name_uniq_key_event_target_class` (`name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
-;
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'target class name',
+ `api_params` text NOT NULL COMMENT 'event target api params',
+ `target_transform` text NOT NULL COMMENT 'event target required data',
+ `required_params` text NOT NULL COMMENT 'event target required params',
+ `visual_config` text DEFAULT NULL COMMENT 'event target fore-end visual config',
+ `description` varchar(255) DEFAULT NULL COMMENT 'a description about the target class',
+ `gmt_create` datetime DEFAULT NULL COMMENT 'create time',
+ `gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name_uniq_key` (`name`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='event target class meta'
+;
\ No newline at end of file
diff --git a/adapter/persistence/src/main/resources/db/migration/V2__baseline.sql b/adapter/persistence/src/main/resources/db/migration/V2__baseline.sql
index c70912c..a8a8c62 100644
--- a/adapter/persistence/src/main/resources/db/migration/V2__baseline.sql
+++ b/adapter/persistence/src/main/resources/db/migration/V2__baseline.sql
@@ -1,19 +1,17 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
CREATE TABLE IF NOT EXISTS `event_connection` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
@@ -27,8 +25,8 @@
`gmt_create` datetime DEFAULT NULL COMMENT 'create time',
`gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
PRIMARY KEY (`id`),
- UNIQUE KEY `name_uniq_key_event_connection` (`name`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8
+ UNIQUE KEY `name_uniq_key` (`name`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='event connection meta'
;
@@ -44,6 +42,6 @@
`gmt_create` datetime DEFAULT NULL COMMENT 'create time',
`gmt_modify` datetime DEFAULT NULL COMMENT 'modify time',
PRIMARY KEY (`id`),
- UNIQUE KEY `name_uniq_key_event_api_destination` (`name`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8
-;
+ UNIQUE KEY `name_uniq_key` (`name`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='event api destination meta'
+;
\ No newline at end of file
diff --git a/adapter/persistence/src/main/resources/db/migration/V3__change_target_transform_type.sql b/adapter/persistence/src/main/resources/db/migration/V3__change_target_transform_type.sql
index b2a18c2..6c872c9 100644
--- a/adapter/persistence/src/main/resources/db/migration/V3__change_target_transform_type.sql
+++ b/adapter/persistence/src/main/resources/db/migration/V3__change_target_transform_type.sql
@@ -1,19 +1,17 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
ALTER TABLE `event_target_class`
-CHANGE COLUMN `target_transform` `target_transform` TEXT NULL DEFAULT NULL ;
+CHANGE COLUMN `target_transform` `target_transform` TEXT NULL DEFAULT NULL ;
\ No newline at end of file
diff --git a/adapter/persistence/src/main/resources/db/migration/V4__register_source_acs_mns.sql b/adapter/persistence/src/main/resources/db/migration/V4__register_source_acs_mns.sql
index 1ad499a..7bc4cfc 100644
--- a/adapter/persistence/src/main/resources/db/migration/V4__register_source_acs_mns.sql
+++ b/adapter/persistence/src/main/resources/db/migration/V4__register_source_acs_mns.sql
@@ -1,18 +1,16 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
-INSERT INTO `event_source_class` (`name`,`api_params`,`required_params`,`transform`,`visual_config`,`description`,`gmt_create`,`gmt_modify`) VALUES ('acs.mns','{\n \"RegionId\":{\n \"type\":\"String\",\n \"desc\":\"the region of aliyun mns.\",\n \"required\":true,\n \"defaultValue\":\"\"\n },\n \"QueueName\":{\n \"type\":\"String\",\n \"desc\":\"the queue name of aliyun mns.\",\n \"required\":true,\n \"defaultValue\":\"\"\n },\n \"IsBase64Decode\":{\n \"type\":\"boolean\",\n \"desc\":\"base64 decode or not\"\n },\n \"AliyunAccountId\":{\n \"type\":\"String\",\n \"desc\":\"the account id of aliyun mns.\",\n \"required\":true\n },\n \"AccessKeyId\":{\n \"type\":\"String\",\n \"desc\":\"the access key id of aliyun mns.\",\n \"required\":true\n },\n \"AccessKeySecret\":{\n \"type\":\"String\",\n \"desc\":\"the access key idsecret of aliyun mns.\",\n \"required\":true\n }\n}','{\n \"accountEndpoint\":\"http://${AliyunAccountId}.mns.${RegionId}.aliyuncs.com\",\n \"accountId\":\"${AliyunAccountId}\",\n \"queueName\":\"${QueueName}\",\n \"isBase64Decode\":\"${IsBase64Decode}\",\n \"accessKeyId\":\"${AccessKeyId}\",\n \"accessKeySecret\":\"${AccessKeySecret}\",\n \"class\":\"org.apache.rocketmq.connect.mns.source.MNSSourceConnector\"\n}','{\n \"data\":\"{\\\"value\\\":\\\"$.data\\\",\\\"form\\\":\\\"JSONPATH\\\"}\",\n \"subject\":\"{\\\"value\\\":\\\"acs:mns:${RegionId}:${AliyunAccountId}:queues/${QueueName}\\\",\\\"form\\\":\\\"CONSTANT\\\"}\",\n \"type\":\"{\\\"value\\\":\\\"mns.sendMsg\\\",\\\"form\\\":\\\"CONSTANT\\\"}\"\n}',NULL,'aliyun mns source',now(),now());
+INSERT INTO `event_source_class` (`name`,`api_params`,`required_params`,`transform`,`visual_config`,`description`,`gmt_create`,`gmt_modify`) VALUES ('acs.mns','{\n \"RegionId\":{\n \"type\":\"String\",\n \"desc\":\"the region of aliyun mns.\",\n \"required\":true,\n \"defaultValue\":\"\"\n },\n \"QueueName\":{\n \"type\":\"String\",\n \"desc\":\"the queue name of aliyun mns.\",\n \"required\":true,\n \"defaultValue\":\"\"\n },\n \"IsBase64Decode\":{\n \"type\":\"boolean\",\n \"desc\":\"base64 decode or not\"\n },\n \"AliyunAccountId\":{\n \"type\":\"String\",\n \"desc\":\"the account id of aliyun mns.\",\n \"required\":true\n },\n \"AccessKeyId\":{\n \"type\":\"String\",\n \"desc\":\"the access key id of aliyun mns.\",\n \"required\":true\n },\n \"AccessKeySecret\":{\n \"type\":\"String\",\n \"desc\":\"the access key idsecret of aliyun mns.\",\n \"required\":true\n }\n}','{\n \"accountEndpoint\":\"http://${AliyunAccountId}.mns.${RegionId}.aliyuncs.com\",\n \"accountId\":\"${AliyunAccountId}\",\n \"queueName\":\"${QueueName}\",\n \"isBase64Decode\":\"${IsBase64Decode}\",\n \"accessKeyId\":\"${AccessKeyId}\",\n \"accessKeySecret\":\"${AccessKeySecret}\",\n \"class\":\"org.apache.rocketmq.connect.mns.source.MNSSourceConnector\"\n}','{\n \"data\":\"{\\\"value\\\":\\\"$.data\\\",\\\"form\\\":\\\"JSONPATH\\\"}\",\n \"subject\":\"{\\\"value\\\":\\\"acs:mns:${RegionId}:${AliyunAccountId}:queues/${QueueName}\\\",\\\"form\\\":\\\"CONSTANT\\\"}\",\n \"type\":\"{\\\"value\\\":\\\"mns.sendMsg\\\",\\\"form\\\":\\\"CONSTANT\\\"}\"\n}',NULL,'aliyun mns source',now(),now());
\ No newline at end of file
diff --git a/adapter/persistence/src/main/resources/db/migration/V5__register_target_acs_dingtalk.sql b/adapter/persistence/src/main/resources/db/migration/V5__register_target_acs_dingtalk.sql
index 1d8a643..31291a1 100644
--- a/adapter/persistence/src/main/resources/db/migration/V5__register_target_acs_dingtalk.sql
+++ b/adapter/persistence/src/main/resources/db/migration/V5__register_target_acs_dingtalk.sql
@@ -1,19 +1,17 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
INSERT INTO `event_target_class` (`name`,`api_params`,`target_transform`,`required_params`,`visual_config`,`description`,`gmt_create`,`gmt_modify`)
VALUES
diff --git a/adapter/persistence/src/main/resources/db/migration/V6__register_target_acs_eventbridge.sql b/adapter/persistence/src/main/resources/db/migration/V6__register_target_acs_eventbridge.sql
index b7587a0..9a38fe6 100644
--- a/adapter/persistence/src/main/resources/db/migration/V6__register_target_acs_eventbridge.sql
+++ b/adapter/persistence/src/main/resources/db/migration/V6__register_target_acs_eventbridge.sql
@@ -1,20 +1,18 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
INSERT INTO `event_target_class` (`name`,`api_params`,`target_transform`,`required_params`,`visual_config`,`description`,`gmt_create`,`gmt_modify`)
VALUES
-('acs.eventbridge','{\n \"RegionId\":{\n \"type\":\"String\",\n \"desc\":\"the region of aliyun eventbridge.\",\n \"required\":true\n },\n \"AliyunAccountId\":{\n \"type\":\"String\",\n \"desc\":\"the account id of aliyun eventbridge.\",\n \"required\":true\n },\n \"AliyunEventBus\":{\n \"type\":\"String\",\n \"desc\":\"the bus of aliyun eventbridge.\",\n \"required\":true\n },\n \"AccessKeyId\":{\n \"type\":\"String\",\n \"desc\":\"the accessKeyId of aliyun eventbridge.\",\n \"required\":true\n },\n \"AccessKeySecret\":{\n \"type\":\"String\",\n \"desc\":\"the accessKeySecret of aliyun eventbridge.\",\n \"required\":true\n }\n}','{\n \"data\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$.data\\\"}\",\n \"id\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$.id\\\"}\",\n \"type\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$.type\\\"}\",\n \"specversion\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$. specversion\\\"}\",\n \"subject\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$.subject\\\"}\",\n \"source\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$.source\\\"}\"\n}','{\n \"aliyuneventbusname\":\"${AliyunEventBus}\",\n \"accessKeyId\":\"${AccessKeyId}\",\n \"accessKeySecret\":\"${AccessKeySecret}\",\n \"accountEndpoint\":\"${AliyunAccountId}.eventbridge.${RegionId}.aliyuncs.com\",\n \"class\":\"org.apache.rocketmq.connect.eventbridge.sink.EventBridgeSinkConnector\"\n}',NULL,'aliyun eventbridge connector config',now(),now());
+('acs.eventbridge','{\n \"RegionId\":{\n \"type\":\"String\",\n \"desc\":\"the region of aliyun eventbridge.\",\n \"required\":true\n },\n \"AliyunAccountId\":{\n \"type\":\"String\",\n \"desc\":\"the account id of aliyun eventbridge.\",\n \"required\":true\n },\n \"AliyunEventBus\":{\n \"type\":\"String\",\n \"desc\":\"the bus of aliyun eventbridge.\",\n \"required\":true\n },\n \"AccessKeyId\":{\n \"type\":\"String\",\n \"desc\":\"the accessKeyId of aliyun eventbridge.\",\n \"required\":true\n },\n \"AccessKeySecret\":{\n \"type\":\"String\",\n \"desc\":\"the accessKeySecret of aliyun eventbridge.\",\n \"required\":true\n }\n}','{\n \"data\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$.data\\\"}\",\n \"id\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$.id\\\"}\",\n \"type\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$.type\\\"}\",\n \"specversion\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$. specversion\\\"}\",\n \"subject\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$.subject\\\"}\",\n \"source\":\"{\\\"form\\\":\\\"JSONPATH\\\",\\\"value\\\":\\\"$.source\\\"}\"\n}','{\n \"aliyuneventbusname\":\"${AliyunEventBus}\",\n \"accessKeyId\":\"${AccessKeyId}\",\n \"accessKeySecret\":\"${AccessKeySecret}\",\n \"accountEndpoint\":\"${AliyunAccountId}.eventbridge.${RegionId}.aliyuncs.com\",\n \"class\":\"org.apache.rocketmq.connect.eventbridge.sink.EventBridgeSinkConnector\"\n}',NULL,'aliyun eventbridge connector config',now(),now());
\ No newline at end of file
diff --git a/adapter/persistence/src/main/resources/db/migration/V7__update_event_connection_table_structure.sql b/adapter/persistence/src/main/resources/db/migration/V7__update_event_connection_table_structure.sql
index e98bbf0..82be349 100644
--- a/adapter/persistence/src/main/resources/db/migration/V7__update_event_connection_table_structure.sql
+++ b/adapter/persistence/src/main/resources/db/migration/V7__update_event_connection_table_structure.sql
@@ -1,19 +1,18 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
---ALTER TABLE `event_connection` MODIFY COLUMN `authorization_type` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '授权类型' AFTER `name`;
---ALTER TABLE `event_connection` MODIFY COLUMN `auth_parameters` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `authorization_type`;
\ No newline at end of file
+ALTER TABLE `event_connection`
+MODIFY COLUMN `authorization_type` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '授权类型' AFTER `name`,
+MODIFY COLUMN `auth_parameters` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `authorization_type`;
\ No newline at end of file
diff --git a/adapter/persistence/src/main/resources/db/migration/V8__update_unique_key.sql b/adapter/persistence/src/main/resources/db/migration/V8__update_unique_key.sql
index 2e9098e..f25bfb0 100644
--- a/adapter/persistence/src/main/resources/db/migration/V8__update_unique_key.sql
+++ b/adapter/persistence/src/main/resources/db/migration/V8__update_unique_key.sql
@@ -1,22 +1,22 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
-ALTER TABLE `event_connection` DROP INDEX `name_uniq_key_event_connection`;
-ALTER TABLE `event_connection` ADD UNIQUE INDEX `name_uniq_key_event_connection`(`name`, `account_id`) USING BTREE;
+ALTER TABLE `event_connection`
+DROP INDEX `name_uniq_key`,
+ADD UNIQUE INDEX `name_uniq_key`(`name`, `account_id`) USING BTREE;
-ALTER TABLE `event_api_destination` DROP INDEX `name_uniq_key_event_api_destination`;
-ALTER TABLE `event_api_destination` ADD UNIQUE INDEX `name_uniq_key_event_api_destination`(`name`, `account_id`) USING BTREE;
\ No newline at end of file
+ALTER TABLE `event_api_destination`
+DROP INDEX `name_uniq_key`,
+ADD UNIQUE INDEX `name_uniq_key`(`name`, `account_id`) USING BTREE;
\ No newline at end of file
diff --git a/start/src/main/resources/application.properties b/start/src/main/resources/application.properties
index 3736814..62daed6 100644
--- a/start/src/main/resources/application.properties
+++ b/start/src/main/resources/application.properties
@@ -25,6 +25,7 @@
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
## flyway
spring.flyway.placeholderReplacement=false
+spring.flyway.locations=classpath:db/h2-migration
## rocketmq
rocketmq.namesrvAddr=localhost:9876
rocketmq.connect.endpoint=http://127.0.0.1:8082