Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: remove seeding data (#2512)
boojackbbda7b757d96
diff --git a/api/pipeline.go b/api/pipeline.goindex 2c58f0c77d..fbcae60dbf 100644--- a/api/pipeline.go+++ b/api/pipeline.go@@ -4,9 +4,6 @@ import ("encoding/json")-// OnboardingPipelineID is the ID for onboarding pipelines.-const OnboardingPipelineID = 101-// PipelineStatus is the status for pipelines.type PipelineStatus stringdiff --git a/api/task.go b/api/task.goindex 97d77e154c..a7ebdd2c09 100644--- a/api/task.go+++ b/api/task.go@@ -8,14 +8,6 @@ import ("github.com/bytebase/bytebase/plugin/vcs")-// These are special onboarding tasks for demo purpose when bootstrapping the workspace.--// OnboardingTaskID1 is the ID for onboarding task1.-const OnboardingTaskID1 = 101--// OnboardingTaskID2 is the ID for onboarding task2.-const OnboardingTaskID2 = 102-// TaskStatus is the status of a task.type TaskStatus stringdiff --git a/frontend/src/components/Issue/IssueSidebar.vue b/frontend/src/components/Issue/IssueSidebar.vueindex 0bafbe723c..3bcea37374 100644--- a/frontend/src/components/Issue/IssueSidebar.vue+++ b/frontend/src/components/Issue/IssueSidebar.vue@@ -300,7 +300,6 @@ import type {DatabaseLabel,Principal,} from "@/types";-import { ONBOARDING_ISSUE_ID } from "@/types";import {allTaskList,databaseSlug,@@ -453,9 +452,6 @@ const allowEditAssignee = computed(() => {return true;}const issueEntity = issue.value as Issue;- if (issueEntity.id === ONBOARDING_ISSUE_ID) {- return false;- }if (issueEntity.status !== "OPEN") {return false;}@@ -484,7 +480,6 @@ const allowEditEarliestAllowedTime = computed(() => {const issueEntity = issue.value as Issue;const task = selectedTask.value as Task;return (- issueEntity.id != ONBOARDING_ISSUE_ID &&issueEntity.status == "OPEN" &&(task.status == "PENDING" || task.status == "PENDING_APPROVAL") &¤tUser.value.id == issueEntity.assignee.iddiff --git a/frontend/src/components/Issue/logic/transition.ts b/frontend/src/components/Issue/logic/transition.tsindex 0c3a16a56a..a4f0c20b2b 100644--- a/frontend/src/components/Issue/logic/transition.ts+++ b/frontend/src/components/Issue/logic/transition.ts@@ -3,7 +3,6 @@ import { useCurrentUser } from "@/store";import {Issue,SYSTEM_BOT_ID,- ONBOARDING_ISSUE_ID,IssueStatusTransitionType,ASSIGNEE_APPLICABLE_ACTION_LIST,CREATOR_APPLICABLE_ACTION_LIST,@@ -62,9 +61,6 @@ export const useIssueTransitionLogic = (issue: Ref<Issue>) => {const currentTask = activeTaskOfPipeline(issue.pipeline);const issueEntity = issue as Issue;- if (issueEntity.id == ONBOARDING_ISSUE_ID) {- return [];- }const list: IssueStatusTransitionType[] = [];// Allow assignee, or assignee is the system bot and current user is DBA or ownerif (@@ -116,9 +112,6 @@ export const useIssueTransitionLogic = (issue: Ref<Issue>) => {if (create.value) {return [];}- if (issue.id == ONBOARDING_ISSUE_ID) {- return [];- }switch (issue.status) {case "DONE":case "CANCELED":@@ -144,9 +137,6 @@ export const useIssueTransitionLogic = (issue: Ref<Issue>) => {if (create.value) {return [];}- if (issue.id == ONBOARDING_ISSUE_ID) {- return [];- }switch (issue.status) {case "DONE":case "CANCELED":diff --git a/frontend/src/types/common.ts b/frontend/src/types/common.tsindex 0949c23107..02c8530eeb 100644--- a/frontend/src/types/common.ts+++ b/frontend/src/types/common.ts@@ -35,9 +35,6 @@ export const DEFAULT_PROJECT_ID = 1;export const ALL_DATABASE_NAME = "*";-// For onboarding-export const ONBOARDING_ISSUE_ID = 101;-// For text input, we do validation if there is no further keystroke after 1sexport const TEXT_VALIDATION_DELAY = 1000;diff --git a/server/task_scheduler.go b/server/task_scheduler.goindex d16ce5bed5..8dbc3bfc9c 100644--- a/server/task_scheduler.go+++ b/server/task_scheduler.go@@ -86,10 +86,6 @@ func (s *TaskScheduler) Run(ctx context.Context, wg *sync.WaitGroup) {return}for _, pipeline := range pipelineList {- if pipeline.ID == api.OnboardingPipelineID {- continue- }-if err := s.server.ScheduleActiveStage(ctx, pipeline); err != nil {log.Error("Failed to schedule tasks in the active stage",zap.Int("pipeline_id", pipeline.ID),@@ -112,10 +108,6 @@ func (s *TaskScheduler) Run(ctx context.Context, wg *sync.WaitGroup) {}for _, task := range taskList {- if task.ID == api.OnboardingTaskID1 || task.ID == api.OnboardingTaskID2 {- continue- }-// Skip task belongs to archived instancesif i := task.Instance; i == nil || i.RowStatus == api.Archived {continuediff --git a/store/migration/dev/LATEST_DATA.sql b/store/migration/dev/LATEST_DATA.sqlindex 15e049afeb..2f809b8d18 100644--- a/store/migration/dev/LATEST_DATA.sql+++ b/store/migration/dev/LATEST_DATA.sql@@ -126,428 +126,3 @@ VALUES);ALTER SEQUENCE label_key_id_seq RESTART WITH 103;---- Create 1 "test", 1 "prod" instance (including * database and admin data source)--- Both instances contains the connection info we expect user to setup according to https://www.bytebase.com/docs/get-started/configure-workspace/add-a-mysql-instance-for-testing--- Set host to 172.17.0.1 which is the default docker gateway ip.--- Our quickstart guide suggests to run both Bytebase and MySQL using docker, and in such case, bytebase access the mysqld container via 172.17.0.1--- "test" instance-INSERT INTO- instance (- id,- creator_id,- updater_id,- environment_id,- name,- engine,- engine_version,- host,- port,- external_link- )-VALUES- (- 101,- 1,- 1,- 101,- 'Sample Test instance (Follow the "External Link" field to bring up the MySQL server)',- 'MYSQL',- '8.0.19',- 'host.docker.internal',- '3306',- 'https://www.bytebase.com/docs/get-started/configure-workspace/add-a-mysql-instance-for-testing'- );--INSERT INTO- instance (- id,- creator_id,- updater_id,- environment_id,- name,- engine,- engine_version,- host,- port,- external_link- )-VALUES- (- 102,- 1,- 1,- 102,- 'Sample Prod instance (Follow the "External Link" field to bring up the MySQL server)',- 'MYSQL',- '8.0.19',- 'host.docker.internal',- '3306',- 'https://www.bytebase.com/docs/get-started/configure-workspace/add-a-mysql-instance-for-testing'- );--ALTER SEQUENCE instance_id_seq RESTART WITH 103;--INSERT INTO- db (- id,- creator_id,- updater_id,- instance_id,- project_id,- name,- character_set,- "collation",- sync_status,- last_successful_sync_ts,- schema_version- )-VALUES- (- 101,- 1,- 1,- 101,- 1,- '*',- 'utf8mb4',- 'utf8mb4_general_ci',- 'OK',- 0,- ''- );--INSERT INTO- db (- id,- creator_id,- updater_id,- instance_id,- project_id,- name,- character_set,- "collation",- sync_status,- last_successful_sync_ts,- schema_version- )-VALUES- (- 102,- 1,- 1,- 102,- 1,- '*',- 'utf8mb4',- 'utf8mb4_general_ci',- 'OK',- 0,- ''- );--ALTER SEQUENCE db_id_seq RESTART WITH 103;--INSERT INTO- data_source (- id,- creator_id,- updater_id,- instance_id,- database_id,- name,- TYPE,- username,- password- )-VALUES- (- 101,- 1,- 1,- 101,- 101,- 'Admin data source',- 'ADMIN',- 'root',- ''- );--INSERT INTO- data_source (- id,- creator_id,- updater_id,- instance_id,- database_id,- name,- TYPE,- username,- password- )-VALUES- (- 102,- 1,- 1,- 102,- 102,- 'Admin data source',- 'ADMIN',- 'root',- ''- );--ALTER SEQUENCE data_source_id_seq RESTART WITH 103;---- Create pipeline/stage/task/issue for onboarding--- Create pipeline 101 "Hello world"-INSERT INTO- pipeline (- id,- creator_id,- updater_id,- name,- status- )-VALUES- (- 101,- 1,- 1,- 'Pipeline - Hello world',- 'OPEN'- );--ALTER SEQUENCE pipeline_id_seq RESTART WITH 102;---- Create stage 101, 102 for pipeline 101-INSERT INTO- stage (- id,- creator_id,- updater_id,- pipeline_id,- environment_id,- name- )-VALUES- (- 101,- 1,- 1,- 101,- 101,- 'Test'- );--INSERT INTO- stage (- id,- creator_id,- updater_id,- pipeline_id,- environment_id,- name- )-VALUES- (- 102,- 1,- 1,- 101,- 102,- 'Prod'- );--ALTER SEQUENCE stage_id_seq RESTART WITH 103;---- Create task 101 for stage 101-INSERT INTO- task (- id,- creator_id,- updater_id,- pipeline_id,- stage_id,- instance_id,- database_id,- name,- type,- status,- payload- )-VALUES- (- 101,- 1,- 1,- 101,- 101,- 101,- NULL,- 'Welcome',- 'bb.task.general',- 'RUNNING',- '{"statement":"SELECT ''Welcome Builders'';"}'- );---- Create task 102 for stage 102-INSERT INTO- task (- id,- creator_id,- updater_id,- pipeline_id,- stage_id,- instance_id,- database_id,- name,- type,- status,- payload- )-VALUES- (- 102,- 1,- 1,- 101,- 102,- 102,- NULL,- 'Let''s go',- 'bb.task.general',- 'PENDING_APPROVAL',- '{"statement":"SELECT ''Let''s go'';"}'- );--ALTER SEQUENCE task_id_seq RESTART WITH 103;---- Create task_run for task 101-INSERT INTO- task_run (- id,- creator_id,- updater_id,- task_id,- name,- status,- type,- comment,- result,- payload- )-VALUES- (- 101,- 1,- 1,- 101,- 'Welcome',- 'FAILED',- 'bb.task.general',- '',- '{"detail":"Something is not right..."}',- '{}'- );--INSERT INTO- task_run (- id,- creator_id,- updater_id,- task_id,- name,- status,- type,- comment,- payload- )-VALUES- (- 102,- 1,- 1,- 101,- 'Welcome',- 'RUNNING',- 'bb.task.general',- 'Let''s give another try',- '{}'- );--ALTER SEQUENCE task_run_id_seq RESTART WITH 103;---- Create issue 101 "Hello world"-INSERT INTO- issue (- id,- creator_id,- updater_id,- project_id,- pipeline_id,- name,- status,- type,- description,- assignee_id- )-VALUES- (- 101,- 1,- 1,- 1,- 101,- 'Hello world!',- 'OPEN',- 'bb.issue.general',- 'Welcome to Bytebase, this is the issue interface where developers and DBAs collaborate on database schema management issues such as: '||chr(10)||' - Creating a new database'||chr(10)||' - Creating a table'||chr(10)||' - Creating an index'||chr(10)||' - Adding/Altering a column'||chr(10)||' - Troubleshooting performance issue'||chr(10)||'Let''s try some simple tasks:'||chr(10)||'1. Bookmark this issue by clicking the star icon on the top of this page'||chr(10)||'2. Leave a comment below to greet future customers.',- 1- );--ALTER SEQUENCE issue_id_seq RESTART WITH 102;---- Create activity 101-INSERT INTO- activity (- id,- creator_id,- updater_id,- container_id,- type,- level- )-VALUES- (- 101,- 1,- 1,- 101,- 'bb.issue.create',- 'INFO'- );--INSERT INTO- activity (- id,- creator_id,- updater_id,- container_id,- type,- level,- comment- )-VALUES- (- 102,- 1,- 1,- 101,- 'bb.issue.comment.create',- 'INFO',- 'Go fish!'- );--ALTER SEQUENCE activity_id_seq RESTART WITH 103;diff --git a/store/migration/prod/LATEST_DATA.sql b/store/migration/prod/LATEST_DATA.sqlindex f508db684a..2f809b8d18 100644--- a/store/migration/prod/LATEST_DATA.sql+++ b/store/migration/prod/LATEST_DATA.sql@@ -126,429 +126,3 @@ VALUES);ALTER SEQUENCE label_key_id_seq RESTART WITH 103;---- Create 1 "test" instance (including * database and admin data source)-INSERT INTO- instance (- id,- creator_id,- updater_id,- environment_id,- name,- engine,- engine_version,- host,- port,- external_link- )-VALUES- (- 101,- 1,- 1,- 101,- 'Sample Test instance',- 'POSTGRES',- '14.3',- 'host.docker.internal',- '5432',- ''- );---- Create 1 "prod" instance (including * database and admin data source)-INSERT INTO- instance (- id,- creator_id,- updater_id,- environment_id,- name,- engine,- engine_version,- host,- port,- external_link- )-VALUES- (- 102,- 1,- 1,- 102,- 'Sample Prod instance',- 'POSTGRES',- '14.3',- 'host.docker.internal',- '5433',- ''- );--ALTER SEQUENCE instance_id_seq RESTART WITH 103;---- '*' db for test instance 101-INSERT INTO- db (- id,- creator_id,- updater_id,- instance_id,- project_id,- name,- character_set,- "collation",- sync_status,- last_successful_sync_ts,- schema_version- )-VALUES- (- 101,- 1,- 1,- 101,- 1,- '*',- 'utf8mb4',- 'utf8mb4_general_ci',- 'OK',- 0,- ''- );---- * db for prod instance 102-INSERT INTO- db (- id,- creator_id,- updater_id,- instance_id,- project_id,- name,- character_set,- "collation",- sync_status,- last_successful_sync_ts,- schema_version- )-VALUES- (- 102,- 1,- 1,- 102,- 1,- '*',- 'utf8mb4',- 'utf8mb4_general_ci',- 'OK',- 0,- ''- );--ALTER SEQUENCE db_id_seq RESTART WITH 103;---- admin data source for test instance 101-INSERT INTO- data_source (- id,- creator_id,- updater_id,- instance_id,- database_id,- name,- TYPE,- username,- password- )-VALUES- (- 101,- 1,- 1,- 101,- 101,- 'Admin data source',- 'ADMIN',- 'root',- ''- );---- admin data source for prod instance 102-INSERT INTO- data_source (- id,- creator_id,- updater_id,- instance_id,- database_id,- name,- TYPE,- username,- password- )-VALUES- (- 102,- 1,- 1,- 102,- 102,- 'Admin data source',- 'ADMIN',- 'root',- ''- );--ALTER SEQUENCE data_source_id_seq RESTART WITH 103;---- Create pipeline/stage/task/issue for onboarding--- Create pipeline 101 "Hello world"-INSERT INTO- pipeline (- id,- creator_id,- updater_id,- name,- status- )-VALUES- (- 101,- 1,- 1,- 'Pipeline - Hello world',- 'OPEN'- );--ALTER SEQUENCE pipeline_id_seq RESTART WITH 102;---- Create stage 101, 102 for pipeline 101-INSERT INTO- stage (- id,- creator_id,- updater_id,- pipeline_id,- environment_id,- name- )-VALUES- (- 101,- 1,- 1,- 101,- 101,- 'Test'- );--INSERT INTO- stage (- id,- creator_id,- updater_id,- pipeline_id,- environment_id,- name- )-VALUES- (- 102,- 1,- 1,- 101,- 102,- 'Prod'- );--ALTER SEQUENCE stage_id_seq RESTART WITH 103;---- Create task 101 for stage 101-INSERT INTO- task (- id,- creator_id,- updater_id,- pipeline_id,- stage_id,- instance_id,- database_id,- name,- type,- status,- payload- )-VALUES- (- 101,- 1,- 1,- 101,- 101,- 101,- NULL,- 'Welcome',- 'bb.task.general',- 'RUNNING',- '{"statement":"SELECT ''Welcome Builders'';"}'- );---- Create task 102 for stage 102-INSERT INTO- task (- id,- creator_id,- updater_id,- pipeline_id,- stage_id,- instance_id,- database_id,- name,- type,- status,- payload- )-VALUES- (- 102,- 1,- 1,- 101,- 102,- 102,- NULL,- 'Let''s go',- 'bb.task.general',- 'PENDING_APPROVAL',- '{"statement":"SELECT ''Let''s go'';"}'- );--ALTER SEQUENCE task_id_seq RESTART WITH 103;---- Create task_run for task 101-INSERT INTO- task_run (- id,- creator_id,- updater_id,- task_id,- name,- status,- type,- comment,- result,- payload- )-VALUES- (- 101,- 1,- 1,- 101,- 'Welcome',- 'FAILED',- 'bb.task.general',- '',- '{"detail":"Something is not right..."}',- '{}'- );--INSERT INTO- task_run (- id,- creator_id,- updater_id,- task_id,- name,- status,- type,- comment,- payload- )-VALUES- (- 102,- 1,- 1,- 101,- 'Welcome',- 'RUNNING',- 'bb.task.general',- 'Let''s give another try',- '{}'- );--ALTER SEQUENCE task_run_id_seq RESTART WITH 103;---- Create issue 101 "Hello world"-INSERT INTO- issue (- id,- creator_id,- updater_id,- project_id,- pipeline_id,- name,- status,- type,- description,- assignee_id- )-VALUES- (- 101,- 1,- 1,- 1,- 101,- 'Hello world!',- 'OPEN',- 'bb.issue.general',- 'Welcome to Bytebase, this is the issue interface where developers and DBAs collaborate on database schema management issues such as: '||chr(10)||' - Creating a new database'||chr(10)||' - Creating a table'||chr(10)||' - Creating an index'||chr(10)||' - Adding/Altering a column'||chr(10)||' - Troubleshooting performance issue'||chr(10)||'Let''s try some simple tasks:'||chr(10)||'1. Bookmark this issue by clicking the star icon on the top of this page'||chr(10)||'2. Leave a comment below to greet future customers.',- 1- );--ALTER SEQUENCE issue_id_seq RESTART WITH 102;---- Create activity 101-INSERT INTO- activity (- id,- creator_id,- updater_id,- container_id,- type,- level- )-VALUES- (- 101,- 1,- 1,- 101,- 'bb.issue.create',- 'INFO'- );--INSERT INTO- activity (- id,- creator_id,- updater_id,- container_id,- type,- level,- comment- )-VALUES- (- 102,- 1,- 1,- 101,- 'bb.issue.comment.create',- 'INFO',- 'Go fish!'- );--ALTER SEQUENCE activity_id_seq RESTART WITH 103;