Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Update test seed data for task check run and TiDB

天舟5e64ba18dbc2
diff --git a/store/seed/test/10060__instance.sql b/store/seed/test/10060__instance.sql
index 1cc794c9c3..7d821253ba 100644
--- a/store/seed/test/10060__instance.sql
+++ b/store/seed/test/10060__instance.sql
@@ -101,7 +101,6 @@ VALUES
INSERT INTO
instance (
id,
- row_status,
creator_id,
updater_id,
environment_id,
@@ -114,6 +113,32 @@ INSERT INTO
VALUES
(
6005,
+ 101,
+ 101,
+ 5001,
+ 'Localhost Dev TiDB',
+ 'TIDB',
+ '127.0.0.1',
+ '4000',
+ ""
+ );
+
+INSERT INTO
+ instance (
+ id,
+ row_status,
+ creator_id,
+ updater_id,
+ environment_id,
+ name,
+ `engine`,
+ host,
+ port,
+ external_link
+ )
+VALUES
+ (
+ 6006,
'ARCHIVED',
101,
101,
diff --git a/store/seed/test/10070__db.sql b/store/seed/test/10070__db.sql
index 17b989ecda..61b5b9529f 100644
--- a/store/seed/test/10070__db.sql
+++ b/store/seed/test/10070__db.sql
@@ -460,4 +460,32 @@ VALUES
'utf8mb4_general_ci',
'OK',
0
+ );
+
+-- Database for prod environment instance 6006
+INSERT INTO
+ db (
+ id,
+ creator_id,
+ updater_id,
+ instance_id,
+ project_id,
+ name,
+ character_set,
+ `collation`,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 7018,
+ 101,
+ 101,
+ 6006,
+ 1,
+ '*',
+ 'utf8mb4',
+ 'utf8mb4_general_ci',
+ 'OK',
+ 0
);
\ No newline at end of file
diff --git a/store/seed/test/10080__data_source.sql b/store/seed/test/10080__data_source.sql
index b30081462e..478a0ed9e6 100644
--- a/store/seed/test/10080__data_source.sql
+++ b/store/seed/test/10080__data_source.sql
@@ -119,6 +119,31 @@ VALUES
7017,
'Admin data source',
'ADMIN',
+ 'root',
+ ''
+ );
+
+INSERT INTO
+ data_source (
+ id,
+ creator_id,
+ updater_id,
+ instance_id,
+ database_id,
+ name,
+ TYPE,
+ username,
+ PASSWORD
+ )
+VALUES
+ (
+ 8006,
+ 1,
+ 1,
+ 6006,
+ 7018,
+ 'Admin data source',
+ 'ADMIN',
'admin',
'Prod12345'
);
\ No newline at end of file
diff --git a/store/seed/test/10121__task_check_run.sql b/store/seed/test/10121__task_check_run.sql
new file mode 100644
index 0000000000..a570561059
--- /dev/null
+++ b/store/seed/test/10121__task_check_run.sql
@@ -0,0 +1,93 @@
+-- Task run for task 11001
+INSERT INTO
+ task_check_run (
+ creator_id,
+ updater_id,
+ task_id,
+ `status`,
+ `type`,
+ comment,
+ result,
+ payload
+ )
+VALUES
+ (
+ 1,
+ 1,
+ 11001,
+ 'DONE',
+ 'bb.task-check.database.connect',
+ '',
+ '{"resultList":[{"status":"SUCCESS","title":"Successfully connected \"testdb_prod\"","content":""}]}',
+ ''
+ );
+
+INSERT INTO
+ task_check_run (
+ creator_id,
+ updater_id,
+ task_id,
+ `status`,
+ `type`,
+ comment,
+ result,
+ payload
+ )
+VALUES
+ (
+ 1,
+ 1,
+ 11001,
+ 'DONE',
+ 'bb.task-check.database.statement.syntax',
+ '',
+ '{"resultList":[{"status":"SUCCESS","title":"Syntax OK","content":"OK"}]}',
+ '{"statement":"SELECT ''Welcome Tech Lead, DBA, Developer'';","dbType":"MYSQL","charset":"utf8mb4","collation":"utf8mb4_general_ci"}'
+ );
+
+-- Task run for task 11004
+INSERT INTO
+ task_check_run (
+ creator_id,
+ updater_id,
+ task_id,
+ `status`,
+ `type`,
+ comment,
+ result,
+ payload
+ )
+VALUES
+ (
+ 1,
+ 1,
+ 11004,
+ 'FAILED',
+ 'bb.task-check.database.connect',
+ 'failed to connect database "shop": failed to connect database On-premises Staging MySQL/shop at "mysql.staging.example.com":"3306" with user "admin": dial tcp: lookup mysql.staging.example.com: no such host',
+ '',
+ ''
+ );
+
+INSERT INTO
+ task_check_run (
+ creator_id,
+ updater_id,
+ task_id,
+ `status`,
+ `type`,
+ comment,
+ result,
+ payload
+ )
+VALUES
+ (
+ 1,
+ 1,
+ 11004,
+ 'DONE',
+ 'bb.task-check.database.statement.syntax',
+ '',
+ '{"resultList":[{"status":"SUCCESS","title":"Syntax OK","content":"OK"}]}',
+ '{"statement":"CREATE TABLE product (\n\tid INTEGER PRIMARY KEY AUTO_INCREMENT,\n\tname TEXT NOT NULL,\n\tdescription TEXT NOT NULL\n);\n","dbType":"MYSQL","charset":"utf8mb4","collation":"utf8mb4_general_ci"}'
+ );
\ No newline at end of file