Skip to content

Commit

Permalink
fix: rename database name
Browse files Browse the repository at this point in the history
rename test database name to `eventmesh_dashboard_test`
  • Loading branch information
Lambert-Rao committed Feb 19, 2024
1 parent 83bd529 commit 8c5103d
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
image: mysql:8
env:
# The MySQL docker container requires these environment variables to be set, so we can create and migrate the test database.
MYSQL_DATABASE: EVENTMESH_DASHBOARD
MYSQL_DATABASE: eventmesh_dashboard_test
MYSQL_ROOT_PASSWORD: password
ports:
# https://docs.github.com/en/actions/using-containerized-services/about-service-containers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public interface MetaMapper {
@Select("SELECT * FROM meta WHERE id = #{id}")
MetaEntity selectById(MetaEntity metaEntity);

@Select("SELECT * FROM meta WHERE cluster_id = #{clusterId}")
@Select("SELECT * FROM meta WHERE cluster_id = #{clusterId} LIMIT 1")
MetaEntity selectByClusterId(MetaEntity metaEntity);

@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/eventmesh-dashboard?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true
url: jdbc:mysql://localhost:3306/eventmesh_dashboard?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true
username: ${DB_USERNAME}
password: ${DB_PASSWORD}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/eventmesh-dashboard-test?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true
url: jdbc:mysql://localhost:3306?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true
username: root
password: root
password: password

initial-size: 1
max-active: 50
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
*/

DELETE
FROM `eventmesh-dashboard-test`.client
FROM `eventmesh_dashboard_test`.client
WHERE TRUE;
ALTER TABLE `eventmesh-dashboard-test`.client
ALTER TABLE `eventmesh_dashboard_test`.client
AUTO_INCREMENT = 1;

insert into `eventmesh-dashboard-test`.client (id, cluster_id, name, platform, language, pid, host, port, protocol, status, config_ids, description,
insert into `eventmesh_dashboard_test`.client (id, cluster_id, name, platform, language, pid, host, port, protocol, status, config_ids, description,
create_time, end_time, update_time)
values (1, 3, '', '', 'java', -1, '', -1, '', 1, '', '', '2024-02-02 15:15:15', '2024-02-02 15:15:15', '2024-02-02 15:15:15'),
(2, 3, '', '', 'java', -1, '', -1, '', 1, '', '', '2024-02-02 15:15:15', '2024-02-02 15:15:15', '2024-02-02 15:15:15'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
* limitations under the License.
*/

DELETE FROM `eventmesh-dashboard-test`.connection WHERE TRUE;
ALTER TABLE `eventmesh-dashboard-test`.connection AUTO_INCREMENT = 1;
DELETE FROM `eventmesh_dashboard_test`.connection WHERE TRUE;
ALTER TABLE `eventmesh_dashboard_test`.connection AUTO_INCREMENT = 1;

insert into `eventmesh-dashboard-test`.connection (id, cluster_id, source_type, source_id, sink_type, sink_id, runtime_id, status, topic, group_id, description, create_time, end_time, update_time)
insert into `eventmesh_dashboard_test`.connection (id, cluster_id, source_type, source_id, sink_type, sink_id, runtime_id, status, topic, group_id, description, create_time, end_time, update_time)
values (1, 1, 'connector', 1, 'connector', 1, 1, 0, 'test-topic', -1, '', '2024-01-27 11:55:11', '2024-01-27 11:55:11', '2024-01-27 11:55:11'),
(2, 1, 'connector', 2, 'connector', 2, 2, 0, 'test-topic', -1, '', '2024-01-27 11:55:11', '2024-01-27 11:55:11', '2024-01-27 11:55:11'),
(3, 1, 'connector', 3, 'connector', 3, 3, 0, 'test-topic', -1, '', '2024-01-27 11:55:11', '2024-01-27 11:55:11', '2024-01-27 11:55:11'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
DELETE FROM `eventmesh-dashboard-test`.connection WHERE TRUE;
ALTER TABLE `eventmesh-dashboard-test`.connection AUTO_INCREMENT = 1;
DELETE FROM `eventmesh_dashboard_test`.connection WHERE TRUE;
ALTER TABLE `eventmesh_dashboard_test`.connection AUTO_INCREMENT = 1;

insert into `eventmesh-dashboard-test`.connector (id, cluster_id, name, class_name, type, status, pod_state, config_ids, create_time, update_time)
insert into `eventmesh_dashboard_test`.connector (id, cluster_id, name, class_name, type, status, pod_state, config_ids, create_time, update_time)
values (1, 1, '', 'the', '', 1, 1, '', '2024-02-02 16:43:45', '2024-02-02 16:53:02'),
(2, 1, '', 'quick', '', 1, 1, '', '2024-02-02 16:43:45', '2024-02-02 16:53:02'),
(3, 1, '', 'brown', '', 1, 2, '', '2024-02-02 16:43:45', '2024-02-02 16:53:02'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
DELETE FROM `eventmesh-dashboard-test`.health_check_result WHERE TRUE;
ALTER TABLE `eventmesh-dashboard-test`.health_check_result AUTO_INCREMENT = 1;
DELETE FROM `eventmesh_dashboard_test`.health_check_result WHERE TRUE;
ALTER TABLE `eventmesh_dashboard_test`.health_check_result AUTO_INCREMENT = 1;

insert into `eventmesh-dashboard-test`.health_check_result (id, type, type_id, cluster_id, status, result_desc, create_time, update_time)
insert into `eventmesh_dashboard_test`.health_check_result (id, type, type_id, cluster_id, status, result_desc, create_time, update_time)
values (1, 1, 1, 1, 0, '', '2024-02-02 18:56:50', '2024-02-02 18:56:50'),
(2, 2, 2, 1, 1, '', '2024-02-02 18:56:50', '2024-02-02 18:56:50'),
(3, 3, 3, 1, 1, '', '2024-02-02 18:56:50', '2024-02-02 18:56:50'),
Expand Down
6 changes: 3 additions & 3 deletions eventmesh-dashboard-console/src/test/resources/meta-test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* limitations under the License.
*/

DELETE FROM `eventmesh-dashboard-test`.meta WHERE TRUE;
ALTER TABLE `eventmesh-dashboard-test`.meta AUTO_INCREMENT = 1;
DELETE FROM `eventmesh_dashboard_test`.meta WHERE TRUE;
ALTER TABLE `eventmesh_dashboard_test`.meta AUTO_INCREMENT = 1;

insert into `eventmesh-dashboard-test`.meta (id, name, type, version, cluster_id, host, port, role, username, params, status, create_time, update_time)
insert into `eventmesh_dashboard_test`.meta (id, name, type, version, cluster_id, host, port, role, username, params, status, create_time, update_time)
values (1, '1', 'nacos', '1.0', 1, '', -1, '-1', '', '', 0, '2024-02-03 10:30:02', '2024-02-03 10:30:02'),
(2, '2', 'zookeeper', '1.0', 1, '', -1, '-1', '', '', 0, '2024-02-03 10:30:02', '2024-02-03 10:30:02');
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
* limitations under the License.
*/

USE `eventmesh-dashboard-test`
CREATE DATABASE IF NOT EXISTS `eventmesh_dashboard_test`;
USE `eventmesh_dashboard_test`

0 comments on commit 8c5103d

Please sign in to comment.