Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
Add seed data for a multi stage issue
天舟21dacbdd57bb
diff --git a/backend/store/seed/0090_pipeline.sql b/backend/store/seed/0090_pipeline.sqlindex 0cf1311de1..3046a6b753 100644--- a/backend/store/seed/0090_pipeline.sql+++ b/backend/store/seed/0090_pipeline.sql@@ -1,3 +1,4 @@+-- A single stage, single step "hello world" pipelineINSERT INTOpipeline (id,@@ -13,6 +14,26 @@ VALUES1001,1001,1,- 'Hello world',+ 'Pipeline - Hello world',+ 'OPEN'+ );++-- A multi stage, each containing a single step schema update pipeline+INSERT INTO+ pipeline (+ id,+ creator_id,+ updater_id,+ workspace_id,+ name,+ `status`+ )+VALUES+ (+ 9002,+ 1003,+ 1003,+ 1,+ 'Pipeline - Add column ''location'' to table ''warehouse''','OPEN');\ No newline at end of filediff --git a/backend/store/seed/0100_stage.sql b/backend/store/seed/0100_stage.sqlindex 9b12676522..25cbd9049d 100644--- a/backend/store/seed/0100_stage.sql+++ b/backend/store/seed/0100_stage.sql@@ -20,4 +20,97 @@ VALUES5004,'Prod','bb.stage.schema.update'+ );++-- Stage for Pipeline 9002 schema update+INSERT INTO+ stage (+ id,+ creator_id,+ updater_id,+ workspace_id,+ pipeline_id,+ environment_id,+ name,+ `type`+ )+VALUES+ (+ 10002,+ 1001,+ 1001,+ 1,+ 9002,+ 5001,+ 'Sandbox A',+ 'bb.stage.schema.update'+ );++INSERT INTO+ stage (+ id,+ creator_id,+ updater_id,+ workspace_id,+ pipeline_id,+ environment_id,+ name,+ `type`+ )+VALUES+ (+ 10003,+ 1001,+ 1001,+ 1,+ 9002,+ 5002,+ 'Integration',+ 'bb.stage.schema.update'+ );++INSERT INTO+ stage (+ id,+ creator_id,+ updater_id,+ workspace_id,+ pipeline_id,+ environment_id,+ name,+ `type`+ )+VALUES+ (+ 10004,+ 1001,+ 1001,+ 1,+ 9002,+ 5003,+ 'Staging',+ 'bb.stage.schema.update'+ );++INSERT INTO+ stage (+ id,+ creator_id,+ updater_id,+ workspace_id,+ pipeline_id,+ environment_id,+ name,+ `type`+ )+VALUES+ (+ 10005,+ 1001,+ 1001,+ 1,+ 9002,+ 5004,+ 'Prod',+ 'bb.stage.schema.update');\ No newline at end of filediff --git a/backend/store/seed/0110_task.sql b/backend/store/seed/0110_task.sqlindex 19e6c32551..27c61992d2 100644--- a/backend/store/seed/0110_task.sql+++ b/backend/store/seed/0110_task.sql@@ -26,4 +26,125 @@ VALUES'bb.task.approve','PENDING','MANUAL'+ );++-- Task for Pipeline 9002 schema update+-- Taks for stage 10002 "Sandbox A" to update database 7002 'fakedb1'+INSERT INTO+ task (+ id,+ creator_id,+ updater_id,+ workspace_id,+ pipeline_id,+ stage_id,+ database_id,+ name,+ `type`,+ `status`,+ `when`+ )+VALUES+ (+ 11002,+ 1001,+ 1001,+ 1,+ 9002,+ 10002,+ 7002,+ 'Update fakedb1',+ 'bb.task.database.schema.update',+ 'PENDING',+ 'ON_SUCCESS'+ );++-- Taks for stage 10003 "Integration" to update database 7004 'fakedb2'+INSERT INTO+ task (+ id,+ creator_id,+ updater_id,+ workspace_id,+ pipeline_id,+ stage_id,+ database_id,+ name,+ `type`,+ `status`,+ `when`+ )+VALUES+ (+ 11003,+ 1001,+ 1001,+ 1,+ 9002,+ 10003,+ 7004,+ 'Update fakedb2',+ 'bb.task.database.schema.update',+ 'PENDING',+ 'ON_SUCCESS'+ );++-- Taks for stage 10004 "Staging" to update database 7006 'fakedb3'+INSERT INTO+ task (+ id,+ creator_id,+ updater_id,+ workspace_id,+ pipeline_id,+ stage_id,+ database_id,+ name,+ `type`,+ `status`,+ `when`+ )+VALUES+ (+ 11004,+ 1001,+ 1001,+ 1,+ 9002,+ 10004,+ 7006,+ 'Update fakedb3',+ 'bb.task.database.schema.update',+ 'PENDING',+ 'MANUAL'+ );++-- Taks for stage 10005 "Prod" to update database 7008 'fakedb4'+INSERT INTO+ task (+ id,+ creator_id,+ updater_id,+ workspace_id,+ pipeline_id,+ stage_id,+ database_id,+ name,+ `type`,+ `status`,+ `when`+ )+VALUES+ (+ 11005,+ 1001,+ 1001,+ 1,+ 9002,+ 10005,+ 7008,+ 'Update fakedb4',+ 'bb.task.database.schema.update',+ 'PENDING',+ 'MANUAL');\ No newline at end of filediff --git a/backend/store/seed/0120_issue.sql b/backend/store/seed/0120_issue.sqlindex c1fa7349c8..031a67aeb5 100644--- a/backend/store/seed/0120_issue.sql+++ b/backend/store/seed/0120_issue.sql@@ -1,3 +1,4 @@+-- Issue for the single stage, single step "Hello world" pipelineINSERT INTOissue (id,@@ -31,4 +32,40 @@ VALUES'1001,1002,1003,1004','SELECT ''Welcome''' || char(10) || 'FROM engineering' || char(10) || 'WHERE role IN (''Tech Lead'', ''Developer'', ''DBA'')' || char(10) || 'AND taste = ''Good'';',''+ );++-- Issue for the multi stage update schema pipeline+INSERT INTO+ issue (+ id,+ creator_id,+ updater_id,+ workspace_id,+ project_id,+ pipeline_id,+ name,+ `status`,+ `type`,+ description,+ assignee_id,+ subscriber_id_list,+ `sql`,+ rollback_sql+ )+VALUES+ (+ 12002,+ 1003,+ 1003,+ 1,+ 3002,+ 9002,+ 'Add column ''location'' to table ''warehouse''',+ 'OPEN',+ 'bb.database.schema.update',+ 'Add the location column to record the warehouse address.',+ 1001,+ '1001,1002,1003,1004',+ 'ALTER TABLE warehouse ' || char(10) || 'ADD COLUMN location VARCHAR(255);',+ 'ALTER TABLE warehouse ' || char(10) || 'DROP COLUMN location;');\ No newline at end of filediff --git a/backend/store/seed/0130_activity.sql b/backend/store/seed/0130_activity.sqlindex bfcfca9328..37874a0fd1 100644--- a/backend/store/seed/0130_activity.sql+++ b/backend/store/seed/0130_activity.sql@@ -79,4 +79,24 @@ VALUES12001,'bb.issue.comment.create','Go fish!'+ );++-- Activity for issue 012002+INSERT INTO+ activity (+ id,+ creator_id,+ updater_id,+ workspace_id,+ container_id,+ `type`+ )+VALUES+ (+ 13005,+ 1,+ 1,+ 1,+ 12002,+ 'bb.issue.create');\ No newline at end of file