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: migrate task payload to store proto (#12907)
ecmadao9235734cbdbf
diff --git a/backend/api/v1/plan_service.go b/backend/api/v1/plan_service.goindex afc6d8fbce..6467dbf2fe 100644--- a/backend/api/v1/plan_service.go+++ b/backend/api/v1/plan_service.go@@ -406,8 +406,8 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *v1pb.UpdatePlanReif task.Type != api.TaskDatabaseSchemaUpdateGhostSync {return nil}- payload := &api.TaskDatabaseSchemaUpdateGhostSyncPayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseUpdatePayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return status.Errorf(codes.Internal, "failed to unmarshal task payload: %v", err)}newFlags := spec.GetChangeDatabaseConfig().GetGhostFlags()@@ -457,8 +457,8 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *v1pb.UpdatePlanReif task.Type != api.TaskDatabaseDataUpdate {return nil}- payload := &api.TaskDatabaseDataUpdatePayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseUpdatePayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return status.Errorf(codes.Internal, "failed to unmarshal task payload: %v", err)}config, ok := spec.Config.(*v1pb.Plan_Spec_ChangeDatabaseConfig)@@ -478,7 +478,7 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *v1pb.UpdatePlanRe}}if databaseName != nil {- taskPatch.PreUpdateBackupDetail = &api.PreUpdateBackupDetail{+ taskPatch.PreUpdateBackupDetail = &storepb.PreUpdateBackupDetail{Database: *databaseName,}doUpdate = true@@ -558,8 +558,8 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *v1pb.UpdatePlanReif task.Type != api.TaskDatabaseDataExport {return nil}- payload := &api.TaskDatabaseDataExportPayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseDataExportPayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return status.Errorf(codes.Internal, "failed to unmarshal task payload: %v", err)}config, ok := spec.Config.(*v1pb.Plan_Spec_ExportDataConfig)diff --git a/backend/api/v1/plan_service_plan_check.go b/backend/api/v1/plan_service_plan_check.goindex 4d057e8ec1..a0a8c69555 100644--- a/backend/api/v1/plan_service_plan_check.go+++ b/backend/api/v1/plan_service_plan_check.go@@ -259,9 +259,9 @@ func getPlanCheckRunsFromChangeDatabaseConfigForDatabase(ctx context.Context, sreturn planCheckRuns, nil}- preUpdateBackupDetail := (*storepb.PlanCheckRunConfig_PreUpdateBackupDetail)(nil)+ preUpdateBackupDetail := (*storepb.PreUpdateBackupDetail)(nil)if config.PreUpdateBackupDetail != nil {- preUpdateBackupDetail = &storepb.PlanCheckRunConfig_PreUpdateBackupDetail{+ preUpdateBackupDetail = &storepb.PreUpdateBackupDetail{Database: config.PreUpdateBackupDetail.Database,}}diff --git a/backend/api/v1/rollout_service_converter.go b/backend/api/v1/rollout_service_converter.goindex d7879ecad3..1d84d1d5dd 100644--- a/backend/api/v1/rollout_service_converter.go+++ b/backend/api/v1/rollout_service_converter.go@@ -275,9 +275,9 @@ func convertDatabaseLabels(labelsMap map[string]string) (string, error) {if len(labelsMap) > api.DatabaseLabelSizeMax {return "", errors.Errorf("database labels are up to a maximum of %d", api.DatabaseLabelSizeMax)}- var labels []*api.DatabaseLabel+ var labels []*storepb.DatabaseLabelfor k, v := range labelsMap {- labels = append(labels, &api.DatabaseLabel{+ labels = append(labels, &storepb.DatabaseLabel{Key: k,Value: v,})@@ -585,7 +585,7 @@ func convertToDatabaseLabels(labelsJSON string) (map[string]string, error) {if labelsJSON == "" {return nil, nil}- var labels []*api.DatabaseLabel+ var labels []*storepb.DatabaseLabelif err := json.Unmarshal([]byte(labelsJSON), &labels); err != nil {return nil, err}@@ -597,8 +597,8 @@ func convertToDatabaseLabels(labelsJSON string) (map[string]string, error) {}func convertToTaskFromDatabaseCreate(ctx context.Context, s *store.Store, project *store.ProjectMessage, task *store.TaskMessage) (*v1pb.Task, error) {- payload := &api.TaskDatabaseCreatePayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseCreatePayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return nil, errors.Wrapf(err, "failed to unmarshal task payload")}instance, err := s.GetInstanceV2(ctx, &store.FindInstanceMessage{@@ -615,7 +615,7 @@ func convertToTaskFromDatabaseCreate(ctx context.Context, s *store.Store, projecName: fmt.Sprintf("%s%s/%s%d/%s%d/%s%d", common.ProjectNamePrefix, project.ResourceID, common.RolloutPrefix, task.PipelineID, common.StagePrefix, task.StageID, common.TaskPrefix, task.ID),Uid: fmt.Sprintf("%d", task.ID),Title: task.Name,- SpecId: payload.SpecID,+ SpecId: payload.SpecId,Type: convertToTaskType(task.Type),Status: convertToTaskStatus(task.LatestTaskRunStatus, payload.Skipped),SkippedReason: payload.SkippedReason,@@ -626,10 +626,10 @@ func convertToTaskFromDatabaseCreate(ctx context.Context, s *store.Store, projecProject: "",Database: payload.DatabaseName,Table: payload.TableName,- Sheet: getResourceNameForSheet(project, payload.SheetID),+ Sheet: getResourceNameForSheet(project, int(payload.SheetId)),CharacterSet: payload.CharacterSet,Collation: payload.Collation,- Environment: common.FormatEnvironment(payload.EnvironmentID),+ Environment: common.FormatEnvironment(payload.EnvironmentId),Labels: labels,},},@@ -642,8 +642,8 @@ func convertToTaskFromSchemaBaseline(ctx context.Context, s *store.Store, projecif task.DatabaseID == nil {return nil, errors.Errorf("database id is nil")}- payload := &api.TaskDatabaseSchemaBaselinePayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseUpdatePayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return nil, errors.Wrapf(err, "failed to unmarshal task payload")}database, err := s.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: task.DatabaseID, ShowDeleted: true})@@ -657,7 +657,7 @@ func convertToTaskFromSchemaBaseline(ctx context.Context, s *store.Store, projecName: fmt.Sprintf("%s%s/%s%d/%s%d/%s%d", common.ProjectNamePrefix, project.ResourceID, common.RolloutPrefix, task.PipelineID, common.StagePrefix, task.StageID, common.TaskPrefix, task.ID),Uid: fmt.Sprintf("%d", task.ID),Title: task.Name,- SpecId: payload.SpecID,+ SpecId: payload.SpecId,Type: convertToTaskType(task.Type),Status: convertToTaskStatus(task.LatestTaskRunStatus, payload.Skipped),SkippedReason: payload.SkippedReason,@@ -676,8 +676,8 @@ func convertToTaskFromSchemaUpdate(ctx context.Context, s *store.Store, projectif task.DatabaseID == nil {return nil, errors.Errorf("database id is nil")}- payload := &api.TaskDatabaseSchemaUpdatePayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseUpdatePayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return nil, errors.Wrapf(err, "failed to unmarshal task payload")}database, err := s.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: task.DatabaseID, ShowDeleted: true})@@ -692,7 +692,7 @@ func convertToTaskFromSchemaUpdate(ctx context.Context, s *store.Store, projectName: fmt.Sprintf("%s%s/%s%d/%s%d/%s%d", common.ProjectNamePrefix, project.ResourceID, common.RolloutPrefix, task.PipelineID, common.StagePrefix, task.StageID, common.TaskPrefix, task.ID),Uid: fmt.Sprintf("%d", task.ID),Title: task.Name,- SpecId: payload.SpecID,+ SpecId: payload.SpecId,Type: convertToTaskType(task.Type),Status: convertToTaskStatus(task.LatestTaskRunStatus, payload.Skipped),SkippedReason: payload.SkippedReason,@@ -700,7 +700,7 @@ func convertToTaskFromSchemaUpdate(ctx context.Context, s *store.Store, projectTarget: fmt.Sprintf("%s%s/%s%s", common.InstanceNamePrefix, database.InstanceID, common.DatabaseIDPrefix, database.DatabaseName),Payload: &v1pb.Task_DatabaseSchemaUpdate_{DatabaseSchemaUpdate: &v1pb.Task_DatabaseSchemaUpdate{- Sheet: getResourceNameForSheet(project, payload.SheetID),+ Sheet: getResourceNameForSheet(project, int(payload.SheetId)),SchemaVersion: payload.SchemaVersion,},},@@ -712,8 +712,8 @@ func convertToTaskFromSchemaUpdateGhostCutover(ctx context.Context, s *store.Stoif task.DatabaseID == nil {return nil, errors.Errorf("database id is nil")}- payload := &api.TaskDatabaseSchemaUpdateGhostCutoverPayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseUpdatePayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return nil, errors.Wrapf(err, "failed to unmarshal task payload")}database, err := s.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: task.DatabaseID, ShowDeleted: true})@@ -727,7 +727,7 @@ func convertToTaskFromSchemaUpdateGhostCutover(ctx context.Context, s *store.StoName: fmt.Sprintf("%s%s/%s%d/%s%d/%s%d", common.ProjectNamePrefix, project.ResourceID, common.RolloutPrefix, task.PipelineID, common.StagePrefix, task.StageID, common.TaskPrefix, task.ID),Uid: fmt.Sprintf("%d", task.ID),Title: task.Name,- SpecId: payload.SpecID,+ SpecId: payload.SpecId,Status: convertToTaskStatus(task.LatestTaskRunStatus, payload.Skipped),SkippedReason: payload.SkippedReason,Type: convertToTaskType(task.Type),@@ -742,8 +742,8 @@ func convertToTaskFromDataUpdate(ctx context.Context, s *store.Store, project *sif task.DatabaseID == nil {return nil, errors.Errorf("database id is nil")}- payload := &api.TaskDatabaseDataUpdatePayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseUpdatePayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return nil, errors.Wrapf(err, "failed to unmarshal task payload")}database, err := s.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: task.DatabaseID, ShowDeleted: true})@@ -758,7 +758,7 @@ func convertToTaskFromDataUpdate(ctx context.Context, s *store.Store, project *sName: fmt.Sprintf("%s%s/%s%d/%s%d/%s%d", common.ProjectNamePrefix, project.ResourceID, common.RolloutPrefix, task.PipelineID, common.StagePrefix, task.StageID, common.TaskPrefix, task.ID),Uid: fmt.Sprintf("%d", task.ID),Title: task.Name,- SpecId: payload.SpecID,+ SpecId: payload.SpecId,Type: convertToTaskType(task.Type),Status: convertToTaskStatus(task.LatestTaskRunStatus, payload.Skipped),SkippedReason: payload.SkippedReason,@@ -768,7 +768,7 @@ func convertToTaskFromDataUpdate(ctx context.Context, s *store.Store, project *s}v1pbTaskPayload := &v1pb.Task_DatabaseDataUpdate_{DatabaseDataUpdate: &v1pb.Task_DatabaseDataUpdate{- Sheet: getResourceNameForSheet(project, payload.SheetID),+ Sheet: getResourceNameForSheet(project, int(payload.SheetId)),SchemaVersion: payload.SchemaVersion,},}@@ -781,8 +781,8 @@ func convertToTaskFromDatabaseDataExport(ctx context.Context, s *store.Store, prif task.DatabaseID == nil {return nil, errors.Errorf("database id is nil")}- payload := &api.TaskDatabaseDataExportPayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseDataExportPayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return nil, errors.Wrapf(err, "failed to unmarshal task payload")}database, err := s.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: task.DatabaseID, ShowDeleted: true})@@ -793,7 +793,7 @@ func convertToTaskFromDatabaseDataExport(ctx context.Context, s *store.Store, prreturn nil, errors.Errorf("database not found")}targetDatabaseName := fmt.Sprintf("%s%s/%s%s", common.InstanceNamePrefix, database.InstanceID, common.DatabaseIDPrefix, database.DatabaseName)- sheet := getResourceNameForSheet(project, payload.SheetID)+ sheet := getResourceNameForSheet(project, int(payload.SheetId))v1pbTaskPayload := v1pb.Task_DatabaseDataExport_{DatabaseDataExport: &v1pb.Task_DatabaseDataExport{Target: targetDatabaseName,@@ -806,7 +806,7 @@ func convertToTaskFromDatabaseDataExport(ctx context.Context, s *store.Store, prName: fmt.Sprintf("%s%s/%s%d/%s%d/%s%d", common.ProjectNamePrefix, project.ResourceID, common.RolloutPrefix, task.PipelineID, common.StagePrefix, task.StageID, common.TaskPrefix, task.ID),Uid: fmt.Sprintf("%d", task.ID),Title: task.Name,- SpecId: payload.SpecID,+ SpecId: payload.SpecId,Type: convertToTaskType(task.Type),Status: convertToTaskStatus(task.LatestTaskRunStatus, false),Target: targetDatabaseName,diff --git a/backend/api/v1/rollout_service_task.go b/backend/api/v1/rollout_service_task.goindex 1e2e5dd64d..c3ba8d4c14 100644--- a/backend/api/v1/rollout_service_task.go+++ b/backend/api/v1/rollout_service_task.go@@ -9,6 +9,7 @@ import ("log/slog""github.com/pkg/errors"+ "google.golang.org/protobuf/encoding/protojson""google.golang.org/protobuf/proto""github.com/bytebase/bytebase/backend/common"@@ -282,18 +283,18 @@ func getTaskCreatesFromCreateDatabaseConfig(ctx context.Context, s *store.Store,return nil, errors.Wrap(err, "failed to create database creation sheet")}- payload := api.TaskDatabaseCreatePayload{- SpecID: spec.Id,- ProjectID: project.UID,+ payload := &storepb.TaskDatabaseCreatePayload{+ SpecId: spec.Id,+ ProjectId: int32(project.UID),CharacterSet: c.CharacterSet,TableName: c.Table,Collation: c.Collation,- EnvironmentID: dbEnvironmentID,+ EnvironmentId: dbEnvironmentID,Labels: labelsJSON,DatabaseName: databaseName,- SheetID: sheet.UID,+ SheetId: int32(sheet.UID),}- bytes, err := json.Marshal(payload)+ bytes, err := protojson.Marshal(payload)if err != nil {return nil, errors.Wrap(err, "failed to create database creation task, unable to marshal payload")}@@ -366,15 +367,15 @@ func getTaskCreatesFromExportDataConfig(ctx context.Context, s *store.Store, speif err != nil {return nil, nil, errors.Wrapf(err, "failed to get sheet id from sheet %q", c.Sheet)}- payload := api.TaskDatabaseDataExportPayload{- SpecID: spec.Id,- SheetID: sheetUID,+ payload := &storepb.TaskDatabaseDataExportPayload{+ SpecId: spec.Id,+ SheetId: int32(sheetUID),Format: c.Format,}if c.Password != nil {payload.Password = *c.Password}- bytes, err := json.Marshal(payload)+ bytes, err := protojson.Marshal(payload)if err != nil {return nil, nil, errors.Wrapf(err, "failed to marshal task database data export payload")}@@ -423,11 +424,11 @@ func getTaskCreatesFromChangeDatabaseConfigDatabaseTarget(ctx context.Context, sswitch c.Type {case storepb.PlanConfig_ChangeDatabaseConfig_BASELINE:- payload := api.TaskDatabaseSchemaBaselinePayload{- SpecID: spec.Id,+ payload := &storepb.TaskDatabaseUpdatePayload{+ SpecId: spec.Id,SchemaVersion: getOrDefaultSchemaVersion(c.SchemaVersion),}- bytes, err := json.Marshal(payload)+ bytes, err := protojson.Marshal(payload)if err != nil {return nil, nil, errors.Wrapf(err, "failed to marshal task database schema baseline payload")}@@ -447,12 +448,12 @@ func getTaskCreatesFromChangeDatabaseConfigDatabaseTarget(ctx context.Context, sif err != nil {return nil, nil, errors.Wrapf(err, "failed to get sheet id from sheet %q", c.Sheet)}- payload := api.TaskDatabaseSchemaUpdatePayload{- SpecID: spec.Id,- SheetID: sheetUID,+ payload := &storepb.TaskDatabaseUpdatePayload{+ SpecId: spec.Id,+ SheetId: int32(sheetUID),SchemaVersion: getOrDefaultSchemaVersion(c.SchemaVersion),}- bytes, err := json.Marshal(payload)+ bytes, err := protojson.Marshal(payload)if err != nil {return nil, nil, errors.Wrapf(err, "failed to marshal task database schema update payload")}@@ -472,12 +473,12 @@ func getTaskCreatesFromChangeDatabaseConfigDatabaseTarget(ctx context.Context, sif err != nil {return nil, nil, errors.Wrapf(err, "failed to get sheet id from sheet %q", c.Sheet)}- payload := api.TaskDatabaseSchemaUpdateSDLPayload{- SpecID: spec.Id,- SheetID: sheetUID,+ payload := &storepb.TaskDatabaseUpdatePayload{+ SpecId: spec.Id,+ SheetId: int32(sheetUID),SchemaVersion: getOrDefaultSchemaVersion(c.SchemaVersion),}- bytes, err := json.Marshal(payload)+ bytes, err := protojson.Marshal(payload)if err != nil {return nil, nil, errors.Wrapf(err, "failed to marshal database schema update SDL payload")}@@ -502,9 +503,9 @@ func getTaskCreatesFromChangeDatabaseConfigDatabaseTarget(ctx context.Context, s}var taskCreateList []*store.TaskMessage// task "sync"- payloadSync := api.TaskDatabaseSchemaUpdateGhostSyncPayload{- SpecID: spec.Id,- SheetID: sheetUID,+ payloadSync := &storepb.TaskDatabaseUpdatePayload{+ SpecId: spec.Id,+ SheetId: int32(sheetUID),SchemaVersion: getOrDefaultSchemaVersion(c.SchemaVersion),Flags: c.GhostFlags,}@@ -522,10 +523,10 @@ func getTaskCreatesFromChangeDatabaseConfigDatabaseTarget(ctx context.Context, s})// task "cutover"- payloadCutover := api.TaskDatabaseSchemaUpdateGhostCutoverPayload{- SpecID: spec.Id,+ payloadCutover := &storepb.TaskDatabaseUpdatePayload{+ SpecId: spec.Id,}- bytesCutover, err := json.Marshal(payloadCutover)+ bytesCutover, err := protojson.Marshal(payloadCutover)if err != nil {return nil, nil, errors.Wrapf(err, "failed to marshal database schema update ghost cutover payload")}@@ -550,17 +551,17 @@ func getTaskCreatesFromChangeDatabaseConfigDatabaseTarget(ctx context.Context, sif err != nil {return nil, nil, errors.Wrapf(err, "failed to get sheet id from sheet %q", c.Sheet)}- preUpdateBackupDetail := api.PreUpdateBackupDetail{}+ preUpdateBackupDetail := &storepb.PreUpdateBackupDetail{}if c.GetPreUpdateBackupDetail().GetDatabase() != "" {preUpdateBackupDetail.Database = c.GetPreUpdateBackupDetail().GetDatabase()}- payload := api.TaskDatabaseDataUpdatePayload{- SpecID: spec.Id,- SheetID: sheetUID,+ payload := &storepb.TaskDatabaseUpdatePayload{+ SpecId: spec.Id,+ SheetId: int32(sheetUID),SchemaVersion: getOrDefaultSchemaVersion(c.SchemaVersion),PreUpdateBackupDetail: preUpdateBackupDetail,}- bytes, err := json.Marshal(payload)+ bytes, err := protojson.Marshal(payload)if err != nil {return nil, nil, errors.Wrapf(err, "Failed to marshal database data update payload")}diff --git a/backend/legacyapi/label.go b/backend/legacyapi/label.goindex ae2bc0e66c..8d6667fa58 100644--- a/backend/legacyapi/label.go+++ b/backend/legacyapi/label.go@@ -10,9 +10,3 @@ const (DatabaseLabelSizeMax = 4labelLengthMax = 63)--// DatabaseLabel is the label associated with a database.-type DatabaseLabel struct {- Key string `json:"key"`- Value string `json:"value"`-}diff --git a/backend/legacyapi/task.go b/backend/legacyapi/task.goindex cee8342983..048866e34d 100644--- a/backend/legacyapi/task.go+++ b/backend/legacyapi/task.go@@ -56,110 +56,6 @@ const (// So we annotate with json tag using camelCase naming which is consistent with normal// json naming convention-// TaskDatabaseCreatePayload is the task payload for creating databases.-type TaskDatabaseCreatePayload struct {- // Common fields- Skipped bool `json:"skipped,omitempty"`- SkippedReason string `json:"skippedReason,omitempty"`- SpecID string `json:"specId,omitempty"`-- // The project owning the database.- ProjectID int `json:"projectId,omitempty"`- DatabaseName string `json:"databaseName,omitempty"`- TableName string `json:"tableName,omitempty"`- SheetID int `json:"sheetId,omitempty"`- CharacterSet string `json:"character,omitempty"`- Collation string `json:"collation,omitempty"`- EnvironmentID string `json:"environmentId,omitempty"`- Labels string `json:"labels,omitempty"`-}--// TaskDatabaseSchemaBaselinePayload is the task payload for database schema baseline.-type TaskDatabaseSchemaBaselinePayload struct {- // Common fields- Skipped bool `json:"skipped,omitempty"`- SkippedReason string `json:"skippedReason,omitempty"`- SpecID string `json:"specId,omitempty"`-- SchemaVersion string `json:"schemaVersion,omitempty"`-}--// TaskDatabaseSchemaUpdatePayload is the task payload for database schema update (DDL).-type TaskDatabaseSchemaUpdatePayload struct {- // Common fields- Skipped bool `json:"skipped,omitempty"`- SkippedReason string `json:"skippedReason,omitempty"`- SpecID string `json:"specId,omitempty"`-- SheetID int `json:"sheetId,omitempty"`- SchemaVersion string `json:"schemaVersion,omitempty"`-}--// TaskDatabaseSchemaUpdateSDLPayload is the task payload for database schema update (SDL).-type TaskDatabaseSchemaUpdateSDLPayload struct {- // Common fields- Skipped bool `json:"skipped,omitempty"`- SkippedReason string `json:"skippedReason,omitempty"`- SpecID string `json:"specId,omitempty"`-- SheetID int `json:"sheetId,omitempty"`- SchemaVersion string `json:"schemaVersion,omitempty"`-}--// TaskDatabaseSchemaUpdateGhostSyncPayload is the task payload for gh-ost syncing ghost table.-type TaskDatabaseSchemaUpdateGhostSyncPayload struct {- // Common fields- Skipped bool `json:"skipped,omitempty"`- SkippedReason string `json:"skippedReason,omitempty"`- SpecID string `json:"specId,omitempty"`-- SheetID int `json:"sheetId,omitempty"`- SchemaVersion string `json:"schemaVersion,omitempty"`-- Flags map[string]string `json:"flags,omitempty"`- // SocketFileName is the socket file that gh-ost listens on.- // The name follows this template,- // `./tmp/gh-ost.{{ISSUE_ID}}.{{TASK_ID}}.{{DATABASE_ID}}.{{DATABASE_NAME}}.{{TABLE_NAME}}.sock`- // SocketFileName will be composed when needed. We don't store it explicitly.-}--// TaskDatabaseSchemaUpdateGhostCutoverPayload is the task payload for gh-ost switching the original table and the ghost table.-type TaskDatabaseSchemaUpdateGhostCutoverPayload struct {- // Common fields- Skipped bool `json:"skipped,omitempty"`- SkippedReason string `json:"skippedReason,omitempty"`- SpecID string `json:"specId,omitempty"`-}--// TaskDatabaseDataUpdatePayload is the task payload for database data update (DML).-type TaskDatabaseDataUpdatePayload struct {- // Common fields- Skipped bool `json:"skipped,omitempty"`- SkippedReason string `json:"skippedReason,omitempty"`- SpecID string `json:"specId,omitempty"`-- SheetID int `json:"sheetId,omitempty"`- SchemaVersion string `json:"schemaVersion,omitempty"`-- PreUpdateBackupDetail PreUpdateBackupDetail `json:"preUpdateBackupDetail,omitempty"`-}--type PreUpdateBackupDetail struct {- // The database for keeping the backup data.- // Format: instances/{instance}/databases/{database}- Database string `json:"database,omitempty"`-}--// TaskDatabaseDataExportPayload is the task payload for database data export.-type TaskDatabaseDataExportPayload struct {- // Common fields- SpecID string `json:"specId,omitempty"`-- SheetID int `json:"sheetId,omitempty"`- Format storepb.ExportFormat `json:"format,omitempty"`- Password string `json:"password,omitempty"`-}-// Progress is a generalized struct which can track the progress of a task.type Progress struct {// TotalUnit is the total unit count of the task@@ -223,7 +119,7 @@ type TaskPatch struct {SchemaVersion *stringExportFormat *storepb.ExportFormatExportPassword *string- PreUpdateBackupDetail *PreUpdateBackupDetail+ PreUpdateBackupDetail *storepb.PreUpdateBackupDetail// Flags for gh-ost.Flags *map[string]stringdiff --git a/backend/plugin/advisor/advisor.go b/backend/plugin/advisor/advisor.goindex 423a89f43c..3b84e7e8b8 100644--- a/backend/plugin/advisor/advisor.go+++ b/backend/plugin/advisor/advisor.go@@ -49,7 +49,7 @@ type Context struct {DBSchema *storepb.DatabaseSchemaMetadataSyntaxMode SyntaxModeChangeType storepb.PlanCheckRunConfig_ChangeDatabaseType- PreUpdateBackupDetail *storepb.PlanCheckRunConfig_PreUpdateBackupDetail+ PreUpdateBackupDetail *storepb.PreUpdateBackupDetail// SQL review rule special fields.AST anydiff --git a/backend/plugin/advisor/sql_review.go b/backend/plugin/advisor/sql_review.goindex 5fb65bf187..8d3b2c2dd1 100644--- a/backend/plugin/advisor/sql_review.go+++ b/backend/plugin/advisor/sql_review.go@@ -480,7 +480,7 @@ type SQLReviewCheckContext struct {Catalog catalogInterfaceDriver *sql.DBContext context.Context- PreUpdateBackupDetail *storepb.PlanCheckRunConfig_PreUpdateBackupDetail+ PreUpdateBackupDetail *storepb.PreUpdateBackupDetail// Snowflake specific fieldsCurrentDatabase stringdiff --git a/backend/runner/approval/runner.go b/backend/runner/approval/runner.goindex adc8566c48..29f74019ac 100644--- a/backend/runner/approval/runner.go+++ b/backend/runner/approval/runner.go@@ -3,7 +3,6 @@ package approvalimport ("context"- "encoding/json""fmt""log/slog""math"@@ -455,13 +454,13 @@ func getDatabaseGeneralIssueRisk(ctx context.Context, s *store.Store, sheetManagenvironmentID := instance.EnvironmentIDvar databaseName stringif task.Type == api.TaskDatabaseCreate {- payload := &api.TaskDatabaseCreatePayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseCreatePayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return 0, store.RiskSourceUnknown, false, err}databaseName = payload.DatabaseName- if payload.EnvironmentID != "" {- environmentID = payload.EnvironmentID+ if payload.EnvironmentId != "" {+ environmentID = payload.EnvironmentId}} else {database, err := s.GetDatabaseV2(ctx, &store.FindDatabaseMessage{@@ -603,8 +602,8 @@ func getDatabaseDataExportIssueRisk(ctx context.Context, s *store.Store, sheetMacontinue}- payload := &api.TaskDatabaseDataExportPayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseDataExportPayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return 0, store.RiskSourceUnknown, false, err}diff --git a/backend/runner/taskrun/data_export_executor.go b/backend/runner/taskrun/data_export_executor.goindex 7c02b6bb42..fe1afa047d 100644--- a/backend/runner/taskrun/data_export_executor.go+++ b/backend/runner/taskrun/data_export_executor.go@@ -2,7 +2,6 @@ package taskrunimport ("context"- "encoding/json""fmt""time"@@ -14,7 +13,6 @@ import ("github.com/bytebase/bytebase/backend/component/dbfactory""github.com/bytebase/bytebase/backend/component/state"enterprise "github.com/bytebase/bytebase/backend/enterprise/api"- api "github.com/bytebase/bytebase/backend/legacyapi""github.com/bytebase/bytebase/backend/plugin/parser/base""github.com/bytebase/bytebase/backend/runner/schemasync"storepb "github.com/bytebase/bytebase/proto/generated-go/store"@@ -54,8 +52,8 @@ func (exec *DataExportExecutor) RunOnce(ctx context.Context, _ context.Context,})ctx = context.WithValue(ctx, common.PrincipalIDContextKey, task.CreatorID)- payload := &api.TaskDatabaseDataExportPayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseDataExportPayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return true, nil, errors.Wrap(err, "invalid database data export payload")}@@ -74,7 +72,7 @@ func (exec *DataExportExecutor) RunOnce(ctx context.Context, _ context.Context,return true, nil, errors.Errorf("instance not found")}- statement, err := exec.store.GetSheetStatementByID(ctx, payload.SheetID)+ statement, err := exec.store.GetSheetStatementByID(ctx, int(payload.SheetId))if err != nil {return true, nil, err}diff --git a/backend/runner/taskrun/data_update_executor.go b/backend/runner/taskrun/data_update_executor.goindex 615a680b66..1c875566c3 100644--- a/backend/runner/taskrun/data_update_executor.go+++ b/backend/runner/taskrun/data_update_executor.go@@ -2,7 +2,6 @@ package taskrunimport ("context"- "encoding/json""fmt""log/slog""time"@@ -58,8 +57,8 @@ func (exec *DataUpdateExecutor) RunOnce(ctx context.Context, driverCtx context.CUpdateTime: time.Now(),})- payload := &api.TaskDatabaseDataUpdatePayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseUpdatePayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return true, nil, errors.Wrap(err, "invalid database data update payload")}@@ -72,7 +71,8 @@ func (exec *DataUpdateExecutor) RunOnce(ctx context.Context, driverCtx context.Creturn true, nil, err}- statement, err := exec.store.GetSheetStatementByID(ctx, payload.SheetID)+ sheetID := int(payload.SheetId)+ statement, err := exec.store.GetSheetStatementByID(ctx, sheetID)if err != nil {return true, nil, err}@@ -80,7 +80,7 @@ func (exec *DataUpdateExecutor) RunOnce(ctx context.Context, driverCtx context.Creturn true, nil, err}version := model.Version{Version: payload.SchemaVersion}- terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.profile, task, taskRunUID, db.Data, statement, version, &payload.SheetID)+ terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.profile, task, taskRunUID, db.Data, statement, version, &sheetID)// sync database schema anywaysexec.store.CreateTaskRunLogS(ctx, taskRunUID, time.Now(), &storepb.TaskRunLog{Type: storepb.TaskRunLog_DATABASE_SYNC_START,@@ -113,7 +113,7 @@ func (exec *DataUpdateExecutor) backupData(ctx context.Context,driverCtx context.Context,statement string,- payload *api.TaskDatabaseDataUpdatePayload,+ payload *storepb.TaskDatabaseUpdatePayload,task *store.TaskMessage,) error {if payload.PreUpdateBackupDetail.Database == "" {diff --git a/backend/runner/taskrun/database_create_executor.go b/backend/runner/taskrun/database_create_executor.goindex fb0cd1a622..70adca0243 100644--- a/backend/runner/taskrun/database_create_executor.go+++ b/backend/runner/taskrun/database_create_executor.go@@ -61,20 +61,21 @@ func (exec *DatabaseCreateExecutor) RunOnce(ctx context.Context, driverCtx conteUpdateTime: time.Now(),})- payload := &api.TaskDatabaseCreatePayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseCreatePayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return true, nil, errors.Wrap(err, "invalid create database payload")}- statement, err := exec.store.GetSheetStatementByID(ctx, payload.SheetID)+ sheetID := int(payload.SheetId)+ statement, err := exec.store.GetSheetStatementByID(ctx, sheetID)if err != nil {- return true, nil, errors.Wrapf(err, "failed to get sheet statement of sheet: %d", payload.SheetID)+ return true, nil, errors.Wrapf(err, "failed to get sheet statement of sheet: %d", sheetID)}- sheet, err := exec.store.GetSheet(ctx, &store.FindSheetMessage{UID: &payload.SheetID})+ sheet, err := exec.store.GetSheet(ctx, &store.FindSheetMessage{UID: &sheetID})if err != nil {- return true, nil, errors.Wrapf(err, "failed to get sheet: %d", payload.SheetID)+ return true, nil, errors.Wrapf(err, "failed to get sheet: %d", sheetID)}if sheet == nil {- return true, nil, errors.Errorf("sheet not found: %d", payload.SheetID)+ return true, nil, errors.Errorf("sheet not found: %d", sheetID)}statement = strings.TrimSpace(statement)@@ -91,12 +92,13 @@ func (exec *DatabaseCreateExecutor) RunOnce(ctx context.Context, driverCtx contereturn true, nil, errors.Errorf("Creating database is not supported")}- project, err := exec.store.GetProjectV2(ctx, &store.FindProjectMessage{UID: &payload.ProjectID})+ projectID := int(payload.ProjectId)+ project, err := exec.store.GetProjectV2(ctx, &store.FindProjectMessage{UID: &projectID})if err != nil {- return true, nil, errors.Errorf("failed to find project with ID %d", payload.ProjectID)+ return true, nil, errors.Errorf("failed to find project with ID %d", projectID)}if project == nil {- return true, nil, errors.Errorf("project not found with ID %d", payload.ProjectID)+ return true, nil, errors.Errorf("project not found with ID %d", projectID)}// Create database.@@ -110,7 +112,7 @@ func (exec *DatabaseCreateExecutor) RunOnce(ctx context.Context, driverCtx conte// The sync status is NOT_FOUND, which will be updated to OK if succeeds.labels := make(map[string]string)if payload.Labels != "" {- var databaseLabels []*api.DatabaseLabel+ var databaseLabels []*storepb.DatabaseLabelif err := json.Unmarshal([]byte(payload.Labels), &databaseLabels); err != nil {return true, nil, err}@@ -122,7 +124,7 @@ func (exec *DatabaseCreateExecutor) RunOnce(ctx context.Context, driverCtx conteProjectID: project.ResourceID,InstanceID: instance.ResourceID,DatabaseName: payload.DatabaseName,- EnvironmentID: payload.EnvironmentID,+ EnvironmentID: payload.EnvironmentId,SyncState: api.NotFound,SuccessfulSyncTimeTs: time.Now().Unix(),Metadata: &storepb.DatabaseMetadata{@@ -168,8 +170,8 @@ func (exec *DatabaseCreateExecutor) RunOnce(ctx context.Context, driverCtx conte})environmentID := instance.EnvironmentID- if payload.EnvironmentID != "" {- environmentID = payload.EnvironmentID+ if payload.EnvironmentId != "" {+ environmentID = payload.EnvironmentId}environment, err := exec.store.GetEnvironmentV2(ctx, &store.FindEnvironmentMessage{ResourceID: &environmentID})if err != nil {diff --git a/backend/runner/taskrun/schema_baseline_executor.go b/backend/runner/taskrun/schema_baseline_executor.goindex a7e49740a1..aa943ae0d0 100644--- a/backend/runner/taskrun/schema_baseline_executor.go+++ b/backend/runner/taskrun/schema_baseline_executor.go@@ -2,18 +2,17 @@ package taskrunimport ("context"- "encoding/json""log/slog""time""github.com/pkg/errors"+ "github.com/bytebase/bytebase/backend/common""github.com/bytebase/bytebase/backend/common/log""github.com/bytebase/bytebase/backend/component/config""github.com/bytebase/bytebase/backend/component/dbfactory""github.com/bytebase/bytebase/backend/component/state"enterprise "github.com/bytebase/bytebase/backend/enterprise/api"- api "github.com/bytebase/bytebase/backend/legacyapi""github.com/bytebase/bytebase/backend/plugin/db""github.com/bytebase/bytebase/backend/runner/schemasync""github.com/bytebase/bytebase/backend/store"@@ -52,8 +51,8 @@ func (exec *SchemaBaselineExecutor) RunOnce(ctx context.Context, driverCtx conteUpdateTime: time.Now(),})- payload := &api.TaskDatabaseSchemaBaselinePayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseUpdatePayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return true, nil, errors.Wrap(err, "invalid database schema baseline payload")}diff --git a/backend/runner/taskrun/schema_update_executor.go b/backend/runner/taskrun/schema_update_executor.goindex 63052fdd83..976fa25f67 100644--- a/backend/runner/taskrun/schema_update_executor.go+++ b/backend/runner/taskrun/schema_update_executor.go@@ -2,18 +2,17 @@ package taskrunimport ("context"- "encoding/json""log/slog""time""github.com/pkg/errors"+ "github.com/bytebase/bytebase/backend/common""github.com/bytebase/bytebase/backend/common/log""github.com/bytebase/bytebase/backend/component/config""github.com/bytebase/bytebase/backend/component/dbfactory""github.com/bytebase/bytebase/backend/component/state"enterprise "github.com/bytebase/bytebase/backend/enterprise/api"- api "github.com/bytebase/bytebase/backend/legacyapi""github.com/bytebase/bytebase/backend/plugin/db""github.com/bytebase/bytebase/backend/runner/schemasync""github.com/bytebase/bytebase/backend/store"@@ -52,8 +51,8 @@ func (exec *SchemaUpdateExecutor) RunOnce(ctx context.Context, driverCtx contextUpdateTime: time.Now(),})- payload := &api.TaskDatabaseSchemaUpdatePayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseUpdatePayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return true, nil, errors.Wrap(err, "invalid database schema update payload")}@@ -66,13 +65,14 @@ func (exec *SchemaUpdateExecutor) RunOnce(ctx context.Context, driverCtx contextreturn true, nil, err}- statement, err := exec.store.GetSheetStatementByID(ctx, payload.SheetID)+ sheetID := int(payload.SheetId)+ statement, err := exec.store.GetSheetStatementByID(ctx, sheetID)if err != nil {return true, nil, err}version := model.Version{Version: payload.SchemaVersion}- terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.profile, task, taskRunUID, db.Migrate, statement, version, &payload.SheetID)+ terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.profile, task, taskRunUID, db.Migrate, statement, version, &sheetID)// sync database schema anywaysexec.store.CreateTaskRunLogS(ctx, taskRunUID, time.Now(), &storepb.TaskRunLog{Type: storepb.TaskRunLog_DATABASE_SYNC_START,diff --git a/backend/runner/taskrun/schema_update_ghost_cutover_executor.go b/backend/runner/taskrun/schema_update_ghost_cutover_executor.goindex 596b1ebe9f..68f3b0967d 100644--- a/backend/runner/taskrun/schema_update_ghost_cutover_executor.go+++ b/backend/runner/taskrun/schema_update_ghost_cutover_executor.go@@ -2,7 +2,6 @@ package taskrunimport ("context"- "encoding/json""log/slog""os""strings"@@ -19,7 +18,6 @@ import ("github.com/bytebase/bytebase/backend/component/ghost""github.com/bytebase/bytebase/backend/component/state"enterprise "github.com/bytebase/bytebase/backend/enterprise/api"- api "github.com/bytebase/bytebase/backend/legacyapi""github.com/bytebase/bytebase/backend/plugin/db""github.com/bytebase/bytebase/backend/runner/schemasync""github.com/bytebase/bytebase/backend/store"@@ -79,13 +77,14 @@ func (e *SchemaUpdateGhostCutoverExecutor) RunOnce(ctx context.Context, taskContif err != nil {return true, nil, errors.Wrap(err, "failed to get schema update gh-ost sync task for cutover task")}- payload := &api.TaskDatabaseSchemaUpdateGhostSyncPayload{}- if err := json.Unmarshal([]byte(syncTask.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseUpdatePayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(syncTask.Payload), payload); err != nil {return true, nil, errors.Wrap(err, "invalid database schema update gh-ost sync payload")}- statement, err := e.store.GetSheetStatementByID(ctx, payload.SheetID)+ sheetID := int(payload.SheetId)+ statement, err := e.store.GetSheetStatementByID(ctx, sheetID)if err != nil {- return true, nil, errors.Wrapf(err, "failed to get sheet statement by id: %d", payload.SheetID)+ return true, nil, errors.Wrapf(err, "failed to get sheet statement by id: %d", sheetID)}materials := utils.GetSecretMapFromDatabaseMessage(database)// To avoid leaking the rendered statement, the error message should use the original statement and not the rendered statement.@@ -109,7 +108,7 @@ func (e *SchemaUpdateGhostCutoverExecutor) RunOnce(ctx context.Context, taskCont// not using the rendered statement here because we want to avoid leaking the rendered statementversion := model.Version{Version: payload.SchemaVersion}- terminated, result, err := cutover(ctx, taskContext, e.store, e.dbFactory, e.stateCfg, e.profile, task, taskRunUID, statement, payload.SheetID, version, postponeFilename, sharedGhost.migrationContext, sharedGhost.errCh)+ terminated, result, err := cutover(ctx, taskContext, e.store, e.dbFactory, e.stateCfg, e.profile, task, taskRunUID, statement, sheetID, version, postponeFilename, sharedGhost.migrationContext, sharedGhost.errCh)if err := e.schemaSyncer.SyncDatabaseSchema(ctx, database, false /* force */); err != nil {slog.Error("failed to sync database schema",slog.String("instanceName", instance.ResourceID),diff --git a/backend/runner/taskrun/schema_update_ghost_sync_executor.go b/backend/runner/taskrun/schema_update_ghost_sync_executor.goindex 7b013e39c0..25d27e4227 100644--- a/backend/runner/taskrun/schema_update_ghost_sync_executor.go+++ b/backend/runner/taskrun/schema_update_ghost_sync_executor.go@@ -2,7 +2,6 @@ package taskrunimport ("context"- "encoding/json""log/slog""strings""sync/atomic"@@ -48,11 +47,11 @@ func (exec *SchemaUpdateGhostSyncExecutor) RunOnce(ctx context.Context, taskContUpdateTime: time.Now(),})- payload := &api.TaskDatabaseSchemaUpdateGhostSyncPayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseUpdatePayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return true, nil, errors.Wrap(err, "invalid database schema update gh-ost sync payload")}- statement, err := exec.store.GetSheetStatementByID(ctx, payload.SheetID)+ statement, err := exec.store.GetSheetStatementByID(ctx, int(payload.SheetId))if err != nil {return true, nil, err}diff --git a/backend/runner/taskrun/schema_update_sdl_executor.go b/backend/runner/taskrun/schema_update_sdl_executor.goindex b32373b439..229508637d 100644--- a/backend/runner/taskrun/schema_update_sdl_executor.go+++ b/backend/runner/taskrun/schema_update_sdl_executor.go@@ -2,18 +2,17 @@ package taskrunimport ("context"- "encoding/json""log/slog""time""github.com/pkg/errors"+ "github.com/bytebase/bytebase/backend/common""github.com/bytebase/bytebase/backend/common/log""github.com/bytebase/bytebase/backend/component/config""github.com/bytebase/bytebase/backend/component/dbfactory""github.com/bytebase/bytebase/backend/component/state"enterprise "github.com/bytebase/bytebase/backend/enterprise/api"- api "github.com/bytebase/bytebase/backend/legacyapi""github.com/bytebase/bytebase/backend/plugin/db""github.com/bytebase/bytebase/backend/runner/schemasync""github.com/bytebase/bytebase/backend/runner/utils"@@ -54,12 +53,13 @@ func (exec *SchemaUpdateSDLExecutor) RunOnce(ctx context.Context, driverCtx contUpdateTime: time.Now(),})- payload := &api.TaskDatabaseSchemaUpdateSDLPayload{}- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {+ payload := &storepb.TaskDatabaseUpdatePayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(task.Payload), payload); err != nil {return true, nil, errors.Wrap(err, "invalid database schema update payload")}- statement, err := exec.store.GetSheetStatementByID(ctx, payload.SheetID)+ sheetID := int(payload.SheetId)+ statement, err := exec.store.GetSheetStatementByID(ctx, sheetID)if err != nil {return true, nil, err}@@ -82,7 +82,7 @@ func (exec *SchemaUpdateSDLExecutor) RunOnce(ctx context.Context, driverCtx contif err != nil {return true, nil, errors.Wrap(err, "invalid database schema diff")}- terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.profile, task, taskRunUID, db.MigrateSDL, ddl, version, &payload.SheetID)+ terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.profile, task, taskRunUID, db.MigrateSDL, ddl, version, &sheetID)if err := exec.schemaSyncer.SyncDatabaseSchema(ctx, database, false /* force */); err != nil {slog.Error("failed to sync database schema",diff --git a/frontend/src/components/IssueV1/logic/transition.ts b/frontend/src/components/IssueV1/logic/transition.tsindex a2558de2c3..899c3d8184 100644--- a/frontend/src/components/IssueV1/logic/transition.ts+++ b/frontend/src/components/IssueV1/logic/transition.ts@@ -8,7 +8,6 @@ import type {import { ISSUE_STATUS_TRANSITION_LIST } from "@/types";import { IssueStatus } from "@/types/proto/v1/issue_service";import { Task_Status } from "@/types/proto/v1/rollout_service";-import type { StageStatusTransition, TaskStatusTransition } from "@/utils";import {isDatabaseChangeRelatedIssue,flattenTaskV1List,@@ -87,19 +86,6 @@ export const calcApplicableIssueStatusTransitionList = (return applicableTransitionList;};-export function isApplicableTransition<- T extends- | IssueStatusTransition- | TaskStatusTransition- | StageStatusTransition,->(target: T, list: T[]): boolean {- return (- list.findIndex((applicable) => {- return applicable.to === target.to && applicable.type === target.type;- }) >= 0- );-}-const allowUserToApplyIssueStatusTransition = (issue: ComposedIssue,user: ComposedUserdiff --git a/frontend/src/types/common.ts b/frontend/src/types/common.tsindex 9a7826ecc7..fc08434801 100644--- a/frontend/src/types/common.ts+++ b/frontend/src/types/common.ts@@ -4,8 +4,6 @@ import type { Database } from "./database";import type { Environment } from "./environment";import type { CommandId, CommandRegisterId } from "./id";import type { Instance } from "./instance";-import type { Issue } from "./issue";-import type { Pipeline, Stage, Task, TaskProgress } from "./pipeline";import type { Principal } from "./principal";import type { Project, ProjectMember } from "./project";import type { SQLReviewPolicy } from "./sqlReview";@@ -61,12 +59,7 @@ export type ResourceType =| "INSTANCE"| "DATABASE"| "DATA_SOURCE"- | "ISSUE"- | "PIPELINE"| "POLICY"- | "STAGE"- | "TASK_PROGRESS"- | "TASK"| "ACTIVITY"| "REPOSITORY"| "ANOMALY"@@ -83,11 +76,6 @@ interface ResourceMaker {(type: "INSTANCE"): Instance;(type: "DATABASE"): Database;(type: "DATA_SOURCE"): DataSource;- (type: "ISSUE"): Issue;- (type: "PIPELINE"): Pipeline;- (type: "STAGE"): Stage;- (type: "TASK_PROGRESS"): TaskProgress;- (type: "TASK"): Task;(type: "SQL_REVIEW"): SQLReviewPolicy;}@@ -187,63 +175,6 @@ const makeUnknown = (type: ResourceType) => {updateSsl: false,};- const UNKNOWN_PIPELINE: Pipeline = {- id: UNKNOWN_ID,- name: "<<Unknown pipeline>>",- stageList: [],- };-- const UNKNOWN_ISSUE: Issue = {- id: UNKNOWN_ID,- project: UNKNOWN_PROJECT,- pipeline: UNKNOWN_PIPELINE,- creator: UNKNOWN_PRINCIPAL,- createdTs: 0,- updater: UNKNOWN_PRINCIPAL,- updatedTs: 0,- name: "<<Unknown issue>>",- status: "DONE",- type: "bb.issue.general",- description: "",- subscriberList: [],- payload: {},- };-- const UNKNOWN_STAGE: Stage = {- id: UNKNOWN_ID,- pipeline: UNKNOWN_PIPELINE,- name: "<<Unknown stage>>",- environment: UNKNOWN_ENVIRONMENT,- taskList: [],- };-- const UNKNOWN_TASK_PROGRESS: TaskProgress = {- totalUnit: 0,- completedUnit: 0,- createdTs: 0,- updatedTs: 0,- };-- const UNKNOWN_TASK: Task = {- id: UNKNOWN_ID,- pipeline: UNKNOWN_PIPELINE,- stage: UNKNOWN_STAGE,- creator: UNKNOWN_PRINCIPAL,- createdTs: 0,- updater: UNKNOWN_PRINCIPAL,- updatedTs: 0,- name: "<<Unknown task>>",- type: "bb.task.general",- status: "DONE",- instance: UNKNOWN_INSTANCE,- database: UNKNOWN_DATABASE,- earliestAllowedTs: 0,- taskRunList: [],- taskCheckRunList: [],- blockedBy: [],- progress: { ...UNKNOWN_TASK_PROGRESS },- };-const UNKNOWN_SQL_REVIEW_POLICY: SQLReviewPolicy = {id: `${UNKNOWN_ID}`,enforce: false,@@ -267,16 +198,6 @@ const makeUnknown = (type: ResourceType) => {return UNKNOWN_DATABASE;case "DATA_SOURCE":return UNKNOWN_DATA_SOURCE;- case "ISSUE":- return UNKNOWN_ISSUE;- case "PIPELINE":- return UNKNOWN_PIPELINE;- case "STAGE":- return UNKNOWN_STAGE;- case "TASK_PROGRESS":- return UNKNOWN_TASK_PROGRESS;- case "TASK":- return UNKNOWN_TASK;case "SQL_REVIEW":return UNKNOWN_SQL_REVIEW_POLICY;}@@ -380,63 +301,6 @@ const makeEmpty = (type: ResourceType) => {updateSsl: false,};- const EMPTY_PIPELINE: Pipeline = {- id: EMPTY_ID,- name: "",- stageList: [],- };-- const EMPTY_ISSUE: Issue = {- id: EMPTY_ID,- pipeline: EMPTY_PIPELINE,- project: EMPTY_PROJECT,- creator: EMPTY_PRINCIPAL,- createdTs: 0,- updater: EMPTY_PRINCIPAL,- updatedTs: 0,- name: "",- status: "DONE",- type: "bb.issue.general",- description: "",- subscriberList: [],- payload: {},- };-- const EMPTY_STAGE: Stage = {- id: EMPTY_ID,- pipeline: EMPTY_PIPELINE,- name: "",- environment: EMPTY_ENVIRONMENT,- taskList: [],- };-- const EMPTY_TASK_PROGRESS: TaskProgress = {- totalUnit: 0,- completedUnit: 0,- createdTs: 0,- updatedTs: 0,- };-- const EMPTY_TASK: Task = {- id: EMPTY_ID,- pipeline: EMPTY_PIPELINE,- stage: EMPTY_STAGE,- creator: EMPTY_PRINCIPAL,- createdTs: 0,- updater: EMPTY_PRINCIPAL,- updatedTs: 0,- name: "",- type: "bb.task.general",- status: "DONE",- instance: EMPTY_INSTANCE,- database: EMPTY_DATABASE,- taskRunList: [],- taskCheckRunList: [],- earliestAllowedTs: 0,- blockedBy: [],- progress: { ...EMPTY_TASK_PROGRESS },- };-switch (type) {case "PRINCIPAL":return EMPTY_PRINCIPAL;@@ -452,16 +316,6 @@ const makeEmpty = (type: ResourceType) => {return EMPTY_DATABASE;case "DATA_SOURCE":return EMPTY_DATA_SOURCE;- case "ISSUE":- return EMPTY_ISSUE;- case "PIPELINE":- return EMPTY_PIPELINE;- case "STAGE":- return EMPTY_STAGE;- case "TASK_PROGRESS":- return EMPTY_TASK_PROGRESS;- case "TASK":- return EMPTY_TASK;}};diff --git a/frontend/src/types/id.ts b/frontend/src/types/id.tsindex 89caa8fa87..0850b2433c 100644--- a/frontend/src/types/id.ts+++ b/frontend/src/types/id.ts@@ -8,26 +8,8 @@ export type ExecutionId = IdType;export type PrincipalId = IdType;-export type MemberId = IdType;--export type SettingId = IdType;-export type ProjectId = IdType;-export type ProjectWebhookId = IdType;--export type IssueId = IdType;--export type PipelineId = IdType;--export type StageId = IdType;--export type TaskId = IdType;--export type TaskRunId = IdType;--export type TaskCheckRunId = IdType;-export type EnvironmentId = IdType;export type InstanceId = IdType;@@ -48,8 +30,3 @@ export type CommandId = string;export type CommandRegisterId = string;export type SheetId = IdType;--// This references to the object id, which can be used as a container.-// Currently, only issue can be used a container.-// The type is used by Activity and Message-export type ContainerId = IssueId;diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.tsindex b1c2459b72..bfae3e0acb 100644--- a/frontend/src/types/index.ts+++ b/frontend/src/types/index.ts@@ -15,7 +15,6 @@ export * from "./issue";export * from "./member";export * from "./notification";export * from "./oauth";-export * from "./pipeline";export * from "./plan";export * from "./principal";export * from "./project";diff --git a/frontend/src/types/issue.ts b/frontend/src/types/issue.tsindex 23890ea040..b3b4853178 100644--- a/frontend/src/types/issue.ts+++ b/frontend/src/types/issue.ts@@ -1,9 +1,3 @@-import type { IssueId } from "./id";-import type { Pipeline } from "./pipeline";-import type { Principal } from "./principal";-import type { Project } from "./project";-import type { IssuePayload as IssueProtoPayload } from "./proto/store/issue";-type IssueTypeGeneral = "bb.issue.general";type IssueTypeDataSource = "bb.issue.data-source.request";@@ -28,30 +22,6 @@ export type IssueType =export type IssueStatus = "OPEN" | "DONE" | "CANCELED";-export type IssuePayload = IssueProtoPayload | { [key: string]: any };--export type Issue = {- id: IssueId;-- // Related fields- project: Project;- pipeline?: Pipeline;-- // Standard fields- creator: Principal;- createdTs: number;- updater: Principal;- updatedTs: number;-- // Domain specific fields- name: string;- status: IssueStatus;- type: IssueType;- description: string;- subscriberList: Principal[];- payload: IssuePayload;-};-export type IssueStatusTransitionType = "RESOLVE" | "CANCEL" | "REOPEN";export interface IssueStatusTransition {diff --git a/frontend/src/types/pipeline/index.ts b/frontend/src/types/pipeline/index.tsdeleted file mode 100644index 050cc6b194..0000000000--- a/frontend/src/types/pipeline/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from "./pipeline";-export * from "./stage";-export * from "./task";diff --git a/frontend/src/types/pipeline/pipeline.ts b/frontend/src/types/pipeline/pipeline.tsdeleted file mode 100644index 898fbe9517..0000000000--- a/frontend/src/types/pipeline/pipeline.ts+++ /dev/null@@ -1,48 +0,0 @@-import type { PipelineId } from "../id";-import type { Stage, StageCreate } from "./stage";--/*- An example-- An alter schema PIPELINE- Dev STAGE (db_dev, env_dev)- Change dev database schema-- Testing STAGE (db_test, env_test)- Change testing database schema- Verify integration test pass-- Staging STAGE (db_staging, env_staging)- Approve change- Change staging database schema-- Prod STAGE (db_prod, env_prod)- Approve change- Change prod database schema-*/-// Pipeline-export type PipelineStatus = "OPEN" | "DONE" | "CANCELED";--export type Pipeline = {- id: PipelineId;-- // Related fields- stageList: Stage[];-- // Domain specific fields- name: string;-};--export type PipelineCreate = {- // Related fields- stageList: StageCreate[];-- // Domain specific fields- name: string;-};--export type PipelineStatusPatch = {- // Domain specific fields- status: PipelineStatus;- comment?: string;-};diff --git a/frontend/src/types/pipeline/stage.ts b/frontend/src/types/pipeline/stage.tsdeleted file mode 100644index 3fbba584a5..0000000000--- a/frontend/src/types/pipeline/stage.ts+++ /dev/null@@ -1,38 +0,0 @@-// The database belongs to an instance which in turns belongs to an environment.-import type { Environment } from "../environment";-import type { EnvironmentId, StageId } from "../id";-import type { Pipeline } from "./pipeline";-import type { Task, TaskCreate, TaskStatus } from "./task";--// THus stage can access both instance and environment info.-export type Stage = {- id: StageId;-- // Related fields- taskList: Task[];- pipeline: Pipeline;- environment: Environment;-- // Domain specific fields- name: string;-};--export type StageCreate = {- // Related fields- taskList: TaskCreate[];- environmentId: EnvironmentId;-- // Domain specific fields- name: string;-};--export type StageAllTaskStatusPatch = {- id: StageId;-- status: TaskStatus;- comment?: string;-- updatedTs: number;-};--export type StageStatusUpdateType = "BEGIN" | "END";diff --git a/frontend/src/types/pipeline/task.ts b/frontend/src/types/pipeline/task.tsdeleted file mode 100644index d314a806e7..0000000000--- a/frontend/src/types/pipeline/task.ts+++ /dev/null@@ -1,266 +0,0 @@-import type { ErrorCode, MigrationHistoryId, TaskCheckRunId } from "..";-import type { Database } from "../database";-import type {- DatabaseId,- InstanceId,- ProjectId,- SheetId,- TaskId,- TaskRunId,-} from "../id";-import type { Instance } from "../instance";-import type { Principal } from "../principal";-import type { Pipeline } from "./pipeline";-import type { Stage } from "./stage";--export type TaskType =- | "bb.task.general"- | "bb.task.database.create"- | "bb.task.database.schema.baseline"- | "bb.task.database.schema.update"- | "bb.task.database.schema.update-sdl"- | "bb.task.database.data.update"- | "bb.task.database.schema.update.ghost.sync"- | "bb.task.database.schema.update.ghost.cutover";--export type TaskStatus =- | "PENDING"- | "PENDING_APPROVAL"- | "RUNNING"- | "DONE"- | "FAILED"- | "CANCELED"- | "SKIPPED";--export type TaskGeneralPayload = {- statement: string;- sheetId: SheetId;-};--export type TaskEarliestAllowedTimePayload = {- earliestAllowedTs: number;-};--export type TaskDatabaseCreatePayload = {- skipped: boolean;- skippedReason: string;- projectId: ProjectId;- statement: string;- sheetId: SheetId;- databaseName: string;- characterSet: string;- collation: string;-};--export type TaskDatabaseSchemaBaselinePayload = {- skipped: boolean;- skippedReason: string;- statement: string;- sheetId: SheetId;- schemaVersion: string;-};--export type TaskDatabaseSchemaUpdatePayload = {- skipped: boolean;- skippedReason: string;- statement: string;- sheetId: SheetId;-};--export type TaskDatabaseSchemaUpdateSDLPayload = {- skipped: boolean;- skippedReason: string;- sheetId: SheetId;-};--export type TaskDatabaseSchemaUpdateGhostSyncPayload = {- skipped: boolean;- skippedReason: string;- statement: string;- sheetId: SheetId;-};--export type TaskDatabaseSchemaUpdateGhostCutoverPayload = {- skipped: boolean;- skippedReason: string;-};--export type TaskDatabaseDataUpdatePayload = {- skipped: boolean;- skippedReason: string;- statement: string;- sheetId: SheetId;-};--export type TaskPayload =- | TaskGeneralPayload- | TaskDatabaseCreatePayload- | TaskDatabaseSchemaBaselinePayload- | TaskDatabaseSchemaUpdatePayload- | TaskDatabaseSchemaUpdateGhostSyncPayload- | TaskDatabaseSchemaUpdateGhostCutoverPayload- | TaskDatabaseDataUpdatePayload- | TaskEarliestAllowedTimePayload;--export type TaskProgressPayload = {- comment: string;-};--export type TaskProgress = {- totalUnit: number;- completedUnit: number;- createdTs: number;- updatedTs: number;- payload?: TaskProgressPayload; // JSON encoded-};--export type Task = {- id: TaskId;-- // Related fields- taskRunList: TaskRun[];- taskCheckRunList: TaskCheckRun[];- pipeline: Pipeline;- stage: Stage;-- // Standard fields- creator: Principal;- createdTs: number;- updater: Principal;- updatedTs: number;-- // Domain specific fields- name: string;- status: TaskStatus;- type: TaskType;- instance: Instance;- earliestAllowedTs: number;- // Tasks such as creating database may not have database.- database?: Database;- payload?: TaskPayload;- // Using by grouping batch change.- statement?: string;-- // Task DAG- blockedBy: Task[];-- // Task progress- progress: TaskProgress;-};--export type TaskCreate = {- // Domain specific fields- name: string;- status: TaskStatus;- type: TaskType;- instanceId: InstanceId;- databaseId?: DatabaseId;- sheetId: SheetId;- // statement is only using in UI to show the SQL statement when creating issue.- statement: string;- databaseName?: string;- characterSet?: string;- collation?: string;- earliestAllowedTs: number;-};--export type TaskPatch = {- sheetId?: SheetId;- earliestAllowedTs?: number;- updatedTs?: number;-};--export type TaskStatusPatch = {- // Domain specific fields- status: TaskStatus;- comment?: string;-- updatedTs?: number;-};--// TaskRun is one run of a particular task-export type TaskRunStatus =- | "PENDING"- | "RUNNING"- | "DONE"- | "SKIPPED"- | "FAILED"- | "CANCELED";--export type TaskRunResultPayload = {- detail: string;- migrationId?: MigrationHistoryId;- version?: string;-};--export type TaskRun = {- id: TaskRunId;-- // Standard fields- creator: Principal;- createdTs: number;- updater: Principal;- updatedTs: number;-- // Domain specific fields- name: string;- status: TaskRunStatus;- type: TaskType;- code: ErrorCode;- comment: string;- result: TaskRunResultPayload;- payload?: TaskPayload;-};--export type TaskCheckRunStatus = "RUNNING" | "DONE" | "FAILED" | "CANCELED";--export type TaskCheckType =- | "bb.task-check.database.statement.fake-advise"- | "bb.task-check.database.statement.syntax"- | "bb.task-check.database.statement.compatibility"- | "bb.task-check.database.statement.advise"- | "bb.task-check.database.connect"- | "bb.task-check.database.ghost.sync"- | "bb.task-check.issue.lgtm"- | "bb.task-check.pitr.mysql"- | "bb.task-check.database.statement.type.report"- | "bb.task-check.database.statement.affected-rows.report";--export type TaskCheckStatus = "SUCCESS" | "WARN" | "ERROR";--export type TaskCheckNamespace = "bb.advisor" | "bb.core";--export type TaskCheckResult = {- status: TaskCheckStatus;- code: ErrorCode;- title: string;- content: string;- line: number | undefined;- column: number | undefined;- namespace: TaskCheckNamespace;- details?: string;-};--export type TaskCheckRunResultPayload = {- detail: string;- resultList: TaskCheckResult[];-};--export type TaskCheckRun = {- id: TaskCheckRunId;-- // Standard fields- creator: Principal;- createdTs: number;- updater: Principal;- updatedTs: number;-- // Domain specific fields- taskId: TaskId;- status: TaskCheckRunStatus;- type: TaskCheckType;- code: ErrorCode;- comment: string;- result: TaskCheckRunResultPayload;- payload?: TaskPayload;-};diff --git a/frontend/src/types/proto/store/common.ts b/frontend/src/types/proto/store/common.tsindex 696bf47ac6..936a82dbe9 100644--- a/frontend/src/types/proto/store/common.ts+++ b/frontend/src/types/proto/store/common.ts@@ -447,6 +447,11 @@ export interface Position {column: number;}+export interface DatabaseLabel {+ key: string;+ value: string;+}+function createBasePageToken(): PageToken {return { limit: 0, offset: 0 };}@@ -595,6 +600,80 @@ export const Position = {},};+function createBaseDatabaseLabel(): DatabaseLabel {+ return { key: "", value: "" };+}++export const DatabaseLabel = {+ encode(message: DatabaseLabel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.key !== "") {+ writer.uint32(10).string(message.key);+ }+ if (message.value !== "") {+ writer.uint32(18).string(message.value);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): DatabaseLabel {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseDatabaseLabel();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.key = reader.string();+ continue;+ case 2:+ if (tag !== 18) {+ break;+ }++ message.value = reader.string();+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): DatabaseLabel {+ return {+ key: isSet(object.key) ? globalThis.String(object.key) : "",+ value: isSet(object.value) ? globalThis.String(object.value) : "",+ };+ },++ toJSON(message: DatabaseLabel): unknown {+ const obj: any = {};+ if (message.key !== "") {+ obj.key = message.key;+ }+ if (message.value !== "") {+ obj.value = message.value;+ }+ return obj;+ },++ create(base?: DeepPartial<DatabaseLabel>): DatabaseLabel {+ return DatabaseLabel.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<DatabaseLabel>): DatabaseLabel {+ const message = createBaseDatabaseLabel();+ message.key = object.key ?? "";+ message.value = object.value ?? "";+ return message;+ },+};+type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;export type DeepPartial<T> = T extends Builtin ? Tdiff --git a/frontend/src/types/proto/store/plan_check_run.ts b/frontend/src/types/proto/store/plan_check_run.tsindex 473f024893..5fec8abefc 100644--- a/frontend/src/types/proto/store/plan_check_run.ts+++ b/frontend/src/types/proto/store/plan_check_run.ts@@ -6,6 +6,14 @@ import { ChangedResources } from "./instance_change_history";export const protobufPackage = "bytebase.store";+export interface PreUpdateBackupDetail {+ /**+ * The database for keeping the backup data.+ * Format: instances/{instance}/databases/{database}+ */+ database: string;+}+export interface PlanCheckRunConfig {sheetUid: number;changeDatabaseType: PlanCheckRunConfig_ChangeDatabaseType;@@ -15,7 +23,7 @@ export interface PlanCheckRunConfig {databaseGroupUid?: Long | undefined;ghostFlags: { [key: string]: string };/** If set, a backup of the modified data will be created automatically before any changes are applied. */- preUpdateBackupDetail?: PlanCheckRunConfig_PreUpdateBackupDetail | undefined;+ preUpdateBackupDetail?: PreUpdateBackupDetail | undefined;}export enum PlanCheckRunConfig_ChangeDatabaseType {@@ -92,14 +100,6 @@ export interface PlanCheckRunConfig_GhostFlagsEntry {value: string;}-export interface PlanCheckRunConfig_PreUpdateBackupDetail {- /**- * The database for keeping the backup data.- * Format: instances/{instance}/databases/{database}- */- database: string;-}-export interface PlanCheckRunResult {results: PlanCheckRunResult_Result[];error: string;@@ -197,6 +197,63 @@ export interface PlanCheckRunResult_Result_SqlReviewReport {endPosition: Position | undefined;}+function createBasePreUpdateBackupDetail(): PreUpdateBackupDetail {+ return { database: "" };+}++export const PreUpdateBackupDetail = {+ encode(message: PreUpdateBackupDetail, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.database !== "") {+ writer.uint32(10).string(message.database);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): PreUpdateBackupDetail {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBasePreUpdateBackupDetail();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.database = reader.string();+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): PreUpdateBackupDetail {+ return { database: isSet(object.database) ? globalThis.String(object.database) : "" };+ },++ toJSON(message: PreUpdateBackupDetail): unknown {+ const obj: any = {};+ if (message.database !== "") {+ obj.database = message.database;+ }+ return obj;+ },++ create(base?: DeepPartial<PreUpdateBackupDetail>): PreUpdateBackupDetail {+ return PreUpdateBackupDetail.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<PreUpdateBackupDetail>): PreUpdateBackupDetail {+ const message = createBasePreUpdateBackupDetail();+ message.database = object.database ?? "";+ return message;+ },+};+function createBasePlanCheckRunConfig(): PlanCheckRunConfig {return {sheetUid: 0,@@ -230,7 +287,7 @@ export const PlanCheckRunConfig = {PlanCheckRunConfig_GhostFlagsEntry.encode({ key: key as any, value }, writer.uint32(50).fork()).ldelim();});if (message.preUpdateBackupDetail !== undefined) {- PlanCheckRunConfig_PreUpdateBackupDetail.encode(message.preUpdateBackupDetail, writer.uint32(58).fork()).ldelim();+ PreUpdateBackupDetail.encode(message.preUpdateBackupDetail, writer.uint32(58).fork()).ldelim();}return writer;},@@ -292,7 +349,7 @@ export const PlanCheckRunConfig = {break;}- message.preUpdateBackupDetail = PlanCheckRunConfig_PreUpdateBackupDetail.decode(reader, reader.uint32());+ message.preUpdateBackupDetail = PreUpdateBackupDetail.decode(reader, reader.uint32());continue;}if ((tag & 7) === 4 || tag === 0) {@@ -319,7 +376,7 @@ export const PlanCheckRunConfig = {}, {}): {},preUpdateBackupDetail: isSet(object.preUpdateBackupDetail)- ? PlanCheckRunConfig_PreUpdateBackupDetail.fromJSON(object.preUpdateBackupDetail)+ ? PreUpdateBackupDetail.fromJSON(object.preUpdateBackupDetail): undefined,};},@@ -351,7 +408,7 @@ export const PlanCheckRunConfig = {}}if (message.preUpdateBackupDetail !== undefined) {- obj.preUpdateBackupDetail = PlanCheckRunConfig_PreUpdateBackupDetail.toJSON(message.preUpdateBackupDetail);+ obj.preUpdateBackupDetail = PreUpdateBackupDetail.toJSON(message.preUpdateBackupDetail);}return obj;},@@ -380,7 +437,7 @@ export const PlanCheckRunConfig = {);message.preUpdateBackupDetail =(object.preUpdateBackupDetail !== undefined && object.preUpdateBackupDetail !== null)- ? PlanCheckRunConfig_PreUpdateBackupDetail.fromPartial(object.preUpdateBackupDetail)+ ? PreUpdateBackupDetail.fromPartial(object.preUpdateBackupDetail): undefined;return message;},@@ -460,63 +517,6 @@ export const PlanCheckRunConfig_GhostFlagsEntry = {},};-function createBasePlanCheckRunConfig_PreUpdateBackupDetail(): PlanCheckRunConfig_PreUpdateBackupDetail {- return { database: "" };-}--export const PlanCheckRunConfig_PreUpdateBackupDetail = {- encode(message: PlanCheckRunConfig_PreUpdateBackupDetail, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- if (message.database !== "") {- writer.uint32(10).string(message.database);- }- return writer;- },-- decode(input: _m0.Reader | Uint8Array, length?: number): PlanCheckRunConfig_PreUpdateBackupDetail {- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBasePlanCheckRunConfig_PreUpdateBackupDetail();- while (reader.pos < end) {- const tag = reader.uint32();- switch (tag >>> 3) {- case 1:- if (tag !== 10) {- break;- }-- message.database = reader.string();- continue;- }- if ((tag & 7) === 4 || tag === 0) {- break;- }- reader.skipType(tag & 7);- }- return message;- },-- fromJSON(object: any): PlanCheckRunConfig_PreUpdateBackupDetail {- return { database: isSet(object.database) ? globalThis.String(object.database) : "" };- },-- toJSON(message: PlanCheckRunConfig_PreUpdateBackupDetail): unknown {- const obj: any = {};- if (message.database !== "") {- obj.database = message.database;- }- return obj;- },-- create(base?: DeepPartial<PlanCheckRunConfig_PreUpdateBackupDetail>): PlanCheckRunConfig_PreUpdateBackupDetail {- return PlanCheckRunConfig_PreUpdateBackupDetail.fromPartial(base ?? {});- },- fromPartial(object: DeepPartial<PlanCheckRunConfig_PreUpdateBackupDetail>): PlanCheckRunConfig_PreUpdateBackupDetail {- const message = createBasePlanCheckRunConfig_PreUpdateBackupDetail();- message.database = object.database ?? "";- return message;- },-};-function createBasePlanCheckRunResult(): PlanCheckRunResult {return { results: [], error: "" };}diff --git a/frontend/src/types/proto/store/task.ts b/frontend/src/types/proto/store/task.tsnew file mode 100644index 0000000000..2720447bd1--- /dev/null+++ b/frontend/src/types/proto/store/task.ts@@ -0,0 +1,653 @@+/* eslint-disable */+import Long from "long";+import _m0 from "protobufjs/minimal";+import { ExportFormat, exportFormatFromJSON, exportFormatToJSON, exportFormatToNumber } from "./common";+import { PreUpdateBackupDetail } from "./plan_check_run";++export const protobufPackage = "bytebase.store";++/** TaskDatabaseCreatePayload is the task payload for creating databases. */+export interface TaskDatabaseCreatePayload {+ /** common fields */+ skipped: boolean;+ skippedReason: string;+ specId: string;+ projectId: number;+ databaseName: string;+ tableName: string;+ sheetId: number;+ characterSet: string;+ collation: string;+ environmentId: string;+ labels: string;+}++/** TaskDatabaseDataUpdatePayload is the task payload for database data update (DML). */+export interface TaskDatabaseUpdatePayload {+ /** common fields */+ skipped: boolean;+ skippedReason: string;+ specId: string;+ schemaVersion: string;+ sheetId: number;+ preUpdateBackupDetail:+ | PreUpdateBackupDetail+ | undefined;+ /** flags is used for ghost sync */+ flags: { [key: string]: string };+}++export interface TaskDatabaseUpdatePayload_FlagsEntry {+ key: string;+ value: string;+}++/** TaskDatabaseDataExportPayload is the task payload for database data export. */+export interface TaskDatabaseDataExportPayload {+ /** common fields */+ specId: string;+ sheetId: number;+ password: string;+ format: ExportFormat;+}++function createBaseTaskDatabaseCreatePayload(): TaskDatabaseCreatePayload {+ return {+ skipped: false,+ skippedReason: "",+ specId: "",+ projectId: 0,+ databaseName: "",+ tableName: "",+ sheetId: 0,+ characterSet: "",+ collation: "",+ environmentId: "",+ labels: "",+ };+}++export const TaskDatabaseCreatePayload = {+ encode(message: TaskDatabaseCreatePayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.skipped === true) {+ writer.uint32(8).bool(message.skipped);+ }+ if (message.skippedReason !== "") {+ writer.uint32(18).string(message.skippedReason);+ }+ if (message.specId !== "") {+ writer.uint32(26).string(message.specId);+ }+ if (message.projectId !== 0) {+ writer.uint32(32).int32(message.projectId);+ }+ if (message.databaseName !== "") {+ writer.uint32(42).string(message.databaseName);+ }+ if (message.tableName !== "") {+ writer.uint32(50).string(message.tableName);+ }+ if (message.sheetId !== 0) {+ writer.uint32(56).int32(message.sheetId);+ }+ if (message.characterSet !== "") {+ writer.uint32(66).string(message.characterSet);+ }+ if (message.collation !== "") {+ writer.uint32(74).string(message.collation);+ }+ if (message.environmentId !== "") {+ writer.uint32(82).string(message.environmentId);+ }+ if (message.labels !== "") {+ writer.uint32(90).string(message.labels);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): TaskDatabaseCreatePayload {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseTaskDatabaseCreatePayload();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 8) {+ break;+ }++ message.skipped = reader.bool();+ continue;+ case 2:+ if (tag !== 18) {+ break;+ }++ message.skippedReason = reader.string();+ continue;+ case 3:+ if (tag !== 26) {+ break;+ }++ message.specId = reader.string();+ continue;+ case 4:+ if (tag !== 32) {+ break;+ }++ message.projectId = reader.int32();+ continue;+ case 5:+ if (tag !== 42) {+ break;+ }++ message.databaseName = reader.string();+ continue;+ case 6:+ if (tag !== 50) {+ break;+ }++ message.tableName = reader.string();+ continue;+ case 7:+ if (tag !== 56) {+ break;+ }++ message.sheetId = reader.int32();+ continue;+ case 8:+ if (tag !== 66) {+ break;+ }++ message.characterSet = reader.string();+ continue;+ case 9:+ if (tag !== 74) {+ break;+ }++ message.collation = reader.string();+ continue;+ case 10:+ if (tag !== 82) {+ break;+ }++ message.environmentId = reader.string();+ continue;+ case 11:+ if (tag !== 90) {+ break;+ }++ message.labels = reader.string();+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): TaskDatabaseCreatePayload {+ return {+ skipped: isSet(object.skipped) ? globalThis.Boolean(object.skipped) : false,+ skippedReason: isSet(object.skippedReason) ? globalThis.String(object.skippedReason) : "",+ specId: isSet(object.specId) ? globalThis.String(object.specId) : "",+ projectId: isSet(object.projectId) ? globalThis.Number(object.projectId) : 0,+ databaseName: isSet(object.databaseName) ? globalThis.String(object.databaseName) : "",+ tableName: isSet(object.tableName) ? globalThis.String(object.tableName) : "",+ sheetId: isSet(object.sheetId) ? globalThis.Number(object.sheetId) : 0,+ characterSet: isSet(object.characterSet) ? globalThis.String(object.characterSet) : "",+ collation: isSet(object.collation) ? globalThis.String(object.collation) : "",+ environmentId: isSet(object.environmentId) ? globalThis.String(object.environmentId) : "",+ labels: isSet(object.labels) ? globalThis.String(object.labels) : "",+ };+ },++ toJSON(message: TaskDatabaseCreatePayload): unknown {+ const obj: any = {};+ if (message.skipped === true) {+ obj.skipped = message.skipped;+ }+ if (message.skippedReason !== "") {+ obj.skippedReason = message.skippedReason;+ }+ if (message.specId !== "") {+ obj.specId = message.specId;+ }+ if (message.projectId !== 0) {+ obj.projectId = Math.round(message.projectId);+ }+ if (message.databaseName !== "") {+ obj.databaseName = message.databaseName;+ }+ if (message.tableName !== "") {+ obj.tableName = message.tableName;+ }+ if (message.sheetId !== 0) {+ obj.sheetId = Math.round(message.sheetId);+ }+ if (message.characterSet !== "") {+ obj.characterSet = message.characterSet;+ }+ if (message.collation !== "") {+ obj.collation = message.collation;+ }+ if (message.environmentId !== "") {+ obj.environmentId = message.environmentId;+ }+ if (message.labels !== "") {+ obj.labels = message.labels;+ }+ return obj;+ },++ create(base?: DeepPartial<TaskDatabaseCreatePayload>): TaskDatabaseCreatePayload {+ return TaskDatabaseCreatePayload.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<TaskDatabaseCreatePayload>): TaskDatabaseCreatePayload {+ const message = createBaseTaskDatabaseCreatePayload();+ message.skipped = object.skipped ?? false;+ message.skippedReason = object.skippedReason ?? "";+ message.specId = object.specId ?? "";+ message.projectId = object.projectId ?? 0;+ message.databaseName = object.databaseName ?? "";+ message.tableName = object.tableName ?? "";+ message.sheetId = object.sheetId ?? 0;+ message.characterSet = object.characterSet ?? "";+ message.collation = object.collation ?? "";+ message.environmentId = object.environmentId ?? "";+ message.labels = object.labels ?? "";+ return message;+ },+};++function createBaseTaskDatabaseUpdatePayload(): TaskDatabaseUpdatePayload {+ return {+ skipped: false,+ skippedReason: "",+ specId: "",+ schemaVersion: "",+ sheetId: 0,+ preUpdateBackupDetail: undefined,+ flags: {},+ };+}++export const TaskDatabaseUpdatePayload = {+ encode(message: TaskDatabaseUpdatePayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.skipped === true) {+ writer.uint32(8).bool(message.skipped);+ }+ if (message.skippedReason !== "") {+ writer.uint32(18).string(message.skippedReason);+ }+ if (message.specId !== "") {+ writer.uint32(26).string(message.specId);+ }+ if (message.schemaVersion !== "") {+ writer.uint32(34).string(message.schemaVersion);+ }+ if (message.sheetId !== 0) {+ writer.uint32(40).int32(message.sheetId);+ }+ if (message.preUpdateBackupDetail !== undefined) {+ PreUpdateBackupDetail.encode(message.preUpdateBackupDetail, writer.uint32(50).fork()).ldelim();+ }+ Object.entries(message.flags).forEach(([key, value]) => {+ TaskDatabaseUpdatePayload_FlagsEntry.encode({ key: key as any, value }, writer.uint32(58).fork()).ldelim();+ });+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): TaskDatabaseUpdatePayload {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseTaskDatabaseUpdatePayload();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 8) {+ break;+ }++ message.skipped = reader.bool();+ continue;+ case 2:+ if (tag !== 18) {+ break;+ }++ message.skippedReason = reader.string();+ continue;+ case 3:+ if (tag !== 26) {+ break;+ }++ message.specId = reader.string();+ continue;+ case 4:+ if (tag !== 34) {+ break;+ }++ message.schemaVersion = reader.string();+ continue;+ case 5:+ if (tag !== 40) {+ break;+ }++ message.sheetId = reader.int32();+ continue;+ case 6:+ if (tag !== 50) {+ break;+ }++ message.preUpdateBackupDetail = PreUpdateBackupDetail.decode(reader, reader.uint32());+ continue;+ case 7:+ if (tag !== 58) {+ break;+ }++ const entry7 = TaskDatabaseUpdatePayload_FlagsEntry.decode(reader, reader.uint32());+ if (entry7.value !== undefined) {+ message.flags[entry7.key] = entry7.value;+ }+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): TaskDatabaseUpdatePayload {+ return {+ skipped: isSet(object.skipped) ? globalThis.Boolean(object.skipped) : false,+ skippedReason: isSet(object.skippedReason) ? globalThis.String(object.skippedReason) : "",+ specId: isSet(object.specId) ? globalThis.String(object.specId) : "",+ schemaVersion: isSet(object.schemaVersion) ? globalThis.String(object.schemaVersion) : "",+ sheetId: isSet(object.sheetId) ? globalThis.Number(object.sheetId) : 0,+ preUpdateBackupDetail: isSet(object.preUpdateBackupDetail)+ ? PreUpdateBackupDetail.fromJSON(object.preUpdateBackupDetail)+ : undefined,+ flags: isObject(object.flags)+ ? Object.entries(object.flags).reduce<{ [key: string]: string }>((acc, [key, value]) => {+ acc[key] = String(value);+ return acc;+ }, {})+ : {},+ };+ },++ toJSON(message: TaskDatabaseUpdatePayload): unknown {+ const obj: any = {};+ if (message.skipped === true) {+ obj.skipped = message.skipped;+ }+ if (message.skippedReason !== "") {+ obj.skippedReason = message.skippedReason;+ }+ if (message.specId !== "") {+ obj.specId = message.specId;+ }+ if (message.schemaVersion !== "") {+ obj.schemaVersion = message.schemaVersion;+ }+ if (message.sheetId !== 0) {+ obj.sheetId = Math.round(message.sheetId);+ }+ if (message.preUpdateBackupDetail !== undefined) {+ obj.preUpdateBackupDetail = PreUpdateBackupDetail.toJSON(message.preUpdateBackupDetail);+ }+ if (message.flags) {+ const entries = Object.entries(message.flags);+ if (entries.length > 0) {+ obj.flags = {};+ entries.forEach(([k, v]) => {+ obj.flags[k] = v;+ });+ }+ }+ return obj;+ },++ create(base?: DeepPartial<TaskDatabaseUpdatePayload>): TaskDatabaseUpdatePayload {+ return TaskDatabaseUpdatePayload.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<TaskDatabaseUpdatePayload>): TaskDatabaseUpdatePayload {+ const message = createBaseTaskDatabaseUpdatePayload();+ message.skipped = object.skipped ?? false;+ message.skippedReason = object.skippedReason ?? "";+ message.specId = object.specId ?? "";+ message.schemaVersion = object.schemaVersion ?? "";+ message.sheetId = object.sheetId ?? 0;+ message.preUpdateBackupDetail =+ (object.preUpdateBackupDetail !== undefined && object.preUpdateBackupDetail !== null)+ ? PreUpdateBackupDetail.fromPartial(object.preUpdateBackupDetail)+ : undefined;+ message.flags = Object.entries(object.flags ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => {+ if (value !== undefined) {+ acc[key] = globalThis.String(value);+ }+ return acc;+ }, {});+ return message;+ },+};++function createBaseTaskDatabaseUpdatePayload_FlagsEntry(): TaskDatabaseUpdatePayload_FlagsEntry {+ return { key: "", value: "" };+}++export const TaskDatabaseUpdatePayload_FlagsEntry = {+ encode(message: TaskDatabaseUpdatePayload_FlagsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.key !== "") {+ writer.uint32(10).string(message.key);+ }+ if (message.value !== "") {+ writer.uint32(18).string(message.value);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): TaskDatabaseUpdatePayload_FlagsEntry {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseTaskDatabaseUpdatePayload_FlagsEntry();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.key = reader.string();+ continue;+ case 2:+ if (tag !== 18) {+ break;+ }++ message.value = reader.string();+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): TaskDatabaseUpdatePayload_FlagsEntry {+ return {+ key: isSet(object.key) ? globalThis.String(object.key) : "",+ value: isSet(object.value) ? globalThis.String(object.value) : "",+ };+ },++ toJSON(message: TaskDatabaseUpdatePayload_FlagsEntry): unknown {+ const obj: any = {};+ if (message.key !== "") {+ obj.key = message.key;+ }+ if (message.value !== "") {+ obj.value = message.value;+ }+ return obj;+ },++ create(base?: DeepPartial<TaskDatabaseUpdatePayload_FlagsEntry>): TaskDatabaseUpdatePayload_FlagsEntry {+ return TaskDatabaseUpdatePayload_FlagsEntry.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<TaskDatabaseUpdatePayload_FlagsEntry>): TaskDatabaseUpdatePayload_FlagsEntry {+ const message = createBaseTaskDatabaseUpdatePayload_FlagsEntry();+ message.key = object.key ?? "";+ message.value = object.value ?? "";+ return message;+ },+};++function createBaseTaskDatabaseDataExportPayload(): TaskDatabaseDataExportPayload {+ return { specId: "", sheetId: 0, password: "", format: ExportFormat.FORMAT_UNSPECIFIED };+}++export const TaskDatabaseDataExportPayload = {+ encode(message: TaskDatabaseDataExportPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.specId !== "") {+ writer.uint32(10).string(message.specId);+ }+ if (message.sheetId !== 0) {+ writer.uint32(16).int32(message.sheetId);+ }+ if (message.password !== "") {+ writer.uint32(26).string(message.password);+ }+ if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {+ writer.uint32(32).int32(exportFormatToNumber(message.format));+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): TaskDatabaseDataExportPayload {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseTaskDatabaseDataExportPayload();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.specId = reader.string();+ continue;+ case 2:+ if (tag !== 16) {+ break;+ }++ message.sheetId = reader.int32();+ continue;+ case 3:+ if (tag !== 26) {+ break;+ }++ message.password = reader.string();+ continue;+ case 4:+ if (tag !== 32) {+ break;+ }++ message.format = exportFormatFromJSON(reader.int32());+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): TaskDatabaseDataExportPayload {+ return {+ specId: isSet(object.specId) ? globalThis.String(object.specId) : "",+ sheetId: isSet(object.sheetId) ? globalThis.Number(object.sheetId) : 0,+ password: isSet(object.password) ? globalThis.String(object.password) : "",+ format: isSet(object.format) ? exportFormatFromJSON(object.format) : ExportFormat.FORMAT_UNSPECIFIED,+ };+ },++ toJSON(message: TaskDatabaseDataExportPayload): unknown {+ const obj: any = {};+ if (message.specId !== "") {+ obj.specId = message.specId;+ }+ if (message.sheetId !== 0) {+ obj.sheetId = Math.round(message.sheetId);+ }+ if (message.password !== "") {+ obj.password = message.password;+ }+ if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {+ obj.format = exportFormatToJSON(message.format);+ }+ return obj;+ },++ create(base?: DeepPartial<TaskDatabaseDataExportPayload>): TaskDatabaseDataExportPayload {+ return TaskDatabaseDataExportPayload.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<TaskDatabaseDataExportPayload>): TaskDatabaseDataExportPayload {+ const message = createBaseTaskDatabaseDataExportPayload();+ message.specId = object.specId ?? "";+ message.sheetId = object.sheetId ?? 0;+ message.password = object.password ?? "";+ message.format = object.format ?? ExportFormat.FORMAT_UNSPECIFIED;+ return message;+ },+};++type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;++export type DeepPartial<T> = T extends Builtin ? T+ : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }+ : Partial<T>;++if (_m0.util.Long !== Long) {+ _m0.util.Long = Long as any;+ _m0.configure();+}++function isObject(value: any): boolean {+ return typeof value === "object" && value !== null;+}++function isSet(value: any): boolean {+ return value !== null && value !== undefined;+}diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.tsindex ab938b714f..9a6cad218d 100644--- a/frontend/src/utils/index.ts+++ b/frontend/src/utils/index.ts@@ -6,7 +6,6 @@ export * from "./environment";export * from "./instance";export * from "./issue";export * from "./link";-export * from "./pipeline";export * from "./project";export * from "./role";export * from "./slug";@@ -16,7 +15,6 @@ export * from "./util";export * from "./label";export * from "./string";export * from "./sqlEditor";-export * from "./task";export * from "./pev2";export * from "./web-storage";export * from "./dom";diff --git a/frontend/src/utils/pipeline.ts b/frontend/src/utils/pipeline.tsdeleted file mode 100644index 17760886fc..0000000000--- a/frontend/src/utils/pipeline.ts+++ /dev/null@@ -1,272 +0,0 @@-import type { BBButtonType } from "@/bbkit/types";-import type {- Database,- Environment,- Pipeline,- PipelineCreate,- Stage,- StageId,- Task,- TaskId,- TaskStatus,-} from "../types";-import { empty, EMPTY_ID, unknown, UNKNOWN_ID } from "../types";--export type PipelineType =- | "NO_PIPELINE"- | "SINGLE_STAGE"- | "MULTI_SINGLE_TASK_STAGE"- | "MULTI_STAGE";--export function pipelineType(- pipeline: Pipeline | PipelineCreate-): PipelineType {- if (pipeline.stageList.length == 0) {- return "NO_PIPELINE";- } else if (pipeline.stageList.length == 1) {- return "SINGLE_STAGE";- } else {- for (const stage of pipeline.stageList) {- if (stage.taskList.length > 1) {- return "MULTI_STAGE";- }- }- return "MULTI_SINGLE_TASK_STAGE";- }-}--// Returns all tasks from all stages.-export function allTaskList(pipeline: Pipeline): Task[] {- const list: Task[] = [];- pipeline.stageList.forEach((stage) => {- stage.taskList.forEach((task) => {- list.push(task);- });- });- return list;-}--export function lastTask(pipeline: Pipeline): Task {- if (- pipeline.stageList.length > 0 &&- pipeline.stageList[pipeline.stageList.length - 1].taskList.length > 0- ) {- const lastStage = pipeline.stageList[pipeline.stageList.length - 1];- return lastStage.taskList[lastStage.taskList.length - 1];- }-- return empty("TASK") as Task;-}--export function findTaskById(- pipeline: Pipeline | undefined,- taskId: TaskId-): Task {- if (!pipeline) return unknown("TASK");- for (const stage of pipeline.stageList) {- for (const task of stage.taskList) {- if (task.id == taskId) {- return task;- }- }- }- return unknown("TASK") as Task;-}--export function findStageById(- pipeline: Pipeline | undefined,- stageId: StageId-): Stage {- if (!pipeline) return unknown("STAGE");- return pipeline.stageList.find((s) => s.id === stageId) ?? unknown("STAGE");-}--export function activeStage(pipeline: Pipeline): Stage {- for (const stage of pipeline.stageList) {- for (const task of stage.taskList) {- if (- task.status === "PENDING" ||- task.status === "PENDING_APPROVAL" ||- task.status === "RUNNING" ||- // "FAILED" is also a transient task status, which requires user- // to take further action (e.g. Skip, Retry)- task.status === "FAILED" ||- task.status === "CANCELED"- ) {- return stage;- }- }- }-- if (pipeline.stageList.length > 0) {- return pipeline.stageList[pipeline.stageList.length - 1];- }- return empty("STAGE") as Stage;-}--export function activeTask(pipeline: Pipeline): Task {- for (const stage of pipeline.stageList) {- for (const task of stage.taskList) {- if (- task.status === "PENDING" ||- task.status === "PENDING_APPROVAL" ||- task.status === "RUNNING" ||- // "FAILED" is also a transient task status, which requires user- // to take further action (e.g. Skip, Retry)- task.status === "FAILED" ||- task.status === "CANCELED"- ) {- return task;- }- }- }-- const theLastTask = lastTask(pipeline);- if (theLastTask.id != EMPTY_ID) {- return theLastTask;- }-- return empty("TASK") as Task;-}--export function activeTaskInStage(stage: Stage): Task {- for (const task of stage.taskList) {- if (- task.status === "PENDING" ||- task.status === "PENDING_APPROVAL" ||- task.status === "RUNNING" ||- // "FAILED" is also a transient task status, which requires user- // to take further action (e.g. Skip, Retry)- task.status === "FAILED" ||- task.status === "CANCELED"- ) {- return task;- }- }-- if (stage.taskList.length > 0) {- return stage.taskList[stage.taskList.length - 1];- }-- return empty("TASK") as Task;-}--export function activeEnvironment(pipeline: Pipeline | undefined): Environment {- if (!pipeline) {- return empty("ENVIRONMENT");- }- const stage: Stage = activeStage(pipeline);- if (stage.id == EMPTY_ID) {- return empty("ENVIRONMENT") as Environment;- }- return stage.environment;-}--export function activeDatabase(pipeline: Pipeline): Database | undefined {- const task = activeTask(pipeline);- if (task.id == EMPTY_ID) {- return undefined;- }- return task.database;-}--export type TaskStatusTransitionType =- | "RUN"- | "ROLLOUT"- | "RETRY"- | "CANCEL"- | "SKIP"- | "RESTART";--export interface TaskStatusTransition {- type: TaskStatusTransitionType;- to: TaskStatus;- buttonName: string;- buttonType: BBButtonType;-}--export const TASK_STATUS_TRANSITION_LIST: Map<- TaskStatusTransitionType,- TaskStatusTransition-> = new Map([- [- "RUN",- {- type: "RUN",- to: "RUNNING",- buttonName: "common.run",- buttonType: "PRIMARY",- },- ],- [- "ROLLOUT",- {- type: "ROLLOUT",- to: "PENDING",- buttonName: "common.rollout",- buttonType: "PRIMARY",- },- ],- [- "RETRY",- {- type: "RETRY",- to: "PENDING_APPROVAL",- buttonName: "common.retry",- buttonType: "PRIMARY",- },- ],- [- "CANCEL",- {- type: "CANCEL",- to: "CANCELED",- buttonName: "common.cancel",- buttonType: "NORMAL",- },- ],- [- "RESTART",- {- type: "RESTART",- to: "PENDING_APPROVAL",- buttonName: "common.restart",- buttonType: "NORMAL",- },- ],-]);--// The transition button are displayed from left to right on the UI, and the right-most one is the primary button-export const APPLICABLE_TASK_TRANSITION_LIST: Map<- TaskStatus,- TaskStatusTransitionType[]-> = new Map([- ["PENDING", ["CANCEL"]],- ["PENDING_APPROVAL", ["ROLLOUT"]],- ["RUNNING", ["CANCEL"]],- ["DONE", []],- ["FAILED", ["RETRY"]],- ["CANCELED", ["RESTART"]],-]);--export function applicableTaskTransition(- pipeline: Pipeline-): TaskStatusTransition[] {- const task = activeTask(pipeline);-- if (task.id == EMPTY_ID || task.id == UNKNOWN_ID) {- return [];- }-- const list: TaskStatusTransitionType[] = APPLICABLE_TASK_TRANSITION_LIST.get(- task.status- )!;-- return list.map((type: TaskStatusTransitionType) => {- return TASK_STATUS_TRANSITION_LIST.get(type)!;- });-}--// The status transition applying to a stage is applying to all tasks in the-// stage simultaneously.-export type StageStatusTransition = TaskStatusTransition;diff --git a/frontend/src/utils/slug.ts b/frontend/src/utils/slug.tsindex 9e6ebad666..a1c45fc528 100644--- a/frontend/src/utils/slug.ts+++ b/frontend/src/utils/slug.ts@@ -8,7 +8,7 @@ import {reviewConfigNamePrefix,} from "@/store/modules/v1/common";import type { Worksheet } from "@/types/proto/v1/worksheet_service";-import type { IssueId, SQLReviewPolicy } from "../types";+import type { SQLReviewPolicy } from "../types";import type { IdType } from "../types/id";export const indexOrUIDFromSlug = (slug: string): number => {@@ -46,11 +46,11 @@ export function indexFromSlug(slug: string): number {return parseInt(parts[parts.length - 1]) - 1;}-export function issueSlug(issueName: string, issueId: IssueId): string {+export function issueSlug(issueName: string, issueId: IdType): string {return [slug(issueName), issueId].join("-");}-export function planSlug(planName: string, planId: IssueId): string {+export function planSlug(planName: string, planId: IdType): string {return [slug(planName), planId].join("-");}diff --git a/frontend/src/utils/task.ts b/frontend/src/utils/task.tsdeleted file mode 100644index 444ecfd9a4..0000000000--- a/frontend/src/utils/task.ts+++ /dev/null@@ -1,138 +0,0 @@-import { groupBy, maxBy } from "lodash-es";-import { useDatabaseV1Store } from "@/store";-import type {- Task,- TaskCheckStatus,- TaskCheckType,- TaskCreate,- TaskDatabaseCreatePayload,-} from "@/types";-import { unknownDatabase } from "@/types";--export const extractDatabaseNameFromTask = (- task: Task | TaskCreate-): string => {- const taskEntity = task as Task;- const taskCreate = task as TaskCreate;- if (typeof taskEntity.id !== "number") {- // The task is not created yet- // Find the database by databaseId if possible- if (taskCreate.databaseId) {- return useDatabaseV1Store().getDatabaseByUID(- String(taskCreate.databaseId!)- ).databaseName;- }- return unknownDatabase().databaseName;- }-- const taskType = taskEntity.type;- // The task entity is related to a database entity- if (taskEntity.database) {- return taskEntity.database.name;- }-- // The task entity is irrelative to any databases or the related- // database is not created yet.- if (taskType === "bb.task.database.create") {- // The database is not created yet.- // extract database info from the task's and payload's properties.- const payload = taskEntity.payload as TaskDatabaseCreatePayload;- return payload.databaseName;- }-- // Fallback to <<Unknown database>>. Won't be happy to see it.- return unknownDatabase().databaseName;-};--export const HiddenCheckTypes = new Set<TaskCheckType>([- "bb.task-check.database.statement.type.report",- "bb.task-check.database.statement.affected-rows.report",-]);--export type TaskCheckRunSummary = {- runningCount: number;- successCount: number;- warnCount: number;- errorCount: number;-};--export function taskCheckRunSummary(task?: Task): TaskCheckRunSummary {- const summary: TaskCheckRunSummary = {- runningCount: 0,- successCount: 0,- warnCount: 0,- errorCount: 0,- };-- if (!task) return summary;-- const taskCheckRunList = task.taskCheckRunList.filter(- (check) => !HiddenCheckTypes.has(check.type)- );-- const listGroupByType = groupBy(- taskCheckRunList,- (checkRun) => checkRun.type- );-- const latestCheckRunOfEachType = Object.keys(listGroupByType).map((type) => {- const listOfType = listGroupByType[type];- const latest = maxBy(listOfType, (checkRun) => checkRun.updatedTs)!;- return latest;- });-- for (const checkRun of latestCheckRunOfEachType) {- switch (checkRun.status) {- case "CANCELED":- // nothing todo- break;- case "FAILED":- summary.errorCount++;- break;- case "RUNNING":- summary.runningCount++;- break;- case "DONE":- for (const result of checkRun.result.resultList ?? []) {- switch (result.status) {- case "SUCCESS":- summary.successCount++;- break;- case "WARN":- summary.warnCount++;- break;- case "ERROR":- summary.errorCount++;- }- }- }- }-- return summary;-}--export const isTaskSkipped = (task: Task): boolean => {- if (task.status === "DONE") {- const payload = task.payload as any;- return payload?.skipped === true;- }- return false;-};--export const isTaskEntity = (task: Task | TaskCreate): task is Task => {- const obj = task as any;- return typeof obj["id"] === "number";-};--export const isTaskCreate = (task: Task | TaskCreate): task is TaskCreate => {- return !isTaskEntity(task);-};--export const checkStatusOfTask = (task: Task): TaskCheckStatus | undefined => {- if (task.status === "PENDING" || task.status === "PENDING_APPROVAL") {- const summary = taskCheckRunSummary(task);- if (summary.errorCount > 0) return "ERROR";- if (summary.warnCount > 0) return "WARN";- }- return undefined;-};diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex 305e25fdc3..7e5f2ec66c 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -4,6 +4,7 @@## Table of Contents- [store/common.proto](#store_common-proto)+ - [DatabaseLabel](#bytebase-store-DatabaseLabel)- [PageToken](#bytebase-store-PageToken)- [Position](#bytebase-store-Position)@@ -161,11 +162,11 @@- [store/plan_check_run.proto](#store_plan_check_run-proto)- [PlanCheckRunConfig](#bytebase-store-PlanCheckRunConfig)- [PlanCheckRunConfig.GhostFlagsEntry](#bytebase-store-PlanCheckRunConfig-GhostFlagsEntry)- - [PlanCheckRunConfig.PreUpdateBackupDetail](#bytebase-store-PlanCheckRunConfig-PreUpdateBackupDetail)- [PlanCheckRunResult](#bytebase-store-PlanCheckRunResult)- [PlanCheckRunResult.Result](#bytebase-store-PlanCheckRunResult-Result)- [PlanCheckRunResult.Result.SqlReviewReport](#bytebase-store-PlanCheckRunResult-Result-SqlReviewReport)- [PlanCheckRunResult.Result.SqlSummaryReport](#bytebase-store-PlanCheckRunResult-Result-SqlSummaryReport)+ - [PreUpdateBackupDetail](#bytebase-store-PreUpdateBackupDetail)- [PlanCheckRunConfig.ChangeDatabaseType](#bytebase-store-PlanCheckRunConfig-ChangeDatabaseType)- [PlanCheckRunResult.Result.Status](#bytebase-store-PlanCheckRunResult-Result-Status)@@ -254,6 +255,12 @@- [SlowQueryStatistics](#bytebase-store-SlowQueryStatistics)- [SlowQueryStatisticsItem](#bytebase-store-SlowQueryStatisticsItem)+- [store/task.proto](#store_task-proto)+ - [TaskDatabaseCreatePayload](#bytebase-store-TaskDatabaseCreatePayload)+ - [TaskDatabaseDataExportPayload](#bytebase-store-TaskDatabaseDataExportPayload)+ - [TaskDatabaseUpdatePayload](#bytebase-store-TaskDatabaseUpdatePayload)+ - [TaskDatabaseUpdatePayload.FlagsEntry](#bytebase-store-TaskDatabaseUpdatePayload-FlagsEntry)+- [store/task_run.proto](#store_task_run-proto)- [TaskRunResult](#bytebase-store-TaskRunResult)- [TaskRunResult.Position](#bytebase-store-TaskRunResult-Position)@@ -296,6 +303,22 @@+<a name="bytebase-store-DatabaseLabel"></a>++### DatabaseLabel++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| key | [string](#string) | | |+| value | [string](#string) | | |++++++<a name="bytebase-store-PageToken"></a>### PageToken@@ -2584,7 +2607,7 @@ Type is the database change type.| database_name | [string](#string) | | || database_group_uid | [int64](#int64) | optional | database_group_uid is optional. If it's set, it means the database is part of a database group. || ghost_flags | [PlanCheckRunConfig.GhostFlagsEntry](#bytebase-store-PlanCheckRunConfig-GhostFlagsEntry) | repeated | |-| pre_update_backup_detail | [PlanCheckRunConfig.PreUpdateBackupDetail](#bytebase-store-PlanCheckRunConfig-PreUpdateBackupDetail) | optional | If set, a backup of the modified data will be created automatically before any changes are applied. |+| pre_update_backup_detail | [PreUpdateBackupDetail](#bytebase-store-PreUpdateBackupDetail) | optional | If set, a backup of the modified data will be created automatically before any changes are applied. |@@ -2607,21 +2630,6 @@ Type is the database change type.-<a name="bytebase-store-PlanCheckRunConfig-PreUpdateBackupDetail"></a>--### PlanCheckRunConfig.PreUpdateBackupDetail----| Field | Type | Label | Description |-| ----- | ---- | ----- | ----------- |-| database | [string](#string) | | The database for keeping the backup data. Format: instances/{instance}/databases/{database} |------<a name="bytebase-store-PlanCheckRunResult"></a>### PlanCheckRunResult@@ -2695,6 +2703,21 @@ Type is the database change type.++<a name="bytebase-store-PreUpdateBackupDetail"></a>++### PreUpdateBackupDetail++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| database | [string](#string) | | The database for keeping the backup data. Format: instances/{instance}/databases/{database} |+++++@@ -3935,6 +3958,102 @@ SlowQueryStatisticsItem is the item of slow query statistics.+<a name="store_task-proto"></a>+<p align="right"><a href="#top">Top</a></p>++## store/task.proto++++<a name="bytebase-store-TaskDatabaseCreatePayload"></a>++### TaskDatabaseCreatePayload+TaskDatabaseCreatePayload is the task payload for creating databases.+++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| skipped | [bool](#bool) | | common fields |+| skipped_reason | [string](#string) | | |+| spec_id | [string](#string) | | |+| project_id | [int32](#int32) | | |+| database_name | [string](#string) | | |+| table_name | [string](#string) | | |+| sheet_id | [int32](#int32) | | |+| character_set | [string](#string) | | |+| collation | [string](#string) | | |+| environment_id | [string](#string) | | |+| labels | [string](#string) | | |+++++++<a name="bytebase-store-TaskDatabaseDataExportPayload"></a>++### TaskDatabaseDataExportPayload+TaskDatabaseDataExportPayload is the task payload for database data export.+++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| spec_id | [string](#string) | | common fields |+| sheet_id | [int32](#int32) | | |+| password | [string](#string) | | |+| format | [ExportFormat](#bytebase-store-ExportFormat) | | |+++++++<a name="bytebase-store-TaskDatabaseUpdatePayload"></a>++### TaskDatabaseUpdatePayload+TaskDatabaseDataUpdatePayload is the task payload for database data update (DML).+++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| skipped | [bool](#bool) | | common fields |+| skipped_reason | [string](#string) | | |+| spec_id | [string](#string) | | |+| schema_version | [string](#string) | | |+| sheet_id | [int32](#int32) | | |+| pre_update_backup_detail | [PreUpdateBackupDetail](#bytebase-store-PreUpdateBackupDetail) | | |+| flags | [TaskDatabaseUpdatePayload.FlagsEntry](#bytebase-store-TaskDatabaseUpdatePayload-FlagsEntry) | repeated | flags is used for ghost sync |+++++++<a name="bytebase-store-TaskDatabaseUpdatePayload-FlagsEntry"></a>++### TaskDatabaseUpdatePayload.FlagsEntry++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| key | [string](#string) | | |+| value | [string](#string) | | |+++++++++++++++<a name="store_task_run-proto"></a><p align="right"><a href="#top">Top</a></p>diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.htmlindex 03bc5f0f5c..9e147e1c3a 100644--- a/proto/gen/grpc-doc/store/index.html+++ b/proto/gen/grpc-doc/store/index.html@@ -178,6 +178,10 @@<a href="#store%2fcommon.proto">store/common.proto</a><ul>+ <li>+ <a href="#bytebase.store.DatabaseLabel"><span class="badge">M</span>DatabaseLabel</a>+ </li>+<li><a href="#bytebase.store.PageToken"><span class="badge">M</span>PageToken</a></li>@@ -818,10 +822,6 @@<a href="#bytebase.store.PlanCheckRunConfig.GhostFlagsEntry"><span class="badge">M</span>PlanCheckRunConfig.GhostFlagsEntry</a></li>- <li>- <a href="#bytebase.store.PlanCheckRunConfig.PreUpdateBackupDetail"><span class="badge">M</span>PlanCheckRunConfig.PreUpdateBackupDetail</a>- </li>-<li><a href="#bytebase.store.PlanCheckRunResult"><span class="badge">M</span>PlanCheckRunResult</a></li>@@ -838,6 +838,10 @@<a href="#bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport"><span class="badge">M</span>PlanCheckRunResult.Result.SqlSummaryReport</a></li>+ <li>+ <a href="#bytebase.store.PreUpdateBackupDetail"><span class="badge">M</span>PreUpdateBackupDetail</a>+ </li>+<li><a href="#bytebase.store.PlanCheckRunConfig.ChangeDatabaseType"><span class="badge">E</span>PlanCheckRunConfig.ChangeDatabaseType</a>@@ -1200,6 +1204,33 @@+ </ul>+ </li>+++ <li>+ <a href="#store%2ftask.proto">store/task.proto</a>+ <ul>++ <li>+ <a href="#bytebase.store.TaskDatabaseCreatePayload"><span class="badge">M</span>TaskDatabaseCreatePayload</a>+ </li>++ <li>+ <a href="#bytebase.store.TaskDatabaseDataExportPayload"><span class="badge">M</span>TaskDatabaseDataExportPayload</a>+ </li>++ <li>+ <a href="#bytebase.store.TaskDatabaseUpdatePayload"><span class="badge">M</span>TaskDatabaseUpdatePayload</a>+ </li>++ <li>+ <a href="#bytebase.store.TaskDatabaseUpdatePayload.FlagsEntry"><span class="badge">M</span>TaskDatabaseUpdatePayload.FlagsEntry</a>+ </li>++++</ul></li>@@ -1346,6 +1377,37 @@<p></p>+ <h3 id="bytebase.store.DatabaseLabel">DatabaseLabel</h3>+ <p></p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>key</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>value</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ </tbody>+ </table>+++++<h3 id="bytebase.store.PageToken">PageToken</h3><p>Used internally for obfuscating the page token.</p>@@ -6891,7 +6953,7 @@ Format: projects/{project-ID}/vcsConnectors/{vcs-connector} </p></td><tr><td>pre_update_backup_detail</td>- <td><a href="#bytebase.store.PlanCheckRunConfig.PreUpdateBackupDetail">PlanCheckRunConfig.PreUpdateBackupDetail</a></td>+ <td><a href="#bytebase.store.PreUpdateBackupDetail">PreUpdateBackupDetail</a></td><td>optional</td><td><p>If set, a backup of the modified data will be created automatically before any changes are applied. </p></td></tr>@@ -6934,31 +6996,6 @@ Format: projects/{project-ID}/vcsConnectors/{vcs-connector} </p></td>- <h3 id="bytebase.store.PlanCheckRunConfig.PreUpdateBackupDetail">PlanCheckRunConfig.PreUpdateBackupDetail</h3>- <p></p>--- <table class="field-table">- <thead>- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>- </thead>- <tbody>-- <tr>- <td>database</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p>The database for keeping the backup data.-Format: instances/{instance}/databases/{database} </p></td>- </tr>-- </tbody>- </table>-----<h3 id="bytebase.store.PlanCheckRunResult">PlanCheckRunResult</h3><p></p>@@ -7154,6 +7191,31 @@ To supersede `line` and `column` above. </p></td>+ <h3 id="bytebase.store.PreUpdateBackupDetail">PreUpdateBackupDetail</h3>+ <p></p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>database</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p>The database for keeping the backup data.+Format: instances/{instance}/databases/{database} </p></td>+ </tr>++ </tbody>+ </table>+++++<h3 id="bytebase.store.PlanCheckRunConfig.ChangeDatabaseType">PlanCheckRunConfig.ChangeDatabaseType</h3>@@ -9826,6 +9888,256 @@ Default to this mode.</p></td>+ <div class="file-heading">+ <h2 id="store/task.proto">store/task.proto</h2><a href="#title">Top</a>+ </div>+ <p></p>+++ <h3 id="bytebase.store.TaskDatabaseCreatePayload">TaskDatabaseCreatePayload</h3>+ <p>TaskDatabaseCreatePayload is the task payload for creating databases.</p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>skipped</td>+ <td><a href="#bool">bool</a></td>+ <td></td>+ <td><p>common fields </p></td>+ </tr>++ <tr>+ <td>skipped_reason</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>spec_id</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>project_id</td>+ <td><a href="#int32">int32</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>database_name</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>table_name</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>sheet_id</td>+ <td><a href="#int32">int32</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>character_set</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>collation</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>environment_id</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>labels</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ </tbody>+ </table>++++++ <h3 id="bytebase.store.TaskDatabaseDataExportPayload">TaskDatabaseDataExportPayload</h3>+ <p>TaskDatabaseDataExportPayload is the task payload for database data export.</p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>spec_id</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p>common fields </p></td>+ </tr>++ <tr>+ <td>sheet_id</td>+ <td><a href="#int32">int32</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>password</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>format</td>+ <td><a href="#bytebase.store.ExportFormat">ExportFormat</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ </tbody>+ </table>++++++ <h3 id="bytebase.store.TaskDatabaseUpdatePayload">TaskDatabaseUpdatePayload</h3>+ <p>TaskDatabaseDataUpdatePayload is the task payload for database data update (DML).</p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>skipped</td>+ <td><a href="#bool">bool</a></td>+ <td></td>+ <td><p>common fields </p></td>+ </tr>++ <tr>+ <td>skipped_reason</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>spec_id</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>schema_version</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>sheet_id</td>+ <td><a href="#int32">int32</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>pre_update_backup_detail</td>+ <td><a href="#bytebase.store.PreUpdateBackupDetail">PreUpdateBackupDetail</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>flags</td>+ <td><a href="#bytebase.store.TaskDatabaseUpdatePayload.FlagsEntry">TaskDatabaseUpdatePayload.FlagsEntry</a></td>+ <td>repeated</td>+ <td><p>flags is used for ghost sync </p></td>+ </tr>++ </tbody>+ </table>++++++ <h3 id="bytebase.store.TaskDatabaseUpdatePayload.FlagsEntry">TaskDatabaseUpdatePayload.FlagsEntry</h3>+ <p></p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>key</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>value</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ </tbody>+ </table>+++++++++++++<div class="file-heading"><h2 id="store/task_run.proto">store/task_run.proto</h2><a href="#title">Top</a></div>diff --git a/proto/generated-go/store/common.pb.go b/proto/generated-go/store/common.pb.goindex e50d757aee..79f7b97f93 100644--- a/proto/generated-go/store/common.pb.go+++ b/proto/generated-go/store/common.pb.go@@ -412,6 +412,61 @@ func (x *Position) GetColumn() int32 {return 0}+type DatabaseLabel struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`+ Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`+}++func (x *DatabaseLabel) Reset() {+ *x = DatabaseLabel{}+ if protoimpl.UnsafeEnabled {+ mi := &file_store_common_proto_msgTypes[2]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *DatabaseLabel) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*DatabaseLabel) ProtoMessage() {}++func (x *DatabaseLabel) ProtoReflect() protoreflect.Message {+ mi := &file_store_common_proto_msgTypes[2]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use DatabaseLabel.ProtoReflect.Descriptor instead.+func (*DatabaseLabel) Descriptor() ([]byte, []int) {+ return file_store_common_proto_rawDescGZIP(), []int{2}+}++func (x *DatabaseLabel) GetKey() string {+ if x != nil {+ return x.Key+ }+ return ""+}++func (x *DatabaseLabel) GetValue() string {+ if x != nil {+ return x.Value+ }+ return ""+}+var File_store_common_proto protoreflect.FileDescriptorvar file_store_common_proto_rawDesc = []byte{@@ -424,47 +479,51 @@ var file_store_common_proto_rawDesc = []byte{0x36, 0x0a, 0x08, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6c,0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12,0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,- 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2a, 0xe5, 0x02, 0x0a, 0x06, 0x45, 0x6e, 0x67, 0x69,- 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x5f, 0x55, 0x4e, 0x53,- 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x4c,- 0x49, 0x43, 0x4b, 0x48, 0x4f, 0x55, 0x53, 0x45, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x4d, 0x59,- 0x53, 0x51, 0x4c, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x4f, 0x53, 0x54, 0x47, 0x52, 0x45,- 0x53, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x4e, 0x4f, 0x57, 0x46, 0x4c, 0x41, 0x4b, 0x45,- 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x51, 0x4c, 0x49, 0x54, 0x45, 0x10, 0x05, 0x12, 0x08,- 0x0a, 0x04, 0x54, 0x49, 0x44, 0x42, 0x10, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x4f, 0x4e, 0x47,- 0x4f, 0x44, 0x42, 0x10, 0x07, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x45, 0x44, 0x49, 0x53, 0x10, 0x08,- 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x52, 0x41, 0x43, 0x4c, 0x45, 0x10, 0x09, 0x12, 0x0b, 0x0a, 0x07,- 0x53, 0x50, 0x41, 0x4e, 0x4e, 0x45, 0x52, 0x10, 0x0a, 0x12, 0x09, 0x0a, 0x05, 0x4d, 0x53, 0x53,- 0x51, 0x4c, 0x10, 0x0b, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x44, 0x53, 0x48, 0x49, 0x46, 0x54,- 0x10, 0x0c, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x41, 0x52, 0x49, 0x41, 0x44, 0x42, 0x10, 0x0d, 0x12,- 0x0d, 0x0a, 0x09, 0x4f, 0x43, 0x45, 0x41, 0x4e, 0x42, 0x41, 0x53, 0x45, 0x10, 0x0e, 0x12, 0x06,- 0x0a, 0x02, 0x44, 0x4d, 0x10, 0x0f, 0x12, 0x0e, 0x0a, 0x0a, 0x52, 0x49, 0x53, 0x49, 0x4e, 0x47,- 0x57, 0x41, 0x56, 0x45, 0x10, 0x10, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x43, 0x45, 0x41, 0x4e, 0x42,- 0x41, 0x53, 0x45, 0x5f, 0x4f, 0x52, 0x41, 0x43, 0x4c, 0x45, 0x10, 0x11, 0x12, 0x0d, 0x0a, 0x09,- 0x53, 0x54, 0x41, 0x52, 0x52, 0x4f, 0x43, 0x4b, 0x53, 0x10, 0x12, 0x12, 0x09, 0x0a, 0x05, 0x44,- 0x4f, 0x52, 0x49, 0x53, 0x10, 0x13, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x49, 0x56, 0x45, 0x10, 0x14,- 0x12, 0x11, 0x0a, 0x0d, 0x45, 0x4c, 0x41, 0x53, 0x54, 0x49, 0x43, 0x53, 0x45, 0x41, 0x52, 0x43,- 0x48, 0x10, 0x15, 0x12, 0x0c, 0x0a, 0x08, 0x42, 0x49, 0x47, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10,- 0x16, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x59, 0x4e, 0x41, 0x4d, 0x4f, 0x44, 0x42, 0x10, 0x17, 0x12,- 0x0e, 0x0a, 0x0a, 0x44, 0x41, 0x54, 0x41, 0x42, 0x52, 0x49, 0x43, 0x4b, 0x53, 0x10, 0x18, 0x2a,- 0x5c, 0x0a, 0x07, 0x56, 0x43, 0x53, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x56, 0x43,- 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,- 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x10, 0x01,- 0x12, 0x0a, 0x0a, 0x06, 0x47, 0x49, 0x54, 0x4c, 0x41, 0x42, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09,- 0x42, 0x49, 0x54, 0x42, 0x55, 0x43, 0x4b, 0x45, 0x54, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x41,- 0x5a, 0x55, 0x52, 0x45, 0x5f, 0x44, 0x45, 0x56, 0x4f, 0x50, 0x53, 0x10, 0x04, 0x2a, 0x4e, 0x0a,- 0x0c, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1d, 0x0a,- 0x19, 0x4d, 0x41, 0x53, 0x4b, 0x49, 0x4e, 0x47, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55,- 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04,- 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x41, 0x52, 0x54, 0x49, 0x41,- 0x4c, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x55, 0x4c, 0x4c, 0x10, 0x03, 0x2a, 0x4c, 0x0a,- 0x0c, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x16, 0x0a,- 0x12, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,- 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x43, 0x53, 0x56, 0x10, 0x01, 0x12, 0x08,- 0x0a, 0x04, 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x51, 0x4c, 0x10,- 0x03, 0x12, 0x08, 0x0a, 0x04, 0x58, 0x4c, 0x53, 0x58, 0x10, 0x04, 0x42, 0x14, 0x5a, 0x12, 0x67,- 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72,- 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,+ 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x22, 0x37, 0x0a, 0x0d, 0x44, 0x61, 0x74, 0x61, 0x62,+ 0x61, 0x73, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,+ 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61,+ 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,+ 0x2a, 0xe5, 0x02, 0x0a, 0x06, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x45,+ 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,+ 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x4c, 0x49, 0x43, 0x4b, 0x48, 0x4f, 0x55, 0x53,+ 0x45, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x4d, 0x59, 0x53, 0x51, 0x4c, 0x10, 0x02, 0x12, 0x0c,+ 0x0a, 0x08, 0x50, 0x4f, 0x53, 0x54, 0x47, 0x52, 0x45, 0x53, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09,+ 0x53, 0x4e, 0x4f, 0x57, 0x46, 0x4c, 0x41, 0x4b, 0x45, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x53,+ 0x51, 0x4c, 0x49, 0x54, 0x45, 0x10, 0x05, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x49, 0x44, 0x42, 0x10,+ 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x4f, 0x4e, 0x47, 0x4f, 0x44, 0x42, 0x10, 0x07, 0x12, 0x09,+ 0x0a, 0x05, 0x52, 0x45, 0x44, 0x49, 0x53, 0x10, 0x08, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x52, 0x41,+ 0x43, 0x4c, 0x45, 0x10, 0x09, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x50, 0x41, 0x4e, 0x4e, 0x45, 0x52,+ 0x10, 0x0a, 0x12, 0x09, 0x0a, 0x05, 0x4d, 0x53, 0x53, 0x51, 0x4c, 0x10, 0x0b, 0x12, 0x0c, 0x0a,+ 0x08, 0x52, 0x45, 0x44, 0x53, 0x48, 0x49, 0x46, 0x54, 0x10, 0x0c, 0x12, 0x0b, 0x0a, 0x07, 0x4d,+ 0x41, 0x52, 0x49, 0x41, 0x44, 0x42, 0x10, 0x0d, 0x12, 0x0d, 0x0a, 0x09, 0x4f, 0x43, 0x45, 0x41,+ 0x4e, 0x42, 0x41, 0x53, 0x45, 0x10, 0x0e, 0x12, 0x06, 0x0a, 0x02, 0x44, 0x4d, 0x10, 0x0f, 0x12,+ 0x0e, 0x0a, 0x0a, 0x52, 0x49, 0x53, 0x49, 0x4e, 0x47, 0x57, 0x41, 0x56, 0x45, 0x10, 0x10, 0x12,+ 0x14, 0x0a, 0x10, 0x4f, 0x43, 0x45, 0x41, 0x4e, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x4f, 0x52, 0x41,+ 0x43, 0x4c, 0x45, 0x10, 0x11, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x54, 0x41, 0x52, 0x52, 0x4f, 0x43,+ 0x4b, 0x53, 0x10, 0x12, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x4f, 0x52, 0x49, 0x53, 0x10, 0x13, 0x12,+ 0x08, 0x0a, 0x04, 0x48, 0x49, 0x56, 0x45, 0x10, 0x14, 0x12, 0x11, 0x0a, 0x0d, 0x45, 0x4c, 0x41,+ 0x53, 0x54, 0x49, 0x43, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x10, 0x15, 0x12, 0x0c, 0x0a, 0x08,+ 0x42, 0x49, 0x47, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x16, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x59,+ 0x4e, 0x41, 0x4d, 0x4f, 0x44, 0x42, 0x10, 0x17, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x41, 0x54, 0x41,+ 0x42, 0x52, 0x49, 0x43, 0x4b, 0x53, 0x10, 0x18, 0x2a, 0x5c, 0x0a, 0x07, 0x56, 0x43, 0x53, 0x54,+ 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x56, 0x43, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,+ 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a,+ 0x06, 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x47, 0x49, 0x54,+ 0x4c, 0x41, 0x42, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x49, 0x54, 0x42, 0x55, 0x43, 0x4b,+ 0x45, 0x54, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x5a, 0x55, 0x52, 0x45, 0x5f, 0x44, 0x45,+ 0x56, 0x4f, 0x50, 0x53, 0x10, 0x04, 0x2a, 0x4e, 0x0a, 0x0c, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e,+ 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x19, 0x4d, 0x41, 0x53, 0x4b, 0x49, 0x4e,+ 0x47, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,+ 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12,+ 0x0b, 0x0a, 0x07, 0x50, 0x41, 0x52, 0x54, 0x49, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04,+ 0x46, 0x55, 0x4c, 0x4c, 0x10, 0x03, 0x2a, 0x4c, 0x0a, 0x0c, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74,+ 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x16, 0x0a, 0x12, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54,+ 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07,+ 0x0a, 0x03, 0x43, 0x53, 0x56, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4a, 0x53, 0x4f, 0x4e, 0x10,+ 0x02, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x51, 0x4c, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x58, 0x4c,+ 0x53, 0x58, 0x10, 0x04, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65,+ 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,+ 0x6f, 0x33,}var (@@ -480,14 +539,15 @@ func file_store_common_proto_rawDescGZIP() []byte {}var file_store_common_proto_enumTypes = make([]protoimpl.EnumInfo, 4)-var file_store_common_proto_msgTypes = make([]protoimpl.MessageInfo, 2)+var file_store_common_proto_msgTypes = make([]protoimpl.MessageInfo, 3)var file_store_common_proto_goTypes = []any{- (Engine)(0), // 0: bytebase.store.Engine- (VCSType)(0), // 1: bytebase.store.VCSType- (MaskingLevel)(0), // 2: bytebase.store.MaskingLevel- (ExportFormat)(0), // 3: bytebase.store.ExportFormat- (*PageToken)(nil), // 4: bytebase.store.PageToken- (*Position)(nil), // 5: bytebase.store.Position+ (Engine)(0), // 0: bytebase.store.Engine+ (VCSType)(0), // 1: bytebase.store.VCSType+ (MaskingLevel)(0), // 2: bytebase.store.MaskingLevel+ (ExportFormat)(0), // 3: bytebase.store.ExportFormat+ (*PageToken)(nil), // 4: bytebase.store.PageToken+ (*Position)(nil), // 5: bytebase.store.Position+ (*DatabaseLabel)(nil), // 6: bytebase.store.DatabaseLabel}var file_store_common_proto_depIdxs = []int32{0, // [0:0] is the sub-list for method output_type@@ -527,6 +587,18 @@ func file_store_common_proto_init() {return nil}}+ file_store_common_proto_msgTypes[2].Exporter = func(v any, i int) any {+ switch v := v.(*DatabaseLabel); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }}type x struct{}out := protoimpl.TypeBuilder{@@ -534,7 +606,7 @@ func file_store_common_proto_init() {GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: file_store_common_proto_rawDesc,NumEnums: 4,- NumMessages: 2,+ NumMessages: 3,NumExtensions: 0,NumServices: 0,},diff --git a/proto/generated-go/store/plan_check_run.pb.go b/proto/generated-go/store/plan_check_run.pb.goindex 4beebd331f..92973bbfb9 100644--- a/proto/generated-go/store/plan_check_run.pb.go+++ b/proto/generated-go/store/plan_check_run.pb.go@@ -72,7 +72,7 @@ func (x PlanCheckRunConfig_ChangeDatabaseType) Number() protoreflect.EnumNumber// Deprecated: Use PlanCheckRunConfig_ChangeDatabaseType.Descriptor instead.func (PlanCheckRunConfig_ChangeDatabaseType) EnumDescriptor() ([]byte, []int) {- return file_store_plan_check_run_proto_rawDescGZIP(), []int{0, 0}+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{1, 0}}type PlanCheckRunResult_Result_Status int32@@ -124,7 +124,56 @@ func (x PlanCheckRunResult_Result_Status) Number() protoreflect.EnumNumber {// Deprecated: Use PlanCheckRunResult_Result_Status.Descriptor instead.func (PlanCheckRunResult_Result_Status) EnumDescriptor() ([]byte, []int) {- return file_store_plan_check_run_proto_rawDescGZIP(), []int{1, 0, 0}+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{2, 0, 0}+}++type PreUpdateBackupDetail struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The database for keeping the backup data.+ // Format: instances/{instance}/databases/{database}+ Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`+}++func (x *PreUpdateBackupDetail) Reset() {+ *x = PreUpdateBackupDetail{}+ if protoimpl.UnsafeEnabled {+ mi := &file_store_plan_check_run_proto_msgTypes[0]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *PreUpdateBackupDetail) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*PreUpdateBackupDetail) ProtoMessage() {}++func (x *PreUpdateBackupDetail) ProtoReflect() protoreflect.Message {+ mi := &file_store_plan_check_run_proto_msgTypes[0]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use PreUpdateBackupDetail.ProtoReflect.Descriptor instead.+func (*PreUpdateBackupDetail) Descriptor() ([]byte, []int) {+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{0}+}++func (x *PreUpdateBackupDetail) GetDatabase() string {+ if x != nil {+ return x.Database+ }+ return ""}type PlanCheckRunConfig struct {@@ -140,13 +189,13 @@ type PlanCheckRunConfig struct {DatabaseGroupUid *int64 `protobuf:"varint,5,opt,name=database_group_uid,json=databaseGroupUid,proto3,oneof" json:"database_group_uid,omitempty"`GhostFlags map[string]string `protobuf:"bytes,6,rep,name=ghost_flags,json=ghostFlags,proto3" json:"ghost_flags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`// If set, a backup of the modified data will be created automatically before any changes are applied.- PreUpdateBackupDetail *PlanCheckRunConfig_PreUpdateBackupDetail `protobuf:"bytes,7,opt,name=pre_update_backup_detail,json=preUpdateBackupDetail,proto3,oneof" json:"pre_update_backup_detail,omitempty"`+ PreUpdateBackupDetail *PreUpdateBackupDetail `protobuf:"bytes,7,opt,name=pre_update_backup_detail,json=preUpdateBackupDetail,proto3,oneof" json:"pre_update_backup_detail,omitempty"`}func (x *PlanCheckRunConfig) Reset() {*x = PlanCheckRunConfig{}if protoimpl.UnsafeEnabled {- mi := &file_store_plan_check_run_proto_msgTypes[0]+ mi := &file_store_plan_check_run_proto_msgTypes[1]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -159,7 +208,7 @@ func (x *PlanCheckRunConfig) String() string {func (*PlanCheckRunConfig) ProtoMessage() {}func (x *PlanCheckRunConfig) ProtoReflect() protoreflect.Message {- mi := &file_store_plan_check_run_proto_msgTypes[0]+ mi := &file_store_plan_check_run_proto_msgTypes[1]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -172,7 +221,7 @@ func (x *PlanCheckRunConfig) ProtoReflect() protoreflect.Message {// Deprecated: Use PlanCheckRunConfig.ProtoReflect.Descriptor instead.func (*PlanCheckRunConfig) Descriptor() ([]byte, []int) {- return file_store_plan_check_run_proto_rawDescGZIP(), []int{0}+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{1}}func (x *PlanCheckRunConfig) GetSheetUid() int32 {@@ -217,7 +266,7 @@ func (x *PlanCheckRunConfig) GetGhostFlags() map[string]string {return nil}-func (x *PlanCheckRunConfig) GetPreUpdateBackupDetail() *PlanCheckRunConfig_PreUpdateBackupDetail {+func (x *PlanCheckRunConfig) GetPreUpdateBackupDetail() *PreUpdateBackupDetail {if x != nil {return x.PreUpdateBackupDetail}@@ -236,7 +285,7 @@ type PlanCheckRunResult struct {func (x *PlanCheckRunResult) Reset() {*x = PlanCheckRunResult{}if protoimpl.UnsafeEnabled {- mi := &file_store_plan_check_run_proto_msgTypes[1]+ mi := &file_store_plan_check_run_proto_msgTypes[2]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -249,7 +298,7 @@ func (x *PlanCheckRunResult) String() string {func (*PlanCheckRunResult) ProtoMessage() {}func (x *PlanCheckRunResult) ProtoReflect() protoreflect.Message {- mi := &file_store_plan_check_run_proto_msgTypes[1]+ mi := &file_store_plan_check_run_proto_msgTypes[2]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -262,7 +311,7 @@ func (x *PlanCheckRunResult) ProtoReflect() protoreflect.Message {// Deprecated: Use PlanCheckRunResult.ProtoReflect.Descriptor instead.func (*PlanCheckRunResult) Descriptor() ([]byte, []int) {- return file_store_plan_check_run_proto_rawDescGZIP(), []int{1}+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{2}}func (x *PlanCheckRunResult) GetResults() []*PlanCheckRunResult_Result {@@ -279,55 +328,6 @@ func (x *PlanCheckRunResult) GetError() string {return ""}-type PlanCheckRunConfig_PreUpdateBackupDetail struct {- state protoimpl.MessageState- sizeCache protoimpl.SizeCache- unknownFields protoimpl.UnknownFields-- // The database for keeping the backup data.- // Format: instances/{instance}/databases/{database}- Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`-}--func (x *PlanCheckRunConfig_PreUpdateBackupDetail) Reset() {- *x = PlanCheckRunConfig_PreUpdateBackupDetail{}- if protoimpl.UnsafeEnabled {- mi := &file_store_plan_check_run_proto_msgTypes[3]- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- ms.StoreMessageInfo(mi)- }-}--func (x *PlanCheckRunConfig_PreUpdateBackupDetail) String() string {- return protoimpl.X.MessageStringOf(x)-}--func (*PlanCheckRunConfig_PreUpdateBackupDetail) ProtoMessage() {}--func (x *PlanCheckRunConfig_PreUpdateBackupDetail) ProtoReflect() protoreflect.Message {- mi := &file_store_plan_check_run_proto_msgTypes[3]- if protoimpl.UnsafeEnabled && x != nil {- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- if ms.LoadMessageInfo() == nil {- ms.StoreMessageInfo(mi)- }- return ms- }- return mi.MessageOf(x)-}--// Deprecated: Use PlanCheckRunConfig_PreUpdateBackupDetail.ProtoReflect.Descriptor instead.-func (*PlanCheckRunConfig_PreUpdateBackupDetail) Descriptor() ([]byte, []int) {- return file_store_plan_check_run_proto_rawDescGZIP(), []int{0, 1}-}--func (x *PlanCheckRunConfig_PreUpdateBackupDetail) GetDatabase() string {- if x != nil {- return x.Database- }- return ""-}-type PlanCheckRunResult_Result struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -373,7 +373,7 @@ func (x *PlanCheckRunResult_Result) ProtoReflect() protoreflect.Message {// Deprecated: Use PlanCheckRunResult_Result.ProtoReflect.Descriptor instead.func (*PlanCheckRunResult_Result) Descriptor() ([]byte, []int) {- return file_store_plan_check_run_proto_rawDescGZIP(), []int{1, 0}+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{2, 0}}func (x *PlanCheckRunResult_Result) GetStatus() PlanCheckRunResult_Result_Status {@@ -482,7 +482,7 @@ func (x *PlanCheckRunResult_Result_SqlSummaryReport) ProtoReflect() protoreflect// Deprecated: Use PlanCheckRunResult_Result_SqlSummaryReport.ProtoReflect.Descriptor instead.func (*PlanCheckRunResult_Result_SqlSummaryReport) Descriptor() ([]byte, []int) {- return file_store_plan_check_run_proto_rawDescGZIP(), []int{1, 0, 0}+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{2, 0, 0}}func (x *PlanCheckRunResult_Result_SqlSummaryReport) GetCode() int32 {@@ -558,7 +558,7 @@ func (x *PlanCheckRunResult_Result_SqlReviewReport) ProtoReflect() protoreflect.// Deprecated: Use PlanCheckRunResult_Result_SqlReviewReport.ProtoReflect.Descriptor instead.func (*PlanCheckRunResult_Result_SqlReviewReport) Descriptor() ([]byte, []int) {- return file_store_plan_check_run_proto_rawDescGZIP(), []int{1, 0, 1}+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{2, 0, 1}}func (x *PlanCheckRunResult_Result_SqlReviewReport) GetLine() int32 {@@ -612,118 +612,117 @@ var file_store_plan_check_run_proto_rawDesc = []byte{0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,0x1a, 0x23, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2e,- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf0, 0x05, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68,- 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1b, 0x0a, 0x09,- 0x73, 0x68, 0x65, 0x65, 0x74, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,- 0x08, 0x73, 0x68, 0x65, 0x65, 0x74, 0x55, 0x69, 0x64, 0x12, 0x67, 0x0a, 0x14, 0x63, 0x68, 0x61,- 0x6e, 0x67, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x74, 0x79, 0x70,- 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x33, 0x0a, 0x15, 0x50, 0x72, 0x65, 0x55, 0x70, 0x64, 0x61,+ 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x1a,+ 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,+ 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x22, 0xa8, 0x05, 0x0a, 0x12, 0x50,+ 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69,+ 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x65, 0x65, 0x74, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01,+ 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x68, 0x65, 0x65, 0x74, 0x55, 0x69, 0x64, 0x12, 0x67,+ 0x0a, 0x14, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,+ 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x62,+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c,+ 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,+ 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54,+ 0x79, 0x70, 0x65, 0x52, 0x12, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62,+ 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61,+ 0x6e, 0x63, 0x65, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x69,+ 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x55, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x61,+ 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,+ 0x09, 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12,+ 0x31, 0x0a, 0x12, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75,+ 0x70, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x10, 0x64,+ 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x55, 0x69, 0x64, 0x88,+ 0x01, 0x01, 0x12, 0x53, 0x0a, 0x0b, 0x67, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x66, 0x6c, 0x61, 0x67,+ 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65,- 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x68, 0x61, 0x6e,- 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x12,- 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79,- 0x70, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x75,- 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e,- 0x63, 0x65, 0x55, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,- 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x61,- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x12, 0x64, 0x61,- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x75, 0x69, 0x64,- 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x10, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,- 0x73, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x55, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x53, 0x0a,- 0x0b, 0x67, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x06, 0x20, 0x03,- 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,+ 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x47, 0x68, 0x6f, 0x73,+ 0x74, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x67, 0x68, 0x6f,+ 0x73, 0x74, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x63, 0x0a, 0x18, 0x70, 0x72, 0x65, 0x5f, 0x75,+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x64, 0x65, 0x74,+ 0x61, 0x69, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x79, 0x74, 0x65,+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x72, 0x65, 0x55, 0x70,+ 0x64, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c,+ 0x48, 0x01, 0x52, 0x15, 0x70, 0x72, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63,+ 0x6b, 0x75, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x88, 0x01, 0x01, 0x1a, 0x3d, 0x0a, 0x0f,+ 0x47, 0x68, 0x6f, 0x73, 0x74, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,+ 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,+ 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,+ 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x64, 0x0a, 0x12, 0x43,+ 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70,+ 0x65, 0x12, 0x24, 0x0a, 0x20, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x44, 0x41, 0x54, 0x41,+ 0x42, 0x41, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,+ 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x44, 0x4c, 0x10, 0x01,+ 0x12, 0x07, 0x0a, 0x03, 0x44, 0x4d, 0x4c, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x44, 0x4c,+ 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x44, 0x4c, 0x5f, 0x47, 0x48, 0x4f, 0x53, 0x54, 0x10,+ 0x04, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67,+ 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x75, 0x69, 0x64, 0x42, 0x1b, 0x0a, 0x19, 0x5f, 0x70, 0x72, 0x65,+ 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x64,+ 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0xde, 0x07, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68,+ 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x43, 0x0a, 0x07,+ 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e,+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50,+ 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c,+ 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,+ 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,+ 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0xec, 0x06, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75,+ 0x6c, 0x74, 0x12, 0x48, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01,+ 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e,- 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x47, 0x68, 0x6f, 0x73, 0x74, 0x46, 0x6c, 0x61, 0x67,- 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x67, 0x68, 0x6f, 0x73, 0x74, 0x46, 0x6c, 0x61,- 0x67, 0x73, 0x12, 0x76, 0x0a, 0x18, 0x70, 0x72, 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,- 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x07,- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52,- 0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x72, 0x65, 0x55, 0x70, 0x64, 0x61,- 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x48, 0x01,- 0x52, 0x15, 0x70, 0x72, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75,- 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x88, 0x01, 0x01, 0x1a, 0x3d, 0x0a, 0x0f, 0x47, 0x68,- 0x6f, 0x73, 0x74, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a,- 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,- 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,- 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x33, 0x0a, 0x15, 0x50, 0x72, 0x65,- 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x44, 0x65, 0x74, 0x61,- 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01,- 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x22, 0x64,- 0x0a, 0x12, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,- 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x20, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x44,- 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53,- 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x44,- 0x4c, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x4d, 0x4c, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03,- 0x53, 0x44, 0x4c, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x44, 0x4c, 0x5f, 0x47, 0x48, 0x4f,- 0x53, 0x54, 0x10, 0x04, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,- 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x75, 0x69, 0x64, 0x42, 0x1b, 0x0a, 0x19, 0x5f,- 0x70, 0x72, 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75,- 0x70, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0xde, 0x07, 0x0a, 0x12, 0x50, 0x6c, 0x61,- 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12,- 0x43, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,- 0x32, 0x29, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,- 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65,- 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73,- 0x75, 0x6c, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20,- 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0xec, 0x06, 0x0a, 0x06, 0x52,- 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x48, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18,- 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,- 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b,- 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,- 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12,- 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,- 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,- 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12,- 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63,- 0x6f, 0x64, 0x65, 0x12, 0x6a, 0x0a, 0x12, 0x73, 0x71, 0x6c, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61,- 0x72, 0x79, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32,- 0x3a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65,- 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73,- 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x71, 0x6c, 0x53, 0x75,- 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x00, 0x52, 0x10, 0x73,- 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12,- 0x67, 0x0a, 0x11, 0x73, 0x71, 0x6c, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x72, 0x65,- 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x62, 0x79, 0x74,- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e,- 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52,- 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52,- 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69,- 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0xc3, 0x01, 0x0a, 0x10, 0x53, 0x71, 0x6c,- 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a,- 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64,- 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x74,- 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x74,- 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x66,- 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28,- 0x05, 0x52, 0x0c, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x12,- 0x4d, 0x0a, 0x11, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75,- 0x72, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x62, 0x79, 0x74,- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e,- 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x10, 0x63, 0x68,- 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0xe7,- 0x01, 0x0a, 0x0f, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f,- 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,- 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e,- 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x16,- 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,- 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04,- 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x3f, 0x0a, 0x0e, 0x73, 0x74,- 0x61, 0x72, 0x74, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01,- 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,- 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x73, 0x74,- 0x61, 0x72, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x0c, 0x65,- 0x6e, 0x64, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28,- 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,- 0x72, 0x65, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x65, 0x6e, 0x64,- 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x45, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74,- 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53,- 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52,- 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47,- 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x03, 0x42,- 0x08, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e,- 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62,- 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,+ 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x74,+ 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05,+ 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74,+ 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20,+ 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04,+ 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65,+ 0x12, 0x6a, 0x0a, 0x12, 0x73, 0x71, 0x6c, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f,+ 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x62,+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c,+ 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,+ 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61,+ 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x00, 0x52, 0x10, 0x73, 0x71, 0x6c, 0x53,+ 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x67, 0x0a, 0x11,+ 0x73, 0x71, 0x6c, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72,+ 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,+ 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65,+ 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75,+ 0x6c, 0x74, 0x2e, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f,+ 0x72, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52,+ 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0xc3, 0x01, 0x0a, 0x10, 0x53, 0x71, 0x6c, 0x53, 0x75, 0x6d,+ 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f,+ 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x27,+ 0x0a, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65,+ 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65,+ 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x66, 0x66, 0x65, 0x63,+ 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c,+ 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x4d, 0x0a, 0x11,+ 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,+ 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,+ 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64,+ 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x10, 0x63, 0x68, 0x61, 0x6e, 0x67,+ 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0xe7, 0x01, 0x0a, 0x0f,+ 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12,+ 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6c,+ 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x02, 0x20,+ 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x64,+ 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74,+ 0x61, 0x69, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,+ 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x3f, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74,+ 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32,+ 0x18, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65,+ 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74,+ 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x5f,+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18,+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,+ 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x73,+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x45, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12,+ 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,+ 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52,+ 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12,+ 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x03, 0x42, 0x08, 0x0a, 0x06,+ 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,+ 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72,+ 0x6f, 0x74, 0x6f, 0x33,}var (@@ -743,10 +742,10 @@ var file_store_plan_check_run_proto_msgTypes = make([]protoimpl.MessageInfo, 7)var file_store_plan_check_run_proto_goTypes = []any{(PlanCheckRunConfig_ChangeDatabaseType)(0), // 0: bytebase.store.PlanCheckRunConfig.ChangeDatabaseType(PlanCheckRunResult_Result_Status)(0), // 1: bytebase.store.PlanCheckRunResult.Result.Status- (*PlanCheckRunConfig)(nil), // 2: bytebase.store.PlanCheckRunConfig- (*PlanCheckRunResult)(nil), // 3: bytebase.store.PlanCheckRunResult- nil, // 4: bytebase.store.PlanCheckRunConfig.GhostFlagsEntry- (*PlanCheckRunConfig_PreUpdateBackupDetail)(nil), // 5: bytebase.store.PlanCheckRunConfig.PreUpdateBackupDetail+ (*PreUpdateBackupDetail)(nil), // 2: bytebase.store.PreUpdateBackupDetail+ (*PlanCheckRunConfig)(nil), // 3: bytebase.store.PlanCheckRunConfig+ (*PlanCheckRunResult)(nil), // 4: bytebase.store.PlanCheckRunResult+ nil, // 5: bytebase.store.PlanCheckRunConfig.GhostFlagsEntry(*PlanCheckRunResult_Result)(nil), // 6: bytebase.store.PlanCheckRunResult.Result(*PlanCheckRunResult_Result_SqlSummaryReport)(nil), // 7: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport(*PlanCheckRunResult_Result_SqlReviewReport)(nil), // 8: bytebase.store.PlanCheckRunResult.Result.SqlReviewReport@@ -755,8 +754,8 @@ var file_store_plan_check_run_proto_goTypes = []any{}var file_store_plan_check_run_proto_depIdxs = []int32{0, // 0: bytebase.store.PlanCheckRunConfig.change_database_type:type_name -> bytebase.store.PlanCheckRunConfig.ChangeDatabaseType- 4, // 1: bytebase.store.PlanCheckRunConfig.ghost_flags:type_name -> bytebase.store.PlanCheckRunConfig.GhostFlagsEntry- 5, // 2: bytebase.store.PlanCheckRunConfig.pre_update_backup_detail:type_name -> bytebase.store.PlanCheckRunConfig.PreUpdateBackupDetail+ 5, // 1: bytebase.store.PlanCheckRunConfig.ghost_flags:type_name -> bytebase.store.PlanCheckRunConfig.GhostFlagsEntry+ 2, // 2: bytebase.store.PlanCheckRunConfig.pre_update_backup_detail:type_name -> bytebase.store.PreUpdateBackupDetail6, // 3: bytebase.store.PlanCheckRunResult.results:type_name -> bytebase.store.PlanCheckRunResult.Result1, // 4: bytebase.store.PlanCheckRunResult.Result.status:type_name -> bytebase.store.PlanCheckRunResult.Result.Status7, // 5: bytebase.store.PlanCheckRunResult.Result.sql_summary_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport@@ -780,7 +779,7 @@ func file_store_plan_check_run_proto_init() {file_store_instance_change_history_proto_init()if !protoimpl.UnsafeEnabled {file_store_plan_check_run_proto_msgTypes[0].Exporter = func(v any, i int) any {- switch v := v.(*PlanCheckRunConfig); i {+ switch v := v.(*PreUpdateBackupDetail); i {case 0:return &v.statecase 1:@@ -792,7 +791,7 @@ func file_store_plan_check_run_proto_init() {}}file_store_plan_check_run_proto_msgTypes[1].Exporter = func(v any, i int) any {- switch v := v.(*PlanCheckRunResult); i {+ switch v := v.(*PlanCheckRunConfig); i {case 0:return &v.statecase 1:@@ -803,8 +802,8 @@ func file_store_plan_check_run_proto_init() {return nil}}- file_store_plan_check_run_proto_msgTypes[3].Exporter = func(v any, i int) any {- switch v := v.(*PlanCheckRunConfig_PreUpdateBackupDetail); i {+ file_store_plan_check_run_proto_msgTypes[2].Exporter = func(v any, i int) any {+ switch v := v.(*PlanCheckRunResult); i {case 0:return &v.statecase 1:@@ -852,7 +851,7 @@ func file_store_plan_check_run_proto_init() {}}}- file_store_plan_check_run_proto_msgTypes[0].OneofWrappers = []any{}+ file_store_plan_check_run_proto_msgTypes[1].OneofWrappers = []any{}file_store_plan_check_run_proto_msgTypes[4].OneofWrappers = []any{(*PlanCheckRunResult_Result_SqlSummaryReport_)(nil),(*PlanCheckRunResult_Result_SqlReviewReport_)(nil),diff --git a/proto/generated-go/store/task.pb.go b/proto/generated-go/store/task.pb.gonew file mode 100644index 0000000000..53ef4b69c3--- /dev/null+++ b/proto/generated-go/store/task.pb.go@@ -0,0 +1,490 @@+// Code generated by protoc-gen-go. DO NOT EDIT.+// versions:+// protoc-gen-go v1.34.2+// protoc (unknown)+// source: store/task.proto++package store++import (+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"+ reflect "reflect"+ sync "sync"+)++const (+ // Verify that this generated code is sufficiently up-to-date.+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)+ // Verify that runtime/protoimpl is sufficiently up-to-date.+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)+)++// TaskDatabaseCreatePayload is the task payload for creating databases.+type TaskDatabaseCreatePayload struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // common fields+ Skipped bool `protobuf:"varint,1,opt,name=skipped,proto3" json:"skipped,omitempty"`+ SkippedReason string `protobuf:"bytes,2,opt,name=skipped_reason,json=skippedReason,proto3" json:"skipped_reason,omitempty"`+ SpecId string `protobuf:"bytes,3,opt,name=spec_id,json=specId,proto3" json:"spec_id,omitempty"`+ ProjectId int32 `protobuf:"varint,4,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`+ DatabaseName string `protobuf:"bytes,5,opt,name=database_name,json=databaseName,proto3" json:"database_name,omitempty"`+ TableName string `protobuf:"bytes,6,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"`+ SheetId int32 `protobuf:"varint,7,opt,name=sheet_id,json=sheetId,proto3" json:"sheet_id,omitempty"`+ CharacterSet string `protobuf:"bytes,8,opt,name=character_set,json=characterSet,proto3" json:"character_set,omitempty"`+ Collation string `protobuf:"bytes,9,opt,name=collation,proto3" json:"collation,omitempty"`+ EnvironmentId string `protobuf:"bytes,10,opt,name=environment_id,json=environmentId,proto3" json:"environment_id,omitempty"`+ Labels string `protobuf:"bytes,11,opt,name=labels,proto3" json:"labels,omitempty"`+}++func (x *TaskDatabaseCreatePayload) Reset() {+ *x = TaskDatabaseCreatePayload{}+ if protoimpl.UnsafeEnabled {+ mi := &file_store_task_proto_msgTypes[0]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *TaskDatabaseCreatePayload) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*TaskDatabaseCreatePayload) ProtoMessage() {}++func (x *TaskDatabaseCreatePayload) ProtoReflect() protoreflect.Message {+ mi := &file_store_task_proto_msgTypes[0]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use TaskDatabaseCreatePayload.ProtoReflect.Descriptor instead.+func (*TaskDatabaseCreatePayload) Descriptor() ([]byte, []int) {+ return file_store_task_proto_rawDescGZIP(), []int{0}+}++func (x *TaskDatabaseCreatePayload) GetSkipped() bool {+ if x != nil {+ return x.Skipped+ }+ return false+}++func (x *TaskDatabaseCreatePayload) GetSkippedReason() string {+ if x != nil {+ return x.SkippedReason+ }+ return ""+}++func (x *TaskDatabaseCreatePayload) GetSpecId() string {+ if x != nil {+ return x.SpecId+ }+ return ""+}++func (x *TaskDatabaseCreatePayload) GetProjectId() int32 {+ if x != nil {+ return x.ProjectId+ }+ return 0+}++func (x *TaskDatabaseCreatePayload) GetDatabaseName() string {+ if x != nil {+ return x.DatabaseName+ }+ return ""+}++func (x *TaskDatabaseCreatePayload) GetTableName() string {+ if x != nil {+ return x.TableName+ }+ return ""+}++func (x *TaskDatabaseCreatePayload) GetSheetId() int32 {+ if x != nil {+ return x.SheetId+ }+ return 0+}++func (x *TaskDatabaseCreatePayload) GetCharacterSet() string {+ if x != nil {+ return x.CharacterSet+ }+ return ""+}++func (x *TaskDatabaseCreatePayload) GetCollation() string {+ if x != nil {+ return x.Collation+ }+ return ""+}++func (x *TaskDatabaseCreatePayload) GetEnvironmentId() string {+ if x != nil {+ return x.EnvironmentId+ }+ return ""+}++func (x *TaskDatabaseCreatePayload) GetLabels() string {+ if x != nil {+ return x.Labels+ }+ return ""+}++// TaskDatabaseDataUpdatePayload is the task payload for database data update (DML).+type TaskDatabaseUpdatePayload struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // common fields+ Skipped bool `protobuf:"varint,1,opt,name=skipped,proto3" json:"skipped,omitempty"`+ SkippedReason string `protobuf:"bytes,2,opt,name=skipped_reason,json=skippedReason,proto3" json:"skipped_reason,omitempty"`+ SpecId string `protobuf:"bytes,3,opt,name=spec_id,json=specId,proto3" json:"spec_id,omitempty"`+ SchemaVersion string `protobuf:"bytes,4,opt,name=schema_version,json=schemaVersion,proto3" json:"schema_version,omitempty"`+ SheetId int32 `protobuf:"varint,5,opt,name=sheet_id,json=sheetId,proto3" json:"sheet_id,omitempty"`+ PreUpdateBackupDetail *PreUpdateBackupDetail `protobuf:"bytes,6,opt,name=pre_update_backup_detail,json=preUpdateBackupDetail,proto3" json:"pre_update_backup_detail,omitempty"`+ // flags is used for ghost sync+ Flags map[string]string `protobuf:"bytes,7,rep,name=flags,proto3" json:"flags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`+}++func (x *TaskDatabaseUpdatePayload) Reset() {+ *x = TaskDatabaseUpdatePayload{}+ if protoimpl.UnsafeEnabled {+ mi := &file_store_task_proto_msgTypes[1]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *TaskDatabaseUpdatePayload) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*TaskDatabaseUpdatePayload) ProtoMessage() {}++func (x *TaskDatabaseUpdatePayload) ProtoReflect() protoreflect.Message {+ mi := &file_store_task_proto_msgTypes[1]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use TaskDatabaseUpdatePayload.ProtoReflect.Descriptor instead.+func (*TaskDatabaseUpdatePayload) Descriptor() ([]byte, []int) {+ return file_store_task_proto_rawDescGZIP(), []int{1}+}++func (x *TaskDatabaseUpdatePayload) GetSkipped() bool {+ if x != nil {+ return x.Skipped+ }+ return false+}++func (x *TaskDatabaseUpdatePayload) GetSkippedReason() string {+ if x != nil {+ return x.SkippedReason+ }+ return ""+}++func (x *TaskDatabaseUpdatePayload) GetSpecId() string {+ if x != nil {+ return x.SpecId+ }+ return ""+}++func (x *TaskDatabaseUpdatePayload) GetSchemaVersion() string {+ if x != nil {+ return x.SchemaVersion+ }+ return ""+}++func (x *TaskDatabaseUpdatePayload) GetSheetId() int32 {+ if x != nil {+ return x.SheetId+ }+ return 0+}++func (x *TaskDatabaseUpdatePayload) GetPreUpdateBackupDetail() *PreUpdateBackupDetail {+ if x != nil {+ return x.PreUpdateBackupDetail+ }+ return nil+}++func (x *TaskDatabaseUpdatePayload) GetFlags() map[string]string {+ if x != nil {+ return x.Flags+ }+ return nil+}++// TaskDatabaseDataExportPayload is the task payload for database data export.+type TaskDatabaseDataExportPayload struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // common fields+ SpecId string `protobuf:"bytes,1,opt,name=spec_id,json=specId,proto3" json:"spec_id,omitempty"`+ SheetId int32 `protobuf:"varint,2,opt,name=sheet_id,json=sheetId,proto3" json:"sheet_id,omitempty"`+ Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`+ Format ExportFormat `protobuf:"varint,4,opt,name=format,proto3,enum=bytebase.store.ExportFormat" json:"format,omitempty"`+}++func (x *TaskDatabaseDataExportPayload) Reset() {+ *x = TaskDatabaseDataExportPayload{}+ if protoimpl.UnsafeEnabled {+ mi := &file_store_task_proto_msgTypes[2]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *TaskDatabaseDataExportPayload) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*TaskDatabaseDataExportPayload) ProtoMessage() {}++func (x *TaskDatabaseDataExportPayload) ProtoReflect() protoreflect.Message {+ mi := &file_store_task_proto_msgTypes[2]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use TaskDatabaseDataExportPayload.ProtoReflect.Descriptor instead.+func (*TaskDatabaseDataExportPayload) Descriptor() ([]byte, []int) {+ return file_store_task_proto_rawDescGZIP(), []int{2}+}++func (x *TaskDatabaseDataExportPayload) GetSpecId() string {+ if x != nil {+ return x.SpecId+ }+ return ""+}++func (x *TaskDatabaseDataExportPayload) GetSheetId() int32 {+ if x != nil {+ return x.SheetId+ }+ return 0+}++func (x *TaskDatabaseDataExportPayload) GetPassword() string {+ if x != nil {+ return x.Password+ }+ return ""+}++func (x *TaskDatabaseDataExportPayload) GetFormat() ExportFormat {+ if x != nil {+ return x.Format+ }+ return ExportFormat_FORMAT_UNSPECIFIED+}++var File_store_task_proto protoreflect.FileDescriptor++var file_store_task_proto_rawDesc = []byte{+ 0x0a, 0x10, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f,+ 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,+ 0x72, 0x65, 0x1a, 0x12, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x6c,+ 0x61, 0x6e, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x72, 0x75, 0x6e, 0x2e, 0x70, 0x72, 0x6f,+ 0x74, 0x6f, 0x22, 0xf5, 0x02, 0x0a, 0x19, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x62,+ 0x61, 0x73, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,+ 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,+ 0x08, 0x52, 0x07, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x6b,+ 0x69, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x0d, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x52, 0x65, 0x61, 0x73, 0x6f,+ 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x06, 0x73, 0x70, 0x65, 0x63, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72,+ 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09,+ 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x74,+ 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,+ 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d,+ 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a,+ 0x08, 0x73, 0x68, 0x65, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52,+ 0x07, 0x73, 0x68, 0x65, 0x65, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x68, 0x61, 0x72,+ 0x61, 0x63, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52,+ 0x0c, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x53, 0x65, 0x74, 0x12, 0x1c, 0x0a,+ 0x09, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09,+ 0x52, 0x09, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x65,+ 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20,+ 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74,+ 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x0b, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x9d, 0x03, 0x0a, 0x19, 0x54,+ 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74,+ 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6b, 0x69, 0x70,+ 0x70, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x6b, 0x69, 0x70, 0x70,+ 0x65, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x72, 0x65,+ 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x6b, 0x69, 0x70,+ 0x70, 0x65, 0x64, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70, 0x65,+ 0x63, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x70, 0x65, 0x63,+ 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x76, 0x65, 0x72,+ 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x63, 0x68, 0x65,+ 0x6d, 0x61, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x68, 0x65,+ 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x68, 0x65,+ 0x65, 0x74, 0x49, 0x64, 0x12, 0x5e, 0x0a, 0x18, 0x70, 0x72, 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61,+ 0x74, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c,+ 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x72, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74,+ 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x15, 0x70,+ 0x72, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x44, 0x65,+ 0x74, 0x61, 0x69, 0x6c, 0x12, 0x4a, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x07, 0x20,+ 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73,+ 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,+ 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x46,+ 0x6c, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73,+ 0x1a, 0x38, 0x0a, 0x0a, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,+ 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,+ 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,+ 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xa5, 0x01, 0x0a, 0x1d, 0x54,+ 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x45,+ 0x78, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x17, 0x0a, 0x07,+ 0x73, 0x70, 0x65, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73,+ 0x70, 0x65, 0x63, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x68, 0x65, 0x65, 0x74, 0x5f, 0x69,+ 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x68, 0x65, 0x65, 0x74, 0x49, 0x64,+ 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x34, 0x0a, 0x06,+ 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x62,+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x78,+ 0x70, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d,+ 0x61, 0x74, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d,+ 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,+}++var (+ file_store_task_proto_rawDescOnce sync.Once+ file_store_task_proto_rawDescData = file_store_task_proto_rawDesc+)++func file_store_task_proto_rawDescGZIP() []byte {+ file_store_task_proto_rawDescOnce.Do(func() {+ file_store_task_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_task_proto_rawDescData)+ })+ return file_store_task_proto_rawDescData+}++var file_store_task_proto_msgTypes = make([]protoimpl.MessageInfo, 4)+var file_store_task_proto_goTypes = []any{+ (*TaskDatabaseCreatePayload)(nil), // 0: bytebase.store.TaskDatabaseCreatePayload+ (*TaskDatabaseUpdatePayload)(nil), // 1: bytebase.store.TaskDatabaseUpdatePayload+ (*TaskDatabaseDataExportPayload)(nil), // 2: bytebase.store.TaskDatabaseDataExportPayload+ nil, // 3: bytebase.store.TaskDatabaseUpdatePayload.FlagsEntry+ (*PreUpdateBackupDetail)(nil), // 4: bytebase.store.PreUpdateBackupDetail+ (ExportFormat)(0), // 5: bytebase.store.ExportFormat+}+var file_store_task_proto_depIdxs = []int32{+ 4, // 0: bytebase.store.TaskDatabaseUpdatePayload.pre_update_backup_detail:type_name -> bytebase.store.PreUpdateBackupDetail+ 3, // 1: bytebase.store.TaskDatabaseUpdatePayload.flags:type_name -> bytebase.store.TaskDatabaseUpdatePayload.FlagsEntry+ 5, // 2: bytebase.store.TaskDatabaseDataExportPayload.format:type_name -> bytebase.store.ExportFormat+ 3, // [3:3] is the sub-list for method output_type+ 3, // [3:3] is the sub-list for method input_type+ 3, // [3:3] is the sub-list for extension type_name+ 3, // [3:3] is the sub-list for extension extendee+ 0, // [0:3] is the sub-list for field type_name+}++func init() { file_store_task_proto_init() }+func file_store_task_proto_init() {+ if File_store_task_proto != nil {+ return+ }+ file_store_common_proto_init()+ file_store_plan_check_run_proto_init()+ if !protoimpl.UnsafeEnabled {+ file_store_task_proto_msgTypes[0].Exporter = func(v any, i int) any {+ switch v := v.(*TaskDatabaseCreatePayload); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_store_task_proto_msgTypes[1].Exporter = func(v any, i int) any {+ switch v := v.(*TaskDatabaseUpdatePayload); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_store_task_proto_msgTypes[2].Exporter = func(v any, i int) any {+ switch v := v.(*TaskDatabaseDataExportPayload); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ }+ type x struct{}+ out := protoimpl.TypeBuilder{+ File: protoimpl.DescBuilder{+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),+ RawDescriptor: file_store_task_proto_rawDesc,+ NumEnums: 0,+ NumMessages: 4,+ NumExtensions: 0,+ NumServices: 0,+ },+ GoTypes: file_store_task_proto_goTypes,+ DependencyIndexes: file_store_task_proto_depIdxs,+ MessageInfos: file_store_task_proto_msgTypes,+ }.Build()+ File_store_task_proto = out.File+ file_store_task_proto_rawDesc = nil+ file_store_task_proto_goTypes = nil+ file_store_task_proto_depIdxs = nil+}diff --git a/proto/store/common.proto b/proto/store/common.protoindex 3aef1e6f36..509930be60 100644--- a/proto/store/common.proto+++ b/proto/store/common.proto@@ -69,3 +69,8 @@ message Position {int32 line = 1;int32 column = 2;}++message DatabaseLabel {+ string key = 1;+ string value = 2;+}diff --git a/proto/store/plan_check_run.proto b/proto/store/plan_check_run.protoindex 977faf2288..f841d5a678 100644--- a/proto/store/plan_check_run.proto+++ b/proto/store/plan_check_run.proto@@ -7,6 +7,12 @@ import "store/instance_change_history.proto";option go_package = "generated-go/store";+message PreUpdateBackupDetail {+ // The database for keeping the backup data.+ // Format: instances/{instance}/databases/{database}+ string database = 1;+}+message PlanCheckRunConfig {int32 sheet_uid = 1;ChangeDatabaseType change_database_type = 2;@@ -17,11 +23,6 @@ message PlanCheckRunConfig {map<string, string> ghost_flags = 6;- message PreUpdateBackupDetail {- // The database for keeping the backup data.- // Format: instances/{instance}/databases/{database}- string database = 1;- }// If set, a backup of the modified data will be created automatically before any changes are applied.optional PreUpdateBackupDetail pre_update_backup_detail = 7;diff --git a/proto/store/task.proto b/proto/store/task.protonew file mode 100644index 0000000000..a47a0b8154--- /dev/null+++ b/proto/store/task.proto@@ -0,0 +1,51 @@+syntax = "proto3";++package bytebase.store;++import "store/common.proto";+import "store/plan_check_run.proto";++option go_package = "generated-go/store";++// TaskDatabaseCreatePayload is the task payload for creating databases.+message TaskDatabaseCreatePayload {+ // common fields+ bool skipped = 1;+ string skipped_reason = 2;+ string spec_id = 3;++ int32 project_id = 4;+ string database_name = 5;+ string table_name = 6;+ int32 sheet_id = 7;+ string character_set = 8;+ string collation = 9;+ string environment_id = 10;+ string labels = 11;+}++// TaskDatabaseDataUpdatePayload is the task payload for database data update (DML).+message TaskDatabaseUpdatePayload {+ // common fields+ bool skipped = 1;+ string skipped_reason = 2;+ string spec_id = 3;++ string schema_version = 4;+ int32 sheet_id = 5;++ PreUpdateBackupDetail pre_update_backup_detail = 6;++ // flags is used for ghost sync+ map<string, string> flags = 7;+}++// TaskDatabaseDataExportPayload is the task payload for database data export.+message TaskDatabaseDataExportPayload {+ // common fields+ string spec_id = 1;++ int32 sheet_id = 2;+ string password = 3;+ ExportFormat format = 4;+}