Skip to content

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

Test seed data improvement

天舟f96dd3199d0a
diff --git a/store/seed/test/10030__project.sql b/store/seed/test/10030__project.sql
index 136e9b7634..6c58ba870e 100644
--- a/store/seed/test/10030__project.sql
+++ b/store/seed/test/10030__project.sql
@@ -12,7 +12,7 @@ VALUES
3001,
101,
101,
- 'Test Project',
+ 'Test (UI)',
'TEST',
'UI'
);
@@ -31,7 +31,7 @@ VALUES
3002,
101,
101,
- 'Shop (VCS)',
+ 'Shop (Git)',
'SHP',
'VCS'
);
@@ -50,7 +50,7 @@ VALUES
3003,
101,
101,
- 'Blog (VCS)',
+ 'Blog (Git)',
'BLG',
'VCS'
);
diff --git a/store/seed/test/10060__instance.sql b/store/seed/test/10060__instance.sql
index d5309f17bb..eb0b3ea984 100644
--- a/store/seed/test/10060__instance.sql
+++ b/store/seed/test/10060__instance.sql
@@ -96,4 +96,31 @@ VALUES
'mysql.prod.example.com',
'3306',
'bytebase.com'
+ );
+
+INSERT INTO
+ instance (
+ id,
+ row_status,
+ creator_id,
+ updater_id,
+ environment_id,
+ name,
+ `engine`,
+ host,
+ port,
+ external_link
+ )
+VALUES
+ (
+ 6005,
+ 'ARCHIVED',
+ 101,
+ 101,
+ 5004,
+ 'Retired Prod MySQL',
+ 'MYSQL',
+ 'mysql.retired.example.com',
+ '3306',
+ ""
);
\ No newline at end of file
diff --git a/store/seed/test/10070__db.sql b/store/seed/test/10070__db.sql
index 37a9cbe035..71d1e7f58a 100644
--- a/store/seed/test/10070__db.sql
+++ b/store/seed/test/10070__db.sql
@@ -46,7 +46,7 @@ VALUES
101,
6001,
3001,
- 'db1_dev',
+ 'testdb_dev',
'utf8mb4',
'utf8mb4_0900_ai_ci',
'OK',
@@ -155,7 +155,7 @@ VALUES
101,
6002,
3001,
- 'db1_integration',
+ 'testdb_integration',
'utf8mb4',
'utf8mb4_0900_ai_ci',
'OK',
@@ -264,7 +264,7 @@ VALUES
101,
6003,
3001,
- 'db1_staging',
+ 'testdb_staging',
'utf8mb4',
'utf8mb4_0900_ai_ci',
'OK',
@@ -373,7 +373,7 @@ VALUES
101,
6004,
3001,
- 'db1_prod',
+ 'testdb_prod',
'utf8mb4',
'utf8mb4_0900_ai_ci',
'OK',
@@ -434,6 +434,7 @@ VALUES
0
);
+-- Database for prod environment instance 6005
INSERT INTO
db (
id,
@@ -452,9 +453,9 @@ VALUES
7017,
101,
101,
- 6004,
- 3004,
- 'glacier',
+ 6005,
+ 1,
+ '*',
'utf8mb4',
'utf8mb4_0900_ai_ci',
'OK',
diff --git a/store/seed/test/10071__tbl.sql b/store/seed/test/10071__tbl.sql
index 2bacb747fd..72ef31ee30 100644
--- a/store/seed/test/10071__tbl.sql
+++ b/store/seed/test/10071__tbl.sql
@@ -1,2 +1,531 @@
--- tbl is populated via schema sync, so no seed data here.
--- Creating this file just to reduce confusion in case people may wonder whether we miss the file.
\ No newline at end of file
+-- Table for database 7002 testdb_dev
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7002,
+ 'tbl1',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 1234,
+ 16384,
+ 0,
+ 'OK',
+ 1625075289
+ );
+
+-- Table for database 7006 testdb_integration
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7006,
+ 'tbl1',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 1234,
+ 16384,
+ 16384,
+ 'OK',
+ 1625075289
+ );
+
+-- Table for database 7010 testdb_staging
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7010,
+ 'tbl1',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 12234,
+ 65536,
+ 16384,
+ 'OK',
+ 1624475289
+ );
+
+-- Table for database 7014 testdb_prod
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7014,
+ 'tbl1',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 1234,
+ 32768,
+ 4096,
+ 'OK',
+ 1624475289
+ );
+
+-- Table for database 7003 shop
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7003,
+ 'product',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 1000,
+ 4096,
+ 0,
+ 'OK',
+ 1624275289
+ );
+
+-- Table for database 7007 shop
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7007,
+ 'product',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 1000,
+ 4096,
+ 1024,
+ 'OK',
+ 1624575289
+ );
+
+-- Table for database 7004 blog
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7004,
+ 'user',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 1000,
+ 4096,
+ 1024,
+ 'OK',
+ 1624275289
+ );
+
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7004,
+ 'post',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 1000,
+ 8192,
+ 1024,
+ 'OK',
+ 1624275289
+ );
+
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7004,
+ 'comment',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 30000,
+ 65536,
+ 4096,
+ 'OK',
+ 1624275289
+ );
+
+-- Table for database 7008 blog
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7008,
+ 'user',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 100,
+ 4096,
+ 0,
+ 'OK',
+ 1624675289
+ );
+
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7008,
+ 'post',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 300,
+ 4096,
+ 1024,
+ 'OK',
+ 1624675289
+ );
+
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7008,
+ 'comment',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 2000,
+ 65536,
+ 2048,
+ 'OK',
+ 1624675289
+ );
+
+-- Table for database 7012 blog
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7012,
+ 'user',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 200,
+ 4096,
+ 1024,
+ 'OK',
+ 1622675289
+ );
+
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7012,
+ 'post',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 500,
+ 4096,
+ 1024,
+ 'OK',
+ 1622675289
+ );
+
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7012,
+ 'comment',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 4000,
+ 65536,
+ 65536,
+ 'OK',
+ 1622675289
+ );
+
+-- Table for database 7016 blog
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7016,
+ 'user',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 200,
+ 4096,
+ 1024,
+ 'OK',
+ 1622275289
+ );
+
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7016,
+ 'post',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 500,
+ 4096,
+ 1024,
+ 'OK',
+ 1622275289
+ );
+
+INSERT INTO
+ tbl (
+ creator_id,
+ updater_id,
+ database_id,
+ name,
+ ENGINE,
+ `collation`,
+ row_count,
+ data_size,
+ index_size,
+ sync_status,
+ last_successful_sync_ts
+ )
+VALUES
+ (
+ 101,
+ 101,
+ 7016,
+ 'comment',
+ 'InnoDB',
+ 'utf8mb4_0900_ai_ci',
+ 7000,
+ 8192,
+ 0,
+ 'OK',
+ 1622275289
+ );
\ 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 a325102d4a..43f021af2b 100644
--- a/store/seed/test/10080__data_source.sql
+++ b/store/seed/test/10080__data_source.sql
@@ -96,4 +96,29 @@ VALUES
'ADMIN',
'admin',
'Prod12345'
+ );
+
+INSERT INTO
+ data_source (
+ id,
+ creator_id,
+ updater_id,
+ instance_id,
+ database_id,
+ name,
+ TYPE,
+ username,
+ PASSWORD
+ )
+VALUES
+ (
+ 8005,
+ 1,
+ 1,
+ 6005,
+ 7017,
+ 'Admin data source',
+ 'ADMIN',
+ 'admin',
+ 'Prod12345'
);
\ No newline at end of file
diff --git a/store/seed/test/10110__task.sql b/store/seed/test/10110__task.sql
index 3cd635a073..4603209ff5 100644
--- a/store/seed/test/10110__task.sql
+++ b/store/seed/test/10110__task.sql
@@ -1,4 +1,4 @@
--- Task for Pipeline 9001 "Hello world", Stage 10001 "Prod" to update database 7014 "db1_prod"
+-- Task for Pipeline 9001 "Hello world", Stage 10001 "Prod" to update database 7014 "testdb_prod"
INSERT INTO
task (
id,
@@ -166,7 +166,7 @@ VALUES
);
-- Task for Pipeline 9003 create table
--- Task for stage 10006 "Dev" to craete table in database 7002 'db1_dev'
+-- Task for stage 10006 "Dev" to craete table in database 7002 'testdb_dev'
INSERT INTO
task (
id,
@@ -190,13 +190,13 @@ VALUES
10006,
6001,
7002,
- 'Update db1_dev',
+ 'Update testdb_dev',
'bb.task.database.schema.update',
'FAILED',
- '{"statement":"CREATE TABLE db1_dev.tbl1 (name TEXT);", "rollbackStatement":"DROP TABLE db1_dev.tbl1;"}'
+ '{"statement":"CREATE TABLE testdb_dev.tbl1 (name TEXT);", "rollbackStatement":"DROP TABLE testdb_dev.tbl1;"}'
);
--- Task for stage 10003 "Integration" to update database 7006 'db1_integration'
+-- Task for stage 10003 "Integration" to update database 7006 'testdb_integration'
INSERT INTO
task (
id,
@@ -220,10 +220,10 @@ VALUES
10007,
6001,
7006,
- 'Update db1_integration',
+ 'Update testdb_integration',
'bb.task.database.schema.update',
'PENDING',
- '{"statement":"CREATE TABLE db1_integration.tbl1 (name TEXT);", "rollbackStatement":"DROP TABLE db1_integration.tbl1;"}'
+ '{"statement":"CREATE TABLE testdb_integration.tbl1 (name TEXT);", "rollbackStatement":"DROP TABLE testdb_integration.tbl1;"}'
);
-- Task for stage 10008 simulating webhook push event
diff --git a/store/seed/test/10120__task_run.sql b/store/seed/test/10120__task_run.sql
index 1b900643cd..abe4927dfa 100644
--- a/store/seed/test/10120__task_run.sql
+++ b/store/seed/test/10120__task_run.sql
@@ -72,7 +72,7 @@ VALUES
101,
101,
11006,
- 'Update db1_dev task run',
+ 'Update testdb_dev task run',
'FAILED',
'bb.task.database.schema.update',
'table "tbl1" already exists'