Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
refactor: use boolean instead of preUpdateBackupDetail (#16399)
boojack11fce01f19b4
diff --git a/backend/api/v1/plan_service.go b/backend/api/v1/plan_service.goindex 6ac5d94990..1d83dbadd4 100644--- a/backend/api/v1/plan_service.go+++ b/backend/api/v1/plan_service.go@@ -2,7 +2,6 @@ package v1import ("context"- "fmt""log/slog""slices""strings"@@ -485,7 +484,7 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *v1pb.UpdatePlanRereturn nil, err}- // PreUpdateBackupDetail+ // Prior Backupif err := func() error {if newTaskType != base.TaskDatabaseDataUpdate {return nil@@ -495,54 +494,11 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *v1pb.UpdatePlanRereturn nil}- // The target backup database name.- // Format: instances/{instance}/databases/{database}- var backupDatabaseName *string- if config.ChangeDatabaseConfig.PreUpdateBackupDetail == nil {- if task.Payload.GetPreUpdateBackupDetail().GetDatabase() != "" {- emptyValue := ""- backupDatabaseName = &emptyValue- }- } else {- if config.ChangeDatabaseConfig.PreUpdateBackupDetail.Database != task.Payload.GetPreUpdateBackupDetail().GetDatabase() {- backupDatabaseName = &config.ChangeDatabaseConfig.PreUpdateBackupDetail.Database- }- }- if backupDatabaseName != nil {- if *backupDatabaseName != "" {- // If backup is enabled, we need to check if the backup is available for the source database. AKA, the task's target database.- // Construct the source database name from the task's instance and database- sourceDatabaseName := fmt.Sprintf("instances/%s/databases/%s", task.InstanceID, task.GetDatabaseName())- instanceID, databaseName, err := common.GetInstanceDatabaseID(sourceDatabaseName)- if err != nil {- return errors.Wrapf(err, "failed to get instance database id from %q", sourceDatabaseName)- }- instance, err := s.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &instanceID})- if err != nil {- return errors.Wrapf(err, "failed to get instance %s", instanceID)- }- if instance == nil {- return status.Errorf(codes.NotFound, "instance %q not found", instanceID)- }- database, err := s.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{- InstanceID: &instanceID,- DatabaseName: &databaseName,- IsCaseSensitive: store.IsObjectCaseSensitive(instance),- })- if err != nil {- return errors.Wrapf(err, "failed to get database %s", databaseName)- }- if database == nil {- return status.Errorf(codes.NotFound, "database %q not found", databaseName)- }- if database.Metadata == nil || !database.Metadata.GetBackupAvailable() {- return status.Errorf(codes.FailedPrecondition, "backup is not available for database %q", databaseName)- }- }-- taskPatch.PreUpdateBackupDetail = &storepb.PreUpdateBackupDetail{- Database: *backupDatabaseName,- }+ // Check if backup setting has changed.+ planEnableBackup := config.ChangeDatabaseConfig.GetEnablePriorBackup()+ taskEnableBackup := task.Payload.GetEnablePriorBackup()+ if planEnableBackup != taskEnableBackup {+ taskPatch.EnablePriorBackup = &planEnableBackupdoUpdate = true}return nil@@ -667,8 +623,8 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *v1pb.UpdatePlanRevar doUpdateSheet boolfor _, taskPatch := range taskPatchList {- // If pre-backup detail has been updated, we need to rerun the plan check runs.- if taskPatch.PreUpdateBackupDetail != nil {+ // If backup setting has been updated, we need to rerun the plan check runs.+ if taskPatch.EnablePriorBackup != nil {planCheckRunsTrigger = true}if taskPatch.SheetID != nil {diff --git a/backend/api/v1/plan_service_plan_check.go b/backend/api/v1/plan_service_plan_check.goindex 2ebc76fa0a..9485dd3b2f 100644--- a/backend/api/v1/plan_service_plan_check.go+++ b/backend/api/v1/plan_service_plan_check.go@@ -181,22 +181,16 @@ func getPlanCheckRunsFromChangeDatabaseConfigForDatabase(ctx context.Context, s},})- preUpdateBackupDetail := (*storepb.PreUpdateBackupDetail)(nil)- if config.PreUpdateBackupDetail != nil {- preUpdateBackupDetail = &storepb.PreUpdateBackupDetail{- Database: config.PreUpdateBackupDetail.Database,- }- }planCheckRuns = append(planCheckRuns, &store.PlanCheckRunMessage{PlanUID: plan.UID,Status: store.PlanCheckRunStatusRunning,Type: store.PlanCheckDatabaseStatementAdvise,Config: &storepb.PlanCheckRunConfig{- SheetUid: int32(sheetUID),- ChangeDatabaseType: convertToChangeDatabaseType(config.Type),- InstanceId: instance.ResourceID,- DatabaseName: database.DatabaseName,- PreUpdateBackupDetail: preUpdateBackupDetail,+ SheetUid: int32(sheetUID),+ ChangeDatabaseType: convertToChangeDatabaseType(config.Type),+ InstanceId: instance.ResourceID,+ DatabaseName: database.DatabaseName,+ EnablePriorBackup: config.EnablePriorBackup,},})planCheckRuns = append(planCheckRuns, &store.PlanCheckRunMessage{diff --git a/backend/api/v1/rollout_service_converter.go b/backend/api/v1/rollout_service_converter.goindex f53f672cc6..eb044971ad 100644--- a/backend/api/v1/rollout_service_converter.go+++ b/backend/api/v1/rollout_service_converter.go@@ -104,14 +104,12 @@ func convertToPlanSpecChangeDatabaseConfig(config *storepb.PlanConfig_Spec_Changc := config.ChangeDatabaseConfigreturn &v1pb.Plan_Spec_ChangeDatabaseConfig{ChangeDatabaseConfig: &v1pb.Plan_ChangeDatabaseConfig{- Targets: c.Targets,- Sheet: c.Sheet,- Release: c.Release,- Type: convertToPlanSpecChangeDatabaseConfigType(c.Type),- GhostFlags: c.GhostFlags,- PreUpdateBackupDetail: &v1pb.Plan_ChangeDatabaseConfig_PreUpdateBackupDetail{- Database: c.PreUpdateBackupDetail.GetDatabase(),- },+ Targets: c.Targets,+ Sheet: c.Sheet,+ Release: c.Release,+ Type: convertToPlanSpecChangeDatabaseConfigType(c.Type),+ GhostFlags: c.GhostFlags,+ EnablePriorBackup: c.EnablePriorBackup,},}}@@ -232,20 +230,14 @@ func convertPlanConfigCreateDatabaseConfig(c *v1pb.Plan_CreateDatabaseConfig) *sfunc convertPlanSpecChangeDatabaseConfig(config *v1pb.Plan_Spec_ChangeDatabaseConfig) *storepb.PlanConfig_Spec_ChangeDatabaseConfig {c := config.ChangeDatabaseConfig- var preUpdateBackupDetail *storepb.PreUpdateBackupDetail- if c.PreUpdateBackupDetail != nil && c.GetPreUpdateBackupDetail().GetDatabase() != "" {- preUpdateBackupDetail = &storepb.PreUpdateBackupDetail{- Database: c.GetPreUpdateBackupDetail().GetDatabase(),- }- }return &storepb.PlanConfig_Spec_ChangeDatabaseConfig{ChangeDatabaseConfig: &storepb.PlanConfig_ChangeDatabaseConfig{- Targets: c.Targets,- Sheet: c.Sheet,- Release: c.Release,- Type: storepb.PlanConfig_ChangeDatabaseConfig_Type(c.Type),- GhostFlags: c.GhostFlags,- PreUpdateBackupDetail: preUpdateBackupDetail,+ Targets: c.Targets,+ Sheet: c.Sheet,+ Release: c.Release,+ Type: storepb.PlanConfig_ChangeDatabaseConfig_Type(c.Type),+ GhostFlags: c.GhostFlags,+ EnablePriorBackup: c.EnablePriorBackup,},}}diff --git a/backend/api/v1/rollout_service_task.go b/backend/api/v1/rollout_service_task.goindex cfa015fbb0..9f62b49138 100644--- a/backend/api/v1/rollout_service_task.go+++ b/backend/api/v1/rollout_service_task.go@@ -336,19 +336,15 @@ func getTaskCreatesFromChangeDatabaseConfigDatabaseTarget(if err != nil {return nil, errors.Wrapf(err, "failed to get sheet id from sheet %q", c.Sheet)}- preUpdateBackupDetail := &storepb.PreUpdateBackupDetail{}- if c.GetPreUpdateBackupDetail().GetDatabase() != "" {- preUpdateBackupDetail.Database = c.GetPreUpdateBackupDetail().GetDatabase()- }taskCreate := &store.TaskMessage{InstanceID: database.InstanceID,DatabaseName: &database.DatabaseName,EnvironmentID: database.EffectiveEnvironmentID,Type: base.TaskDatabaseDataUpdate,Payload: &storepb.TaskPayload{- SpecId: spec.Id,- SheetId: int32(sheetUID),- PreUpdateBackupDetail: preUpdateBackupDetail,+ SpecId: spec.Id,+ SheetId: int32(sheetUID),+ EnablePriorBackup: c.EnablePriorBackup,},}return []*store.TaskMessage{taskCreate}, nil@@ -436,10 +432,8 @@ func getTaskCreatesFromChangeDatabaseConfigWithRelease(}// Add pre-update backup detail for DML- if taskType == base.TaskDatabaseDataUpdate && c.GetPreUpdateBackupDetail().GetDatabase() != "" {- payload.PreUpdateBackupDetail = &storepb.PreUpdateBackupDetail{- Database: c.GetPreUpdateBackupDetail().GetDatabase(),- }+ if taskType == base.TaskDatabaseDataUpdate {+ payload.EnablePriorBackup = c.EnablePriorBackup}taskCreate := &store.TaskMessage{diff --git a/backend/migrator/migration/3.7/0016##migrate_enable_prior_backup.sql b/backend/migrator/migration/3.7/0016##migrate_enable_prior_backup.sqlnew file mode 100644index 0000000000..745de08d37--- /dev/null+++ b/backend/migrator/migration/3.7/0016##migrate_enable_prior_backup.sql@@ -0,0 +1,108 @@+-- Migrate from preUpdateBackupDetail structure to enablePriorBackup boolean field+-- This migration updates JSON payloads in plan.config, plan_check_run.config, and task.payload++-- Update plan.config field+-- Replace preUpdateBackupDetail objects with enablePriorBackup boolean in changeDatabaseConfig specs+UPDATE plan+SET config = (+ SELECT jsonb_set(+ config,+ '{specs}',+ COALESCE(+ (+ SELECT jsonb_agg(+ CASE+ WHEN spec->'changeDatabaseConfig'->'preUpdateBackupDetail' IS NOT NULL+ AND spec->'changeDatabaseConfig'->'preUpdateBackupDetail' != 'null'::jsonb+ AND spec->'changeDatabaseConfig'->'preUpdateBackupDetail'->>'database' IS NOT NULL+ AND spec->'changeDatabaseConfig'->'preUpdateBackupDetail'->>'database' != ''+ THEN+ -- Remove preUpdateBackupDetail and add enablePriorBackup: true+ jsonb_set(+ spec #- '{changeDatabaseConfig,preUpdateBackupDetail}',+ '{changeDatabaseConfig,enablePriorBackup}',+ 'true'::jsonb+ )+ WHEN spec->'changeDatabaseConfig'->'preUpdateBackupDetail' IS NOT NULL+ THEN+ -- Remove preUpdateBackupDetail and add enablePriorBackup: false+ jsonb_set(+ spec #- '{changeDatabaseConfig,preUpdateBackupDetail}',+ '{changeDatabaseConfig,enablePriorBackup}',+ 'false'::jsonb+ )+ ELSE+ -- No preUpdateBackupDetail, keep spec as-is+ spec+ END+ )+ FROM jsonb_array_elements(config->'specs') AS spec+ ),+ '[]'::jsonb+ )+ )+)+WHERE config->'specs' IS NOT NULL+ AND EXISTS (+ SELECT 1+ FROM jsonb_array_elements(config->'specs') AS spec+ WHERE spec->'changeDatabaseConfig'->'preUpdateBackupDetail' IS NOT NULL+ );++-- Update plan_check_run.config field+-- Replace preUpdateBackupDetail with enablePriorBackup in plan check run configs+UPDATE plan_check_run+SET config = CASE+ WHEN config->'preUpdateBackupDetail' IS NOT NULL+ AND config->'preUpdateBackupDetail' != 'null'::jsonb+ AND config->'preUpdateBackupDetail'->>'database' IS NOT NULL+ AND config->'preUpdateBackupDetail'->>'database' != ''+ THEN+ -- Remove preUpdateBackupDetail and add enablePriorBackup: true+ jsonb_set(+ config #- '{preUpdateBackupDetail}',+ '{enablePriorBackup}',+ 'true'::jsonb+ )+ WHEN config->'preUpdateBackupDetail' IS NOT NULL+ THEN+ -- Remove preUpdateBackupDetail and add enablePriorBackup: false+ jsonb_set(+ config #- '{preUpdateBackupDetail}',+ '{enablePriorBackup}',+ 'false'::jsonb+ )+ ELSE+ -- No preUpdateBackupDetail, keep config as-is+ config+END+WHERE config->'preUpdateBackupDetail' IS NOT NULL;++-- Update task.payload field+-- Replace preUpdateBackupDetail with enablePriorBackup in task payloads+UPDATE task+SET payload = CASE+ WHEN payload->'preUpdateBackupDetail' IS NOT NULL+ AND payload->'preUpdateBackupDetail' != 'null'::jsonb+ AND payload->'preUpdateBackupDetail'->>'database' IS NOT NULL+ AND payload->'preUpdateBackupDetail'->>'database' != ''+ THEN+ -- Remove preUpdateBackupDetail and add enablePriorBackup: true+ jsonb_set(+ payload #- '{preUpdateBackupDetail}',+ '{enablePriorBackup}',+ 'true'::jsonb+ )+ WHEN payload->'preUpdateBackupDetail' IS NOT NULL+ THEN+ -- Remove preUpdateBackupDetail and add enablePriorBackup: false+ jsonb_set(+ payload #- '{preUpdateBackupDetail}',+ '{enablePriorBackup}',+ 'false'::jsonb+ )+ ELSE+ -- No preUpdateBackupDetail, keep payload as-is+ payload+END+WHERE payload->'preUpdateBackupDetail' IS NOT NULL;diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.goindex e473084ba1..ea98c65952 100644--- a/backend/migrator/migrator_test.go+++ b/backend/migrator/migrator_test.go@@ -12,7 +12,7 @@ import (func TestLatestVersion(t *testing.T) {files, err := getSortedVersionedFiles()require.NoError(t, err)- require.Equal(t, semver.MustParse("3.7.15"), *files[len(files)-1].version)+ require.Equal(t, semver.MustParse("3.7.16"), *files[len(files)-1].version)}func TestVersionUnique(t *testing.T) {diff --git a/backend/plugin/advisor/advisor.go b/backend/plugin/advisor/advisor.goindex d1f48b1a90..9307dfe4cc 100644--- a/backend/plugin/advisor/advisor.go+++ b/backend/plugin/advisor/advisor.go@@ -37,7 +37,7 @@ func NewStatusBySQLReviewRuleLevel(level storepb.SQLReviewRuleLevel) (storepb.Adtype Context struct {DBSchema *storepb.DatabaseSchemaMetadataChangeType storepb.PlanCheckRunConfig_ChangeDatabaseType- PreUpdateBackupDetail *storepb.PreUpdateBackupDetail+ EnablePriorBackup boolClassificationConfig *storepb.DataClassificationSetting_DataClassificationConfigListDatabaseNamesFunc base.ListDatabaseNamesFuncInstanceID stringdiff --git a/backend/plugin/advisor/mssql/advisor_builtin_prior_backup_check.go b/backend/plugin/advisor/mssql/advisor_builtin_prior_backup_check.goindex 109472d8ef..18446b1c5e 100644--- a/backend/plugin/advisor/mssql/advisor_builtin_prior_backup_check.go+++ b/backend/plugin/advisor/mssql/advisor_builtin_prior_backup_check.go@@ -4,12 +4,12 @@ import ("context""fmt""log/slog"- "strings""github.com/antlr4-go/antlr/v4"parser "github.com/bytebase/tsql-parser""github.com/pkg/errors"+ "github.com/bytebase/bytebase/backend/base""github.com/bytebase/bytebase/backend/common""github.com/bytebase/bytebase/backend/plugin/advisor"tsqlparser "github.com/bytebase/bytebase/backend/plugin/parser/tsql"@@ -34,7 +34,7 @@ type StatementPriorBackupCheckAdvisor struct {}func (*StatementPriorBackupCheckAdvisor) Check(ctx context.Context, checkCtx advisor.Context) ([]*storepb.Advice, error) {- if checkCtx.PreUpdateBackupDetail == nil || checkCtx.ChangeType != storepb.PlanCheckRunConfig_DML {+ if !checkCtx.EnablePriorBackup || checkCtx.ChangeType != storepb.PlanCheckRunConfig_DML {return nil, nil}@@ -60,12 +60,12 @@ func (*StatementPriorBackupCheckAdvisor) Check(ctx context.Context, checkCtx adv})}- databaseName := extractDatabaseName(checkCtx.PreUpdateBackupDetail.Database)+ databaseName := base.BackupDatabaseNameOfEngine(storepb.Engine_MSSQL)if !advisor.DatabaseExists(ctx, checkCtx, databaseName) {adviceList = append(adviceList, &storepb.Advice{Status: level,Title: title,- Content: fmt.Sprintf("Need database %q to do prior backup but it does not exist", checkCtx.PreUpdateBackupDetail.Database),+ Content: fmt.Sprintf("Need database %q to do prior backup but it does not exist", databaseName),Code: advisor.DatabaseNotExists.Int32(),StartPosition: common.ConvertANTLRLineToPosition(1),})@@ -343,8 +343,3 @@ func (l *statementDisallowMixDMLChecker) EnterDelete_statement(ctx *parser.Deletl.deleteStatements = append(l.deleteStatements, ctx)}}--func extractDatabaseName(databaseUID string) string {- segments := strings.Split(databaseUID, "/")- return segments[len(segments)-1]-}diff --git a/backend/plugin/advisor/mysql/advisor_builtin_prior_backup_check.go b/backend/plugin/advisor/mysql/advisor_builtin_prior_backup_check.goindex 474ae1b46e..b65e45ae9a 100644--- a/backend/plugin/advisor/mysql/advisor_builtin_prior_backup_check.go+++ b/backend/plugin/advisor/mysql/advisor_builtin_prior_backup_check.go@@ -3,11 +3,11 @@ package mysqlimport ("context""fmt"- "strings""github.com/antlr4-go/antlr/v4""github.com/pkg/errors"+ "github.com/bytebase/bytebase/backend/base""github.com/bytebase/bytebase/backend/common""github.com/bytebase/bytebase/backend/plugin/advisor"mysqlparser "github.com/bytebase/bytebase/backend/plugin/parser/mysql"@@ -26,7 +26,7 @@ type StatementPriorBackupCheckAdvisor struct {}func (*StatementPriorBackupCheckAdvisor) Check(ctx context.Context, checkCtx advisor.Context) ([]*storepb.Advice, error) {- if checkCtx.PreUpdateBackupDetail == nil || checkCtx.ChangeType != storepb.PlanCheckRunConfig_DML {+ if !checkCtx.EnablePriorBackup || checkCtx.ChangeType != storepb.PlanCheckRunConfig_DML {return nil, nil}@@ -67,12 +67,12 @@ func (*StatementPriorBackupCheckAdvisor) Check(ctx context.Context, checkCtx adv}}- databaseName := extractDatabaseName(checkCtx.PreUpdateBackupDetail.Database)+ databaseName := base.BackupDatabaseNameOfEngine(storepb.Engine_MYSQL)if !advisor.DatabaseExists(ctx, checkCtx, databaseName) {adviceList = append(adviceList, &storepb.Advice{Status: level,Title: title,- Content: fmt.Sprintf("Need database %q to do prior backup but it does not exist", checkCtx.PreUpdateBackupDetail.Database),+ Content: fmt.Sprintf("Need database %q to do prior backup but it does not exist", databaseName),Code: advisor.DatabaseNotExists.Int32(),StartPosition: common.FirstLinePosition,})@@ -129,8 +129,3 @@ func prepareTransformation(databaseName string, parseResult []*mysqlparser.Parsereturn result, nil}--func extractDatabaseName(databaseUID string) string {- segments := strings.Split(databaseUID, "/")- return segments[len(segments)-1]-}diff --git a/backend/plugin/advisor/oracle/advisor_builtin_prior_backup_check.go b/backend/plugin/advisor/oracle/advisor_builtin_prior_backup_check.goindex 18df712ee1..f93becaff3 100644--- a/backend/plugin/advisor/oracle/advisor_builtin_prior_backup_check.go+++ b/backend/plugin/advisor/oracle/advisor_builtin_prior_backup_check.go@@ -3,13 +3,13 @@ package oracleimport ("context""fmt"- "strings""github.com/antlr4-go/antlr/v4""github.com/pkg/errors"plsql "github.com/bytebase/plsql-parser"+ "github.com/bytebase/bytebase/backend/base""github.com/bytebase/bytebase/backend/common""github.com/bytebase/bytebase/backend/plugin/advisor"plsqlparser "github.com/bytebase/bytebase/backend/plugin/parser/plsql"@@ -28,7 +28,7 @@ type StatementPriorBackupCheckAdvisor struct {}func (*StatementPriorBackupCheckAdvisor) Check(ctx context.Context, checkCtx advisor.Context) ([]*storepb.Advice, error) {- if checkCtx.PreUpdateBackupDetail == nil || checkCtx.ChangeType != storepb.PlanCheckRunConfig_DML {+ if !checkCtx.EnablePriorBackup || checkCtx.ChangeType != storepb.PlanCheckRunConfig_DML {return nil, nil}@@ -54,12 +54,12 @@ func (*StatementPriorBackupCheckAdvisor) Check(ctx context.Context, checkCtx adv})}- databaseName := extractDatabaseName(checkCtx.PreUpdateBackupDetail.Database)+ databaseName := base.BackupDatabaseNameOfEngine(storepb.Engine_ORACLE)if !advisor.DatabaseExists(ctx, checkCtx, databaseName) {adviceList = append(adviceList, &storepb.Advice{Status: level,Title: title,- Content: fmt.Sprintf("Need database %q to do prior backup but it does not exist", checkCtx.PreUpdateBackupDetail.Database),+ Content: fmt.Sprintf("Need database %q to do prior backup but it does not exist", databaseName),Code: advisor.DatabaseNotExists.Int32(),StartPosition: common.FirstLinePosition,})@@ -261,8 +261,3 @@ func (l *statementDisallowMixDMLChecker) EnterUnit_statement(ctx *plsql.Unit_stal.hasDDL = true}}--func extractDatabaseName(databaseUID string) string {- segments := strings.Split(databaseUID, "/")- return segments[len(segments)-1]-}diff --git a/backend/plugin/advisor/pg/advisor_builtin_prior_backup_check.go b/backend/plugin/advisor/pg/advisor_builtin_prior_backup_check.goindex ed41da1cef..eef9c748b3 100644--- a/backend/plugin/advisor/pg/advisor_builtin_prior_backup_check.go+++ b/backend/plugin/advisor/pg/advisor_builtin_prior_backup_check.go@@ -6,13 +6,13 @@ import ("context""fmt""log/slog"- "strings""github.com/antlr4-go/antlr/v4""github.com/pkg/errors"parser "github.com/bytebase/postgresql-parser"+ "github.com/bytebase/bytebase/backend/base""github.com/bytebase/bytebase/backend/common""github.com/bytebase/bytebase/backend/common/log""github.com/bytebase/bytebase/backend/plugin/advisor"@@ -39,7 +39,7 @@ type BuiltinPriorBackupCheckAdvisor struct {// Check checks for disallow mix DDL and DML.func (*BuiltinPriorBackupCheckAdvisor) Check(_ context.Context, checkCtx advisor.Context) ([]*storepb.Advice, error) {- if checkCtx.PreUpdateBackupDetail == nil || checkCtx.ChangeType != storepb.PlanCheckRunConfig_DML {+ if !checkCtx.EnablePriorBackup || checkCtx.ChangeType != storepb.PlanCheckRunConfig_DML {return nil, nil}var adviceList []*storepb.Advice@@ -66,12 +66,12 @@ func (*BuiltinPriorBackupCheckAdvisor) Check(_ context.Context, checkCtx advisor}}- name := extractDatabaseName(checkCtx.PreUpdateBackupDetail.Database)- if !checkCtx.Catalog.Origin.HasSchema(name) {+ schemaName := base.BackupDatabaseNameOfEngine(storepb.Engine_POSTGRES)+ if !checkCtx.Catalog.Origin.HasSchema(schemaName) {adviceList = append(adviceList, &storepb.Advice{Status: level,Title: title,- Content: fmt.Sprintf("Need schema %q to do prior backup but it does not exist", name),+ Content: fmt.Sprintf("Need schema %q to do prior backup but it does not exist", schemaName),Code: advisor.SchemaNotExists.Int32(),StartPosition: common.FirstLinePosition,})@@ -240,8 +240,3 @@ func extractTableReference(ctx parser.IRelation_expr_opt_aliasContext) *TableRef}return &table}--func extractDatabaseName(databaseUID string) string {- segments := strings.Split(databaseUID, "/")- return segments[len(segments)-1]-}diff --git a/backend/plugin/advisor/sql_review.go b/backend/plugin/advisor/sql_review.goindex 475a57f3a4..8aa767bb5f 100644--- a/backend/plugin/advisor/sql_review.go+++ b/backend/plugin/advisor/sql_review.go@@ -501,7 +501,7 @@ type SQLReviewCheckContext struct {DBType storepb.EngineCatalog catalogInterfaceDriver *sql.DB- PreUpdateBackupDetail *storepb.PreUpdateBackupDetail+ EnablePriorBackup boolClassificationConfig *storepb.DataClassificationSetting_DataClassificationConfigListDatabaseNamesFunc base.ListDatabaseNamesFuncInstanceID string@@ -577,7 +577,7 @@ func SQLReviewCheck(Context{DBSchema: checkContext.DBSchema,ChangeType: checkContext.ChangeType,- PreUpdateBackupDetail: checkContext.PreUpdateBackupDetail,+ EnablePriorBackup: checkContext.EnablePriorBackup,AST: asts,Statements: statements,Rule: rule,diff --git a/backend/plugin/advisor/tidb/advisor_builtin_prior_backup_check.go b/backend/plugin/advisor/tidb/advisor_builtin_prior_backup_check.goindex 0f0016f639..c8608f3c81 100644--- a/backend/plugin/advisor/tidb/advisor_builtin_prior_backup_check.go+++ b/backend/plugin/advisor/tidb/advisor_builtin_prior_backup_check.go@@ -10,6 +10,7 @@ import ("github.com/pingcap/tidb/pkg/parser/opcode""github.com/pkg/errors"+ "github.com/bytebase/bytebase/backend/base""github.com/bytebase/bytebase/backend/common""github.com/bytebase/bytebase/backend/common/log""github.com/bytebase/bytebase/backend/plugin/advisor"@@ -34,7 +35,7 @@ type StatementPriorBackupCheckAdvisor struct {// Check checks for no mixed DDL and DML.func (*StatementPriorBackupCheckAdvisor) Check(ctx context.Context, checkCtx advisor.Context) ([]*storepb.Advice, error) {- if checkCtx.PreUpdateBackupDetail == nil || checkCtx.ChangeType != storepb.PlanCheckRunConfig_DML {+ if !checkCtx.EnablePriorBackup || checkCtx.ChangeType != storepb.PlanCheckRunConfig_DML {return nil, nil}@@ -78,11 +79,12 @@ func (*StatementPriorBackupCheckAdvisor) Check(ctx context.Context, checkCtx adv}}- if !advisor.DatabaseExists(ctx, checkCtx, extractDatabaseName(checkCtx.PreUpdateBackupDetail.Database)) {+ databaseName := base.BackupDatabaseNameOfEngine(storepb.Engine_TIDB)+ if !advisor.DatabaseExists(ctx, checkCtx, databaseName) {adviceList = append(adviceList, &storepb.Advice{Status: level,Title: title,- Content: fmt.Sprintf("Need database %q to do prior backup but it does not exist", checkCtx.PreUpdateBackupDetail.Database),+ Content: fmt.Sprintf("Need database %q to do prior backup but it does not exist", databaseName),Code: advisor.DatabaseNotExists.Int32(),StartPosition: common.FirstLinePosition,})@@ -219,11 +221,6 @@ func equalTable(t1, t2 *table) bool {return t1.database == t2.database && t1.table == t2.table}-func extractDatabaseName(databaseUID string) string {- segments := strings.Split(databaseUID, "/")- return segments[len(segments)-1]-}-type table struct {database stringtable stringdiff --git a/backend/plugin/advisor/utils_for_tests.go b/backend/plugin/advisor/utils_for_tests.goindex 91e212240f..138ab6a4fa 100644--- a/backend/plugin/advisor/utils_for_tests.go+++ b/backend/plugin/advisor/utils_for_tests.go@@ -222,17 +222,15 @@ func RunSQLReviewRuleTest(t *testing.T, rule SQLReviewRuleType, dbType storepb.E}checkCtx := SQLReviewCheckContext{- Charset: "",- Collation: "",- DBType: dbType,- Catalog: &testCatalog{finder: finder},- Driver: nil,- CurrentDatabase: curDB,- DBSchema: schemaMetadata,- ChangeType: tc.ChangeType,- PreUpdateBackupDetail: &storepb.PreUpdateBackupDetail{- Database: "instances/instanceName/databases/bbdataarchive", // MySQL backup database for testing- },+ Charset: "",+ Collation: "",+ DBType: dbType,+ Catalog: &testCatalog{finder: finder},+ Driver: nil,+ CurrentDatabase: curDB,+ DBSchema: schemaMetadata,+ ChangeType: tc.ChangeType,+ EnablePriorBackup: true, // Enable backup for testingNoAppendBuiltin: true,UsePostgresDatabaseOwner: true,}diff --git a/backend/runner/plancheck/statement_advise_executor.go b/backend/runner/plancheck/statement_advise_executor.goindex 8972b90c00..9fcac524cf 100644--- a/backend/runner/plancheck/statement_advise_executor.go+++ b/backend/runner/plancheck/statement_advise_executor.go@@ -91,7 +91,7 @@ func (e *StatementAdviseExecutor) Run(ctx context.Context, config *storepb.PlanCreturn nil, err}changeType := config.ChangeDatabaseType- preUpdateBackupDetail := config.PreUpdateBackupDetail+ enablePriorBackup := config.EnablePriorBackupinstance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &config.InstanceId})if err != nil {@@ -119,7 +119,7 @@ func (e *StatementAdviseExecutor) Run(ctx context.Context, config *storepb.PlanCreturn nil, errors.Errorf("database not found %q", config.DatabaseName)}- results, err := e.runReview(ctx, instance, database, changeType, statement, preUpdateBackupDetail)+ results, err := e.runReview(ctx, instance, database, changeType, statement, enablePriorBackup)if err != nil {return nil, err}@@ -144,7 +144,7 @@ func (e *StatementAdviseExecutor) runReview(database *store.DatabaseMessage,changeType storepb.PlanCheckRunConfig_ChangeDatabaseType,statement string,- preUpdateBackupDetail *storepb.PreUpdateBackupDetail,+ enablePriorBackup bool,) ([]*storepb.PlanCheckRunResult_Result, error) {dbSchema, err := e.store.GetDBSchema(ctx, database.InstanceID, database.DatabaseName)if err != nil {@@ -199,7 +199,7 @@ func (e *StatementAdviseExecutor) runReview(DBType: instance.Metadata.GetEngine(),Catalog: catalog,Driver: connection,- PreUpdateBackupDetail: preUpdateBackupDetail,+ EnablePriorBackup: enablePriorBackup,ClassificationConfig: classificationConfig,UsePostgresDatabaseOwner: useDatabaseOwner,ListDatabaseNamesFunc: e.buildListDatabaseNamesFunc(),diff --git a/backend/runner/taskrun/data_update_executor.go b/backend/runner/taskrun/data_update_executor.goindex 51784dc4eb..15c8817265 100644--- a/backend/runner/taskrun/data_update_executor.go+++ b/backend/runner/taskrun/data_update_executor.go@@ -164,13 +164,14 @@ func (exec *DataUpdateExecutor) backupData(instance *store.InstanceMessage,database *store.DatabaseMessage,) (*storepb.PriorBackupDetail, error) {- if payload.GetPreUpdateBackupDetail().GetDatabase() == "" {+ if !payload.GetEnablePriorBackup() {return nil, nil}sourceDatabaseName := common.FormatDatabase(database.InstanceID, database.DatabaseName)// Format: instances/{instance}/databases/{database}- targetDatabaseName := payload.PreUpdateBackupDetail.Database+ backupDBName := base.BackupDatabaseNameOfEngine(instance.Metadata.GetEngine())+ targetDatabaseName := common.FormatDatabase(database.InstanceID, backupDBName)var backupDatabase *store.DatabaseMessagevar backupDriver db.Driver@@ -331,7 +332,7 @@ func (exec *DataUpdateExecutor) backupData(if instance.Metadata.GetEngine() != storepb.Engine_POSTGRES {if err := exec.schemaSyncer.SyncDatabaseSchema(ctx, backupDatabase); err != nil {slog.Error("failed to sync backup database schema",- slog.String("database", payload.PreUpdateBackupDetail.Database),+ slog.String("database", targetDatabaseName),log.BBError(err),)}diff --git a/backend/store/task.go b/backend/store/task.goindex 87744a2c5f..a22e3ecd03 100644--- a/backend/store/task.go+++ b/backend/store/task.go@@ -76,11 +76,11 @@ type TaskPatch struct {DatabaseName *stringType *base.TaskType- SheetID *int- SchemaVersion *string- ExportFormat *storepb.ExportFormat- ExportPassword *string- PreUpdateBackupDetail *storepb.PreUpdateBackupDetail+ SheetID *int+ SchemaVersion *string+ ExportFormat *storepb.ExportFormat+ ExportPassword *string+ EnablePriorBackup *bool// Flags for gh-ost.Flags *map[string]string@@ -385,12 +385,8 @@ func (s *Store) UpdateTaskV2(ctx context.Context, patch *TaskPatch) (*TaskMessagif v := patch.ExportPassword; v != nil {payloadSet, args = append(payloadSet, fmt.Sprintf(`jsonb_build_object('password', $%d::TEXT)`, len(args)+1)), append(args, *v)}- if v := patch.PreUpdateBackupDetail; v != nil {- jsonb, err := json.Marshal(v)- if err != nil {- return nil, errors.Wrapf(err, "failed to marshal preUpdateBackupDetail")- }- payloadSet, args = append(payloadSet, fmt.Sprintf(`jsonb_build_object('preUpdateBackupDetail', $%d::JSONB)`, len(args)+1)), append(args, jsonb)+ if v := patch.EnablePriorBackup; v != nil {+ payloadSet, args = append(payloadSet, fmt.Sprintf(`jsonb_build_object('enablePriorBackup', $%d::BOOLEAN)`, len(args)+1)), append(args, *v)}if v := patch.Flags; v != nil {jsonb, err := json.Marshal(v)diff --git a/frontend/src/components/Plan/components/Sidebar/PreBackupSection/context.ts b/frontend/src/components/Plan/components/Sidebar/PreBackupSection/context.tsindex d5c12a2073..8258744e21 100644--- a/frontend/src/components/Plan/components/Sidebar/PreBackupSection/context.ts+++ b/frontend/src/components/Plan/components/Sidebar/PreBackupSection/context.ts@@ -1,5 +1,5 @@import Emittery from "emittery";-import { cloneDeep, head } from "lodash-es";+import { cloneDeep } from "lodash-es";import {computed,inject,@@ -24,12 +24,7 @@ import {Task_Status,type Rollout,} from "@/types/proto/v1/rollout_service";-import {- flattenTaskV1List,- hasProjectPermissionV2,- isNullOrUndefined,-} from "@/utils";-import { getArchiveDatabase } from "./utils";+import { flattenTaskV1List, hasProjectPermissionV2 } from "@/utils";export const PRE_BACKUP_AVAILABLE_ENGINES = [Engine.MYSQL,@@ -130,34 +125,16 @@ export const providePreBackupSettingContext = (refs: {});const enabled = computed((): boolean => {- const preBackupDatabase =- selectedSpec.value?.changeDatabaseConfig?.preUpdateBackupDetail?.database;- return !isNullOrUndefined(preBackupDatabase) && preBackupDatabase !== "";- });-- // TODO(steven): remove me.- const archiveDatabase = computed((): string => {- const database = head(databases.value);- return getArchiveDatabase(- database?.instanceResource.engine || Engine.MYSQL- );+ return Boolean(selectedSpec.value?.changeDatabaseConfig?.enablePriorBackup);});const toggle = async (on: boolean) => {if (isCreating.value) {if (selectedSpec.value && selectedSpec.value.changeDatabaseConfig) {if (on) {- // TODO(steven): switch to boolean value.- const database = head(databases.value);- selectedSpec.value.changeDatabaseConfig.preUpdateBackupDetail = {- database:- (database?.instance || "instances/UNKNOWN_INSTANCE") +- "/databases/" +- archiveDatabase.value,- };+ selectedSpec.value.changeDatabaseConfig.enablePriorBackup = true;} else {- selectedSpec.value.changeDatabaseConfig.preUpdateBackupDetail =- undefined;+ selectedSpec.value.changeDatabaseConfig.enablePriorBackup = false;}}} else {@@ -172,16 +149,9 @@ export const providePreBackupSettingContext = (refs: {);}if (on) {- // TODO(steven): switch to boolean value.- const database = head(databases.value);- spec.changeDatabaseConfig.preUpdateBackupDetail = {- database:- (database?.instance || "instances/UNKNOWN_INSTANCE") +- "/databases/" +- archiveDatabase.value,- };+ spec.changeDatabaseConfig.enablePriorBackup = true;} else {- spec.changeDatabaseConfig.preUpdateBackupDetail = undefined;+ spec.changeDatabaseConfig.enablePriorBackup = false;}await planServiceClient.updatePlan({diff --git a/frontend/src/components/Plan/components/Sidebar/PreBackupSection/utils.ts b/frontend/src/components/Plan/components/Sidebar/PreBackupSection/utils.tsdeleted file mode 100644index cd9f2f3bfe..0000000000--- a/frontend/src/components/Plan/components/Sidebar/PreBackupSection/utils.ts+++ /dev/null@@ -1,8 +0,0 @@-import { Engine } from "@/types/proto/v1/common";--export const getArchiveDatabase = (engine: Engine): string => {- if (engine === Engine.ORACLE) {- return "BBDATAARCHIVE";- }- return "bbdataarchive";-};diff --git a/frontend/src/types/proto/v1/plan_service.ts b/frontend/src/types/proto/v1/plan_service.tsindex fb2e429ae0..efecdd2020 100644--- a/frontend/src/types/proto/v1/plan_service.ts+++ b/frontend/src/types/proto/v1/plan_service.ts@@ -228,7 +228,7 @@ export interface Plan_ChangeDatabaseConfig {type: Plan_ChangeDatabaseConfig_Type;ghostFlags: { [key: string]: string };/** If set, a backup of the modified data will be created automatically before any changes are applied. */- preUpdateBackupDetail?: Plan_ChangeDatabaseConfig_PreUpdateBackupDetail | undefined;+ enablePriorBackup: boolean;}/** Type is the database change type. */@@ -310,14 +310,6 @@ export interface Plan_ChangeDatabaseConfig_GhostFlagsEntry {value: string;}-export interface Plan_ChangeDatabaseConfig_PreUpdateBackupDetail {- /**- * The database for keeping the backup data.- * Format: instances/{instance}/databases/{database}- */- database: string;-}-export interface Plan_ExportDataConfig {/*** The list of targets.@@ -1820,7 +1812,7 @@ function createBasePlan_ChangeDatabaseConfig(): Plan_ChangeDatabaseConfig {release: "",type: Plan_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED,ghostFlags: {},- preUpdateBackupDetail: undefined,+ enablePriorBackup: false,};}@@ -1841,9 +1833,8 @@ export const Plan_ChangeDatabaseConfig: MessageFns<Plan_ChangeDatabaseConfig> =Object.entries(message.ghostFlags).forEach(([key, value]) => {Plan_ChangeDatabaseConfig_GhostFlagsEntry.encode({ key: key as any, value }, writer.uint32(58).fork()).join();});- if (message.preUpdateBackupDetail !== undefined) {- Plan_ChangeDatabaseConfig_PreUpdateBackupDetail.encode(message.preUpdateBackupDetail, writer.uint32(66).fork())- .join();+ if (message.enablePriorBackup !== false) {+ writer.uint32(64).bool(message.enablePriorBackup);}return writer;},@@ -1899,14 +1890,11 @@ export const Plan_ChangeDatabaseConfig: MessageFns<Plan_ChangeDatabaseConfig> =continue;}case 8: {- if (tag !== 66) {+ if (tag !== 64) {break;}- message.preUpdateBackupDetail = Plan_ChangeDatabaseConfig_PreUpdateBackupDetail.decode(- reader,- reader.uint32(),- );+ message.enablePriorBackup = reader.bool();continue;}}@@ -1941,8 +1929,8 @@ export const Plan_ChangeDatabaseConfig: MessageFns<Plan_ChangeDatabaseConfig> =});}}- if (message.preUpdateBackupDetail !== undefined) {- obj.preUpdateBackupDetail = Plan_ChangeDatabaseConfig_PreUpdateBackupDetail.toJSON(message.preUpdateBackupDetail);+ if (message.enablePriorBackup !== false) {+ obj.enablePriorBackup = message.enablePriorBackup;}return obj;},@@ -1965,10 +1953,7 @@ export const Plan_ChangeDatabaseConfig: MessageFns<Plan_ChangeDatabaseConfig> =},{},);- message.preUpdateBackupDetail =- (object.preUpdateBackupDetail !== undefined && object.preUpdateBackupDetail !== null)- ? Plan_ChangeDatabaseConfig_PreUpdateBackupDetail.fromPartial(object.preUpdateBackupDetail)- : undefined;+ message.enablePriorBackup = object.enablePriorBackup ?? false;return message;},};@@ -2044,69 +2029,6 @@ export const Plan_ChangeDatabaseConfig_GhostFlagsEntry: MessageFns<Plan_ChangeDa},};-function createBasePlan_ChangeDatabaseConfig_PreUpdateBackupDetail(): Plan_ChangeDatabaseConfig_PreUpdateBackupDetail {- return { database: "" };-}--export const Plan_ChangeDatabaseConfig_PreUpdateBackupDetail: MessageFns<- Plan_ChangeDatabaseConfig_PreUpdateBackupDetail-> = {- encode(- message: Plan_ChangeDatabaseConfig_PreUpdateBackupDetail,- writer: BinaryWriter = new BinaryWriter(),- ): BinaryWriter {- if (message.database !== "") {- writer.uint32(10).string(message.database);- }- return writer;- },-- decode(input: BinaryReader | Uint8Array, length?: number): Plan_ChangeDatabaseConfig_PreUpdateBackupDetail {- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBasePlan_ChangeDatabaseConfig_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.skip(tag & 7);- }- return message;- },-- toJSON(message: Plan_ChangeDatabaseConfig_PreUpdateBackupDetail): unknown {- const obj: any = {};- if (message.database !== "") {- obj.database = message.database;- }- return obj;- },-- create(- base?: DeepPartial<Plan_ChangeDatabaseConfig_PreUpdateBackupDetail>,- ): Plan_ChangeDatabaseConfig_PreUpdateBackupDetail {- return Plan_ChangeDatabaseConfig_PreUpdateBackupDetail.fromPartial(base ?? {});- },- fromPartial(- object: DeepPartial<Plan_ChangeDatabaseConfig_PreUpdateBackupDetail>,- ): Plan_ChangeDatabaseConfig_PreUpdateBackupDetail {- const message = createBasePlan_ChangeDatabaseConfig_PreUpdateBackupDetail();- message.database = object.database ?? "";- return message;- },-};-function createBasePlan_ExportDataConfig(): Plan_ExportDataConfig {return { targets: [], sheet: "", format: ExportFormat.FORMAT_UNSPECIFIED, password: undefined };}diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yamlindex b153f51f16..14c1312f1e 100644--- a/proto/gen/grpc-doc/openapi.yaml+++ b/proto/gen/grpc-doc/openapi.yaml@@ -8589,14 +8589,6 @@ components:items:$ref: '#/components/schemas/Content_Part'description: parts is used for a result content with multiple parts.- ChangeDatabaseConfig_PreUpdateBackupDetail:- type: object- properties:- database:- type: string- description: |-- The database for keeping the backup data.- Format: instances/{instance}/databases/{database}ChangedResourceDatabase:type: objectproperties:@@ -11387,9 +11379,8 @@ components:type: objectadditionalProperties:type: string- preUpdateBackupDetail:- allOf:- - $ref: '#/components/schemas/ChangeDatabaseConfig_PreUpdateBackupDetail'+ enablePriorBackup:+ type: booleandescription: If set, a backup of the modified data will be created automatically before any changes are applied.Plan_CreateDatabaseConfig:required:diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex 2f46cbcd24..1ae2edfb27 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -167,18 +167,6 @@- [IssueCommentPayload.IssueUpdate.IssueStatus](#bytebase-store-IssueCommentPayload-IssueUpdate-IssueStatus)- [IssueCommentPayload.TaskUpdate.Status](#bytebase-store-IssueCommentPayload-TaskUpdate-Status)-- [store/plan_check_run.proto](#store_plan_check_run-proto)- - [PlanCheckRunConfig](#bytebase-store-PlanCheckRunConfig)- - [PlanCheckRunConfig.GhostFlagsEntry](#bytebase-store-PlanCheckRunConfig-GhostFlagsEntry)- - [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)-- [store/plan.proto](#store_plan-proto)- [PlanConfig](#bytebase-store-PlanConfig)- [PlanConfig.ChangeDatabaseConfig](#bytebase-store-PlanConfig-ChangeDatabaseConfig)@@ -191,6 +179,17 @@- [PlanConfig.ChangeDatabaseConfig.Type](#bytebase-store-PlanConfig-ChangeDatabaseConfig-Type)+- [store/plan_check_run.proto](#store_plan_check_run-proto)+ - [PlanCheckRunConfig](#bytebase-store-PlanCheckRunConfig)+ - [PlanCheckRunConfig.GhostFlagsEntry](#bytebase-store-PlanCheckRunConfig-GhostFlagsEntry)+ - [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)++ - [PlanCheckRunConfig.ChangeDatabaseType](#bytebase-store-PlanCheckRunConfig-ChangeDatabaseType)+ - [PlanCheckRunResult.Result.Status](#bytebase-store-PlanCheckRunResult-Result-Status)+- [store/policy.proto](#store_policy-proto)- [Binding](#bytebase-store-Binding)- [DataSourceQueryPolicy](#bytebase-store-DataSourceQueryPolicy)@@ -2817,165 +2816,169 @@ InstanceRole is the API message for instance role.-<a name="store_plan_check_run-proto"></a>+<a name="store_plan-proto"></a><p align="right"><a href="#top">Top</a></p>-## store/plan_check_run.proto+## store/plan.proto-<a name="bytebase-store-PlanCheckRunConfig"></a>+<a name="bytebase-store-PlanConfig"></a>-### PlanCheckRunConfig+### PlanConfig| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| sheet_uid | [int32](#int32) | | |-| change_database_type | [PlanCheckRunConfig.ChangeDatabaseType](#bytebase-store-PlanCheckRunConfig-ChangeDatabaseType) | | |-| instance_id | [string](#string) | | |-| database_name | [string](#string) | | |-| database_group_uid | [int64](#int64) | optional | **Deprecated.** |-| ghost_flags | [PlanCheckRunConfig.GhostFlagsEntry](#bytebase-store-PlanCheckRunConfig-GhostFlagsEntry) | repeated | |-| 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. |+| specs | [PlanConfig.Spec](#bytebase-store-PlanConfig-Spec) | repeated | |+| deployment | [PlanConfig.Deployment](#bytebase-store-PlanConfig-Deployment) | | |-<a name="bytebase-store-PlanCheckRunConfig-GhostFlagsEntry"></a>+<a name="bytebase-store-PlanConfig-ChangeDatabaseConfig"></a>-### PlanCheckRunConfig.GhostFlagsEntry+### PlanConfig.ChangeDatabaseConfig| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| key | [string](#string) | | |-| value | [string](#string) | | |+| targets | [string](#string) | repeated | The list of targets. Multi-database format: [instances/{instance-id}/databases/{database-name}]. Single database group format: [projects/{project}/databaseGroups/{databaseGroup}]. |+| sheet | [string](#string) | | The resource name of the sheet. Format: projects/{project}/sheets/{sheet} |+| release | [string](#string) | | The resource name of the release. Format: projects/{project}/releases/{release} |+| type | [PlanConfig.ChangeDatabaseConfig.Type](#bytebase-store-PlanConfig-ChangeDatabaseConfig-Type) | | |+| ghost_flags | [PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry](#bytebase-store-PlanConfig-ChangeDatabaseConfig-GhostFlagsEntry) | repeated | |+| enable_prior_backup | [bool](#bool) | | If set, a backup of the modified data will be created automatically before any changes are applied. |-<a name="bytebase-store-PlanCheckRunResult"></a>+<a name="bytebase-store-PlanConfig-ChangeDatabaseConfig-GhostFlagsEntry"></a>-### PlanCheckRunResult+### PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| results | [PlanCheckRunResult.Result](#bytebase-store-PlanCheckRunResult-Result) | repeated | |-| error | [string](#string) | | |+| key | [string](#string) | | |+| value | [string](#string) | | |-<a name="bytebase-store-PlanCheckRunResult-Result"></a>+<a name="bytebase-store-PlanConfig-CreateDatabaseConfig"></a>-### PlanCheckRunResult.Result+### PlanConfig.CreateDatabaseConfig| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| status | [PlanCheckRunResult.Result.Status](#bytebase-store-PlanCheckRunResult-Result-Status) | | |-| title | [string](#string) | | |-| content | [string](#string) | | |-| code | [int32](#int32) | | |-| sql_summary_report | [PlanCheckRunResult.Result.SqlSummaryReport](#bytebase-store-PlanCheckRunResult-Result-SqlSummaryReport) | | |-| sql_review_report | [PlanCheckRunResult.Result.SqlReviewReport](#bytebase-store-PlanCheckRunResult-Result-SqlReviewReport) | | |+| target | [string](#string) | | The resource name of the instance on which the database is created. Format: instances/{instance} |+| database | [string](#string) | | The name of the database to create. |+| table | [string](#string) | | table is the name of the table, if it is not empty, Bytebase should create a table after creating the database. For example, in MongoDB, it only creates the database when we first store data in that database. |+| character_set | [string](#string) | | character_set is the character set of the database. |+| collation | [string](#string) | | collation is the collation of the database. |+| cluster | [string](#string) | | cluster is the cluster of the database. This is only applicable to ClickHouse for "ON CLUSTER <<cluster>>". |+| owner | [string](#string) | | owner is the owner of the database. This is only applicable to Postgres for "WITH OWNER <<owner>>". |+| environment | [string](#string) | | The environment resource. Format: environments/prod where prod is the environment resource ID. |-<a name="bytebase-store-PlanCheckRunResult-Result-SqlReviewReport"></a>+<a name="bytebase-store-PlanConfig-Deployment"></a>-### PlanCheckRunResult.Result.SqlReviewReport+### PlanConfig.Deployment| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| line | [int32](#int32) | | |-| column | [int32](#int32) | | |-| start_position | [Position](#bytebase-store-Position) | | 1-based Position of the SQL statement. To supersede `line` and `column` above. |-| end_position | [Position](#bytebase-store-Position) | | |+| environments | [string](#string) | repeated | The environments deploy order. |+| database_group_mappings | [PlanConfig.Deployment.DatabaseGroupMapping](#bytebase-store-PlanConfig-Deployment-DatabaseGroupMapping) | repeated | The database group mapping. |-<a name="bytebase-store-PlanCheckRunResult-Result-SqlSummaryReport"></a>+<a name="bytebase-store-PlanConfig-Deployment-DatabaseGroupMapping"></a>-### PlanCheckRunResult.Result.SqlSummaryReport+### PlanConfig.Deployment.DatabaseGroupMapping| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| statement_types | [string](#string) | repeated | statement_types are the types of statements that are found in the sql. |-| affected_rows | [int32](#int32) | | |-| changed_resources | [ChangedResources](#bytebase-store-ChangedResources) | | |+| database_group | [string](#string) | | Format: projects/{project}/databaseGroups/{databaseGroup}. |+| databases | [string](#string) | repeated | Format: instances/{instance-id}/databases/{database-name}. |-<a name="bytebase-store-PreUpdateBackupDetail"></a>+<a name="bytebase-store-PlanConfig-ExportDataConfig"></a>-### PreUpdateBackupDetail+### PlanConfig.ExportDataConfig| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| database | [string](#string) | | The database for keeping the backup data. Format: instances/{instance}/databases/{database} |+| targets | [string](#string) | repeated | The list of targets. Multi-database format: [instances/{instance-id}/databases/{database-name}]. Single database group format: [projects/{project}/databaseGroups/{databaseGroup}]. |+| sheet | [string](#string) | | The resource name of the sheet. Format: projects/{project}/sheets/{sheet} |+| format | [ExportFormat](#bytebase-store-ExportFormat) | | The format of the exported file. |+| password | [string](#string) | optional | The zip password provide by users. Leave it empty if no needs to encrypt the zip file. |-+<a name="bytebase-store-PlanConfig-Spec"></a>-<a name="bytebase-store-PlanCheckRunConfig-ChangeDatabaseType"></a>+### PlanConfig.Spec-### PlanCheckRunConfig.ChangeDatabaseType-| Name | Number | Description |-| ---- | ------ | ----------- |-| CHANGE_DATABASE_TYPE_UNSPECIFIED | 0 | |-| DDL | 1 | |-| DML | 2 | |-| SDL | 3 | |-| DDL_GHOST | 4 | |-| SQL_EDITOR | 5 | |+| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| id | [string](#string) | | A UUID4 string that uniquely identifies the Spec. |+| create_database_config | [PlanConfig.CreateDatabaseConfig](#bytebase-store-PlanConfig-CreateDatabaseConfig) | | |+| change_database_config | [PlanConfig.ChangeDatabaseConfig](#bytebase-store-PlanConfig-ChangeDatabaseConfig) | | |+| export_data_config | [PlanConfig.ExportDataConfig](#bytebase-store-PlanConfig-ExportDataConfig) | | |-<a name="bytebase-store-PlanCheckRunResult-Result-Status"></a>-### PlanCheckRunResult.Result.Status++++<a name="bytebase-store-PlanConfig-ChangeDatabaseConfig-Type"></a>++### PlanConfig.ChangeDatabaseConfig.Type+Type is the database change type.| Name | Number | Description || ---- | ------ | ----------- |-| STATUS_UNSPECIFIED | 0 | |-| ERROR | 1 | |-| WARNING | 2 | |-| SUCCESS | 3 | |+| TYPE_UNSPECIFIED | 0 | |+| MIGRATE | 2 | Used for DDL changes including CREATE DATABASE. |+| MIGRATE_SDL | 3 | Used for schema changes via state-based schema migration including CREATE DATABASE. |+| MIGRATE_GHOST | 4 | Used for DDL changes using gh-ost. |+| DATA | 6 | Used for DML change. |@@ -2986,52 +2989,37 @@ InstanceRole is the API message for instance role.-<a name="store_plan-proto"></a>+<a name="store_plan_check_run-proto"></a><p align="right"><a href="#top">Top</a></p>-## store/plan.proto----<a name="bytebase-store-PlanConfig"></a>--### PlanConfig----| Field | Type | Label | Description |-| ----- | ---- | ----- | ----------- |-| specs | [PlanConfig.Spec](#bytebase-store-PlanConfig-Spec) | repeated | |-| deployment | [PlanConfig.Deployment](#bytebase-store-PlanConfig-Deployment) | | |---+## store/plan_check_run.proto-<a name="bytebase-store-PlanConfig-ChangeDatabaseConfig"></a>+<a name="bytebase-store-PlanCheckRunConfig"></a>-### PlanConfig.ChangeDatabaseConfig+### PlanCheckRunConfig| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| targets | [string](#string) | repeated | The list of targets. Multi-database format: [instances/{instance-id}/databases/{database-name}]. Single database group format: [projects/{project}/databaseGroups/{databaseGroup}]. |-| sheet | [string](#string) | | The resource name of the sheet. Format: projects/{project}/sheets/{sheet} |-| release | [string](#string) | | The resource name of the release. Format: projects/{project}/releases/{release} |-| type | [PlanConfig.ChangeDatabaseConfig.Type](#bytebase-store-PlanConfig-ChangeDatabaseConfig-Type) | | |-| ghost_flags | [PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry](#bytebase-store-PlanConfig-ChangeDatabaseConfig-GhostFlagsEntry) | repeated | |-| 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. |+| sheet_uid | [int32](#int32) | | |+| change_database_type | [PlanCheckRunConfig.ChangeDatabaseType](#bytebase-store-PlanCheckRunConfig-ChangeDatabaseType) | | |+| instance_id | [string](#string) | | |+| database_name | [string](#string) | | |+| database_group_uid | [int64](#int64) | optional | **Deprecated.** |+| ghost_flags | [PlanCheckRunConfig.GhostFlagsEntry](#bytebase-store-PlanCheckRunConfig-GhostFlagsEntry) | repeated | |+| enable_prior_backup | [bool](#bool) | | If set, a backup of the modified data will be created automatically before any changes are applied. |-<a name="bytebase-store-PlanConfig-ChangeDatabaseConfig-GhostFlagsEntry"></a>+<a name="bytebase-store-PlanCheckRunConfig-GhostFlagsEntry"></a>-### PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry+### PlanCheckRunConfig.GhostFlagsEntry@@ -3045,110 +3033,106 @@ InstanceRole is the API message for instance role.-<a name="bytebase-store-PlanConfig-CreateDatabaseConfig"></a>+<a name="bytebase-store-PlanCheckRunResult"></a>-### PlanConfig.CreateDatabaseConfig+### PlanCheckRunResult| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| target | [string](#string) | | The resource name of the instance on which the database is created. Format: instances/{instance} |-| database | [string](#string) | | The name of the database to create. |-| table | [string](#string) | | table is the name of the table, if it is not empty, Bytebase should create a table after creating the database. For example, in MongoDB, it only creates the database when we first store data in that database. |-| character_set | [string](#string) | | character_set is the character set of the database. |-| collation | [string](#string) | | collation is the collation of the database. |-| cluster | [string](#string) | | cluster is the cluster of the database. This is only applicable to ClickHouse for "ON CLUSTER <<cluster>>". |-| owner | [string](#string) | | owner is the owner of the database. This is only applicable to Postgres for "WITH OWNER <<owner>>". |-| environment | [string](#string) | | The environment resource. Format: environments/prod where prod is the environment resource ID. |+| results | [PlanCheckRunResult.Result](#bytebase-store-PlanCheckRunResult-Result) | repeated | |+| error | [string](#string) | | |-<a name="bytebase-store-PlanConfig-Deployment"></a>+<a name="bytebase-store-PlanCheckRunResult-Result"></a>-### PlanConfig.Deployment+### PlanCheckRunResult.Result| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| environments | [string](#string) | repeated | The environments deploy order. |-| database_group_mappings | [PlanConfig.Deployment.DatabaseGroupMapping](#bytebase-store-PlanConfig-Deployment-DatabaseGroupMapping) | repeated | The database group mapping. |+| status | [PlanCheckRunResult.Result.Status](#bytebase-store-PlanCheckRunResult-Result-Status) | | |+| title | [string](#string) | | |+| content | [string](#string) | | |+| code | [int32](#int32) | | |+| sql_summary_report | [PlanCheckRunResult.Result.SqlSummaryReport](#bytebase-store-PlanCheckRunResult-Result-SqlSummaryReport) | | |+| sql_review_report | [PlanCheckRunResult.Result.SqlReviewReport](#bytebase-store-PlanCheckRunResult-Result-SqlReviewReport) | | |-<a name="bytebase-store-PlanConfig-Deployment-DatabaseGroupMapping"></a>+<a name="bytebase-store-PlanCheckRunResult-Result-SqlReviewReport"></a>-### PlanConfig.Deployment.DatabaseGroupMapping+### PlanCheckRunResult.Result.SqlReviewReport| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| database_group | [string](#string) | | Format: projects/{project}/databaseGroups/{databaseGroup}. |-| databases | [string](#string) | repeated | Format: instances/{instance-id}/databases/{database-name}. |+| line | [int32](#int32) | | |+| column | [int32](#int32) | | |+| start_position | [Position](#bytebase-store-Position) | | 1-based Position of the SQL statement. To supersede `line` and `column` above. |+| end_position | [Position](#bytebase-store-Position) | | |-<a name="bytebase-store-PlanConfig-ExportDataConfig"></a>+<a name="bytebase-store-PlanCheckRunResult-Result-SqlSummaryReport"></a>-### PlanConfig.ExportDataConfig+### PlanCheckRunResult.Result.SqlSummaryReport| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| targets | [string](#string) | repeated | The list of targets. Multi-database format: [instances/{instance-id}/databases/{database-name}]. Single database group format: [projects/{project}/databaseGroups/{databaseGroup}]. |-| sheet | [string](#string) | | The resource name of the sheet. Format: projects/{project}/sheets/{sheet} |-| format | [ExportFormat](#bytebase-store-ExportFormat) | | The format of the exported file. |-| password | [string](#string) | optional | The zip password provide by users. Leave it empty if no needs to encrypt the zip file. |---+| statement_types | [string](#string) | repeated | statement_types are the types of statements that are found in the sql. |+| affected_rows | [int32](#int32) | | |+| changed_resources | [ChangedResources](#bytebase-store-ChangedResources) | | |-<a name="bytebase-store-PlanConfig-Spec"></a>-### PlanConfig.Spec+-| Field | Type | Label | Description |-| ----- | ---- | ----- | ----------- |-| id | [string](#string) | | A UUID4 string that uniquely identifies the Spec. |-| create_database_config | [PlanConfig.CreateDatabaseConfig](#bytebase-store-PlanConfig-CreateDatabaseConfig) | | |-| change_database_config | [PlanConfig.ChangeDatabaseConfig](#bytebase-store-PlanConfig-ChangeDatabaseConfig) | | |-| export_data_config | [PlanConfig.ExportDataConfig](#bytebase-store-PlanConfig-ExportDataConfig) | | |+<a name="bytebase-store-PlanCheckRunConfig-ChangeDatabaseType"></a>+### PlanCheckRunConfig.ChangeDatabaseType+| Name | Number | Description |+| ---- | ------ | ----------- |+| CHANGE_DATABASE_TYPE_UNSPECIFIED | 0 | |+| DDL | 1 | |+| DML | 2 | |+| SDL | 3 | |+| DDL_GHOST | 4 | |+| SQL_EDITOR | 5 | |-+<a name="bytebase-store-PlanCheckRunResult-Result-Status"></a>-<a name="bytebase-store-PlanConfig-ChangeDatabaseConfig-Type"></a>+### PlanCheckRunResult.Result.Status-### PlanConfig.ChangeDatabaseConfig.Type-Type is the database change type.| Name | Number | Description || ---- | ------ | ----------- |-| TYPE_UNSPECIFIED | 0 | |-| MIGRATE | 2 | Used for DDL changes including CREATE DATABASE. |-| MIGRATE_SDL | 3 | Used for schema changes via state-based schema migration including CREATE DATABASE. |-| MIGRATE_GHOST | 4 | Used for DDL changes using gh-ost. |-| DATA | 6 | Used for DML change. |+| STATUS_UNSPECIFIED | 0 | |+| ERROR | 1 | |+| WARNING | 2 | |+| SUCCESS | 3 | |@@ -4617,7 +4601,7 @@ We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS.| character_set | [string](#string) | | || collation | [string](#string) | | || schema_version | [string](#string) | | Update database fields. |-| pre_update_backup_detail | [PreUpdateBackupDetail](#bytebase-store-PreUpdateBackupDetail) | | |+| enable_prior_backup | [bool](#bool) | | || flags | [TaskPayload.FlagsEntry](#bytebase-store-TaskPayload-FlagsEntry) | repeated | ghost flags. || task_release_source | [TaskReleaseSource](#bytebase-store-TaskReleaseSource) | | || password | [string](#string) | | Export data fields. |diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.htmlindex 7dc28fe538..be9ba806ba 100644--- a/proto/gen/grpc-doc/store/index.html+++ b/proto/gen/grpc-doc/store/index.html@@ -839,44 +839,44 @@<li>- <a href="#store%2fplan_check_run.proto">store/plan_check_run.proto</a>+ <a href="#store%2fplan.proto">store/plan.proto</a><ul><li>- <a href="#bytebase.store.PlanCheckRunConfig"><span class="badge">M</span>PlanCheckRunConfig</a>+ <a href="#bytebase.store.PlanConfig"><span class="badge">M</span>PlanConfig</a></li><li>- <a href="#bytebase.store.PlanCheckRunConfig.GhostFlagsEntry"><span class="badge">M</span>PlanCheckRunConfig.GhostFlagsEntry</a>+ <a href="#bytebase.store.PlanConfig.ChangeDatabaseConfig"><span class="badge">M</span>PlanConfig.ChangeDatabaseConfig</a></li><li>- <a href="#bytebase.store.PlanCheckRunResult"><span class="badge">M</span>PlanCheckRunResult</a>+ <a href="#bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry"><span class="badge">M</span>PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry</a></li><li>- <a href="#bytebase.store.PlanCheckRunResult.Result"><span class="badge">M</span>PlanCheckRunResult.Result</a>+ <a href="#bytebase.store.PlanConfig.CreateDatabaseConfig"><span class="badge">M</span>PlanConfig.CreateDatabaseConfig</a></li><li>- <a href="#bytebase.store.PlanCheckRunResult.Result.SqlReviewReport"><span class="badge">M</span>PlanCheckRunResult.Result.SqlReviewReport</a>+ <a href="#bytebase.store.PlanConfig.Deployment"><span class="badge">M</span>PlanConfig.Deployment</a></li><li>- <a href="#bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport"><span class="badge">M</span>PlanCheckRunResult.Result.SqlSummaryReport</a>+ <a href="#bytebase.store.PlanConfig.Deployment.DatabaseGroupMapping"><span class="badge">M</span>PlanConfig.Deployment.DatabaseGroupMapping</a></li><li>- <a href="#bytebase.store.PreUpdateBackupDetail"><span class="badge">M</span>PreUpdateBackupDetail</a>+ <a href="#bytebase.store.PlanConfig.ExportDataConfig"><span class="badge">M</span>PlanConfig.ExportDataConfig</a></li>-<li>- <a href="#bytebase.store.PlanCheckRunConfig.ChangeDatabaseType"><span class="badge">E</span>PlanCheckRunConfig.ChangeDatabaseType</a>+ <a href="#bytebase.store.PlanConfig.Spec"><span class="badge">M</span>PlanConfig.Spec</a></li>+<li>- <a href="#bytebase.store.PlanCheckRunResult.Result.Status"><span class="badge">E</span>PlanCheckRunResult.Result.Status</a>+ <a href="#bytebase.store.PlanConfig.ChangeDatabaseConfig.Type"><span class="badge">E</span>PlanConfig.ChangeDatabaseConfig.Type</a></li>@@ -886,44 +886,40 @@<li>- <a href="#store%2fplan.proto">store/plan.proto</a>+ <a href="#store%2fplan_check_run.proto">store/plan_check_run.proto</a><ul><li>- <a href="#bytebase.store.PlanConfig"><span class="badge">M</span>PlanConfig</a>+ <a href="#bytebase.store.PlanCheckRunConfig"><span class="badge">M</span>PlanCheckRunConfig</a></li><li>- <a href="#bytebase.store.PlanConfig.ChangeDatabaseConfig"><span class="badge">M</span>PlanConfig.ChangeDatabaseConfig</a>+ <a href="#bytebase.store.PlanCheckRunConfig.GhostFlagsEntry"><span class="badge">M</span>PlanCheckRunConfig.GhostFlagsEntry</a></li><li>- <a href="#bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry"><span class="badge">M</span>PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry</a>+ <a href="#bytebase.store.PlanCheckRunResult"><span class="badge">M</span>PlanCheckRunResult</a></li><li>- <a href="#bytebase.store.PlanConfig.CreateDatabaseConfig"><span class="badge">M</span>PlanConfig.CreateDatabaseConfig</a>+ <a href="#bytebase.store.PlanCheckRunResult.Result"><span class="badge">M</span>PlanCheckRunResult.Result</a></li><li>- <a href="#bytebase.store.PlanConfig.Deployment"><span class="badge">M</span>PlanConfig.Deployment</a>+ <a href="#bytebase.store.PlanCheckRunResult.Result.SqlReviewReport"><span class="badge">M</span>PlanCheckRunResult.Result.SqlReviewReport</a></li><li>- <a href="#bytebase.store.PlanConfig.Deployment.DatabaseGroupMapping"><span class="badge">M</span>PlanConfig.Deployment.DatabaseGroupMapping</a>+ <a href="#bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport"><span class="badge">M</span>PlanCheckRunResult.Result.SqlSummaryReport</a></li>- <li>- <a href="#bytebase.store.PlanConfig.ExportDataConfig"><span class="badge">M</span>PlanConfig.ExportDataConfig</a>- </li><li>- <a href="#bytebase.store.PlanConfig.Spec"><span class="badge">M</span>PlanConfig.Spec</a>+ <a href="#bytebase.store.PlanCheckRunConfig.ChangeDatabaseType"><span class="badge">E</span>PlanCheckRunConfig.ChangeDatabaseType</a></li>-<li>- <a href="#bytebase.store.PlanConfig.ChangeDatabaseConfig.Type"><span class="badge">E</span>PlanConfig.ChangeDatabaseConfig.Type</a>+ <a href="#bytebase.store.PlanCheckRunResult.Result.Status"><span class="badge">E</span>PlanCheckRunResult.Result.Status</a></li>@@ -7956,12 +7952,12 @@ Format: users/{userUID}. </p></td><div class="file-heading">- <h2 id="store/plan_check_run.proto">store/plan_check_run.proto</h2><a href="#title">Top</a>+ <h2 id="store/plan.proto">store/plan.proto</h2><a href="#title">Top</a></div><p></p>- <h3 id="bytebase.store.PlanCheckRunConfig">PlanCheckRunConfig</h3>+ <h3 id="bytebase.store.PlanConfig">PlanConfig</h3><p></p>@@ -7972,51 +7968,79 @@ Format: users/{userUID}. </p></td><tbody><tr>- <td>sheet_uid</td>- <td><a href="#int32">int32</a></td>- <td></td>+ <td>specs</td>+ <td><a href="#bytebase.store.PlanConfig.Spec">PlanConfig.Spec</a></td>+ <td>repeated</td><td><p> </p></td></tr><tr>- <td>change_database_type</td>- <td><a href="#bytebase.store.PlanCheckRunConfig.ChangeDatabaseType">PlanCheckRunConfig.ChangeDatabaseType</a></td>+ <td>deployment</td>+ <td><a href="#bytebase.store.PlanConfig.Deployment">PlanConfig.Deployment</a></td><td></td><td><p> </p></td></tr>+ </tbody>+ </table>++++++ <h3 id="bytebase.store.PlanConfig.ChangeDatabaseConfig">PlanConfig.ChangeDatabaseConfig</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>targets</td>+ <td><a href="#string">string</a></td>+ <td>repeated</td>+ <td><p>The list of targets.+Multi-database format: [instances/{instance-id}/databases/{database-name}].+Single database group format: [projects/{project}/databaseGroups/{databaseGroup}]. </p></td>+ </tr>+<tr>- <td>instance_id</td>+ <td>sheet</td><td><a href="#string">string</a></td><td></td>- <td><p> </p></td>+ <td><p>The resource name of the sheet.+Format: projects/{project}/sheets/{sheet} </p></td></tr><tr>- <td>database_name</td>+ <td>release</td><td><a href="#string">string</a></td><td></td>- <td><p> </p></td>+ <td><p>The resource name of the release.+Format: projects/{project}/releases/{release} </p></td></tr><tr>- <td>database_group_uid</td>- <td><a href="#int64">int64</a></td>- <td>optional</td>- <td><p><strong>Deprecated.</strong> </p></td>+ <td>type</td>+ <td><a href="#bytebase.store.PlanConfig.ChangeDatabaseConfig.Type">PlanConfig.ChangeDatabaseConfig.Type</a></td>+ <td></td>+ <td><p> </p></td></tr><tr><td>ghost_flags</td>- <td><a href="#bytebase.store.PlanCheckRunConfig.GhostFlagsEntry">PlanCheckRunConfig.GhostFlagsEntry</a></td>+ <td><a href="#bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry">PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry</a></td><td>repeated</td><td><p> </p></td></tr><tr>- <td>pre_update_backup_detail</td>- <td><a href="#bytebase.store.PreUpdateBackupDetail">PreUpdateBackupDetail</a></td>- <td>optional</td>+ <td>enable_prior_backup</td>+ <td><a href="#bool">bool</a></td>+ <td></td><td><p>If set, a backup of the modified data will be created automatically before any changes are applied. </p></td></tr>@@ -8024,31 +8048,10 @@ Format: users/{userUID}. </p></td></table>--- <h4>Fields with deprecated option</h4>- <table>- <thead>- <tr>- <td>Name</td>- <td>Option</td>- </tr>- </thead>- <tbody>-- <tr>- <td>database_group_uid</td>- <td><p>true</p></td>- </tr>-- </tbody>- </table>--- <h3 id="bytebase.store.PlanCheckRunConfig.GhostFlagsEntry">PlanCheckRunConfig.GhostFlagsEntry</h3>+ <h3 id="bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry">PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry</h3><p></p>@@ -8079,7 +8082,7 @@ Format: users/{userUID}. </p></td>- <h3 id="bytebase.store.PlanCheckRunResult">PlanCheckRunResult</h3>+ <h3 id="bytebase.store.PlanConfig.CreateDatabaseConfig">PlanConfig.CreateDatabaseConfig</h3><p></p>@@ -8090,76 +8093,62 @@ Format: users/{userUID}. </p></td><tbody><tr>- <td>results</td>- <td><a href="#bytebase.store.PlanCheckRunResult.Result">PlanCheckRunResult.Result</a></td>- <td>repeated</td>- <td><p> </p></td>+ <td>target</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p>The resource name of the instance on which the database is created.+Format: instances/{instance} </p></td></tr><tr>- <td>error</td>+ <td>database</td><td><a href="#string">string</a></td><td></td>- <td><p> </p></td>+ <td><p>The name of the database to create. </p></td></tr>- </tbody>- </table>------ <h3 id="bytebase.store.PlanCheckRunResult.Result">PlanCheckRunResult.Result</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>status</td>- <td><a href="#bytebase.store.PlanCheckRunResult.Result.Status">PlanCheckRunResult.Result.Status</a></td>+ <td>table</td>+ <td><a href="#string">string</a></td><td></td>- <td><p> </p></td>+ <td><p>table is the name of the table, if it is not empty, Bytebase should create a table after creating the database.+For example, in MongoDB, it only creates the database when we first store data in that database. </p></td></tr><tr>- <td>title</td>+ <td>character_set</td><td><a href="#string">string</a></td><td></td>- <td><p> </p></td>+ <td><p>character_set is the character set of the database. </p></td></tr><tr>- <td>content</td>+ <td>collation</td><td><a href="#string">string</a></td><td></td>- <td><p> </p></td>+ <td><p>collation is the collation of the database. </p></td></tr><tr>- <td>code</td>- <td><a href="#int32">int32</a></td>+ <td>cluster</td>+ <td><a href="#string">string</a></td><td></td>- <td><p> </p></td>+ <td><p>cluster is the cluster of the database. This is only applicable to ClickHouse for "ON CLUSTER <<cluster>>". </p></td></tr><tr>- <td>sql_summary_report</td>- <td><a href="#bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport">PlanCheckRunResult.Result.SqlSummaryReport</a></td>+ <td>owner</td>+ <td><a href="#string">string</a></td><td></td>- <td><p> </p></td>+ <td><p>owner is the owner of the database. This is only applicable to Postgres for "WITH OWNER <<owner>>". </p></td></tr><tr>- <td>sql_review_report</td>- <td><a href="#bytebase.store.PlanCheckRunResult.Result.SqlReviewReport">PlanCheckRunResult.Result.SqlReviewReport</a></td>+ <td>environment</td>+ <td><a href="#string">string</a></td><td></td>- <td><p> </p></td>+ <td><p>The environment resource.+Format: environments/prod where prod is the environment resource ID. </p></td></tr></tbody>@@ -8169,7 +8158,7 @@ Format: users/{userUID}. </p></td>- <h3 id="bytebase.store.PlanCheckRunResult.Result.SqlReviewReport">PlanCheckRunResult.Result.SqlReviewReport</h3>+ <h3 id="bytebase.store.PlanConfig.Deployment">PlanConfig.Deployment</h3><p></p>@@ -8180,32 +8169,17 @@ Format: users/{userUID}. </p></td><tbody><tr>- <td>line</td>- <td><a href="#int32">int32</a></td>- <td></td>- <td><p> </p></td>- </tr>-- <tr>- <td>column</td>- <td><a href="#int32">int32</a></td>- <td></td>- <td><p> </p></td>- </tr>-- <tr>- <td>start_position</td>- <td><a href="#bytebase.store.Position">Position</a></td>- <td></td>- <td><p>1-based Position of the SQL statement.-To supersede `line` and `column` above. </p></td>+ <td>environments</td>+ <td><a href="#string">string</a></td>+ <td>repeated</td>+ <td><p>The environments deploy order. </p></td></tr><tr>- <td>end_position</td>- <td><a href="#bytebase.store.Position">Position</a></td>- <td></td>- <td><p> </p></td>+ <td>database_group_mappings</td>+ <td><a href="#bytebase.store.PlanConfig.Deployment.DatabaseGroupMapping">PlanConfig.Deployment.DatabaseGroupMapping</a></td>+ <td>repeated</td>+ <td><p>The database group mapping. </p></td></tr></tbody>@@ -8215,7 +8189,7 @@ To supersede `line` and `column` above. </p></td>- <h3 id="bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport">PlanCheckRunResult.Result.SqlSummaryReport</h3>+ <h3 id="bytebase.store.PlanConfig.Deployment.DatabaseGroupMapping">PlanConfig.Deployment.DatabaseGroupMapping</h3><p></p>@@ -8226,24 +8200,17 @@ To supersede `line` and `column` above. </p></td><tbody><tr>- <td>statement_types</td>+ <td>database_group</td><td><a href="#string">string</a></td>- <td>repeated</td>- <td><p>statement_types are the types of statements that are found in the sql. </p></td>- </tr>-- <tr>- <td>affected_rows</td>- <td><a href="#int32">int32</a></td><td></td>- <td><p> </p></td>+ <td><p>Format: projects/{project}/databaseGroups/{databaseGroup}. </p></td></tr><tr>- <td>changed_resources</td>- <td><a href="#bytebase.store.ChangedResources">ChangedResources</a></td>- <td></td>- <td><p> </p></td>+ <td>databases</td>+ <td><a href="#string">string</a></td>+ <td>repeated</td>+ <td><p>Format: instances/{instance-id}/databases/{database-name}. </p></td></tr></tbody>@@ -8253,7 +8220,7 @@ To supersede `line` and `column` above. </p></td>- <h3 id="bytebase.store.PreUpdateBackupDetail">PreUpdateBackupDetail</h3>+ <h3 id="bytebase.store.PlanConfig.ExportDataConfig">PlanConfig.ExportDataConfig</h3><p></p>@@ -8264,13 +8231,37 @@ To supersede `line` and `column` above. </p></td><tbody><tr>- <td>database</td>+ <td>targets</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>-+ <td>repeated</td>+ <td><p>The list of targets.+Multi-database format: [instances/{instance-id}/databases/{database-name}].+Single database group format: [projects/{project}/databaseGroups/{databaseGroup}]. </p></td>+ </tr>++ <tr>+ <td>sheet</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p>The resource name of the sheet.+Format: projects/{project}/sheets/{sheet} </p></td>+ </tr>++ <tr>+ <td>format</td>+ <td><a href="#bytebase.store.ExportFormat">ExportFormat</a></td>+ <td></td>+ <td><p>The format of the exported file. </p></td>+ </tr>++ <tr>+ <td>password</td>+ <td><a href="#string">string</a></td>+ <td>optional</td>+ <td><p>The zip password provide by users.+Leave it empty if no needs to encrypt the zip file. </p></td>+ </tr>+</tbody></table>@@ -8278,10 +8269,55 @@ Format: instances/{instance}/databases/{database} </p></td>+ <h3 id="bytebase.store.PlanConfig.Spec">PlanConfig.Spec</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>id</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p>A UUID4 string that uniquely identifies the Spec. </p></td>+ </tr>++ <tr>+ <td>create_database_config</td>+ <td><a href="#bytebase.store.PlanConfig.CreateDatabaseConfig">PlanConfig.CreateDatabaseConfig</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>change_database_config</td>+ <td><a href="#bytebase.store.PlanConfig.ChangeDatabaseConfig">PlanConfig.ChangeDatabaseConfig</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>export_data_config</td>+ <td><a href="#bytebase.store.PlanConfig.ExportDataConfig">PlanConfig.ExportDataConfig</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ </tbody>+ </table>++++- <h3 id="bytebase.store.PlanCheckRunConfig.ChangeDatabaseType">PlanCheckRunConfig.ChangeDatabaseType</h3>- <p></p>+++ <h3 id="bytebase.store.PlanConfig.ChangeDatabaseConfig.Type">PlanConfig.ChangeDatabaseConfig.Type</h3>+ <p>Type is the database change type.</p><table class="enum-table"><thead><tr><td>Name</td><td>Number</td><td>Description</td></tr>@@ -8289,74 +8325,33 @@ Format: instances/{instance}/databases/{database} </p></td><tbody><tr>- <td>CHANGE_DATABASE_TYPE_UNSPECIFIED</td>+ <td>TYPE_UNSPECIFIED</td><td>0</td><td><p></p></td></tr><tr>- <td>DDL</td>- <td>1</td>- <td><p></p></td>- </tr>-- <tr>- <td>DML</td>+ <td>MIGRATE</td><td>2</td>- <td><p></p></td>+ <td><p>Used for DDL changes including CREATE DATABASE.</p></td></tr><tr>- <td>SDL</td>+ <td>MIGRATE_SDL</td><td>3</td>- <td><p></p></td>+ <td><p>Used for schema changes via state-based schema migration including CREATE DATABASE.</p></td></tr><tr>- <td>DDL_GHOST</td>+ <td>MIGRATE_GHOST</td><td>4</td>- <td><p></p></td>- </tr>-- <tr>- <td>SQL_EDITOR</td>- <td>5</td>- <td><p></p></td>- </tr>-- </tbody>- </table>-- <h3 id="bytebase.store.PlanCheckRunResult.Result.Status">PlanCheckRunResult.Result.Status</h3>- <p></p>- <table class="enum-table">- <thead>- <tr><td>Name</td><td>Number</td><td>Description</td></tr>- </thead>- <tbody>-- <tr>- <td>STATUS_UNSPECIFIED</td>- <td>0</td>- <td><p></p></td>- </tr>-- <tr>- <td>ERROR</td>- <td>1</td>- <td><p></p></td>- </tr>-- <tr>- <td>WARNING</td>- <td>2</td>- <td><p></p></td>+ <td><p>Used for DDL changes using gh-ost.</p></td></tr><tr>- <td>SUCCESS</td>- <td>3</td>- <td><p></p></td>+ <td>DATA</td>+ <td>6</td>+ <td><p>Used for DML change.</p></td></tr></tbody>@@ -8369,12 +8364,12 @@ Format: instances/{instance}/databases/{database} </p></td><div class="file-heading">- <h2 id="store/plan.proto">store/plan.proto</h2><a href="#title">Top</a>+ <h2 id="store/plan_check_run.proto">store/plan_check_run.proto</h2><a href="#title">Top</a></div><p></p>- <h3 id="bytebase.store.PlanConfig">PlanConfig</h3>+ <h3 id="bytebase.store.PlanCheckRunConfig">PlanCheckRunConfig</h3><p></p>@@ -8385,79 +8380,51 @@ Format: instances/{instance}/databases/{database} </p></td><tbody><tr>- <td>specs</td>- <td><a href="#bytebase.store.PlanConfig.Spec">PlanConfig.Spec</a></td>- <td>repeated</td>+ <td>sheet_uid</td>+ <td><a href="#int32">int32</a></td>+ <td></td><td><p> </p></td></tr><tr>- <td>deployment</td>- <td><a href="#bytebase.store.PlanConfig.Deployment">PlanConfig.Deployment</a></td>+ <td>change_database_type</td>+ <td><a href="#bytebase.store.PlanCheckRunConfig.ChangeDatabaseType">PlanCheckRunConfig.ChangeDatabaseType</a></td><td></td><td><p> </p></td></tr>- </tbody>- </table>------ <h3 id="bytebase.store.PlanConfig.ChangeDatabaseConfig">PlanConfig.ChangeDatabaseConfig</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>targets</td>- <td><a href="#string">string</a></td>- <td>repeated</td>- <td><p>The list of targets.-Multi-database format: [instances/{instance-id}/databases/{database-name}].-Single database group format: [projects/{project}/databaseGroups/{databaseGroup}]. </p></td>- </tr>-- <tr>- <td>sheet</td>+ <td>instance_id</td><td><a href="#string">string</a></td><td></td>- <td><p>The resource name of the sheet.-Format: projects/{project}/sheets/{sheet} </p></td>+ <td><p> </p></td></tr><tr>- <td>release</td>+ <td>database_name</td><td><a href="#string">string</a></td><td></td>- <td><p>The resource name of the release.-Format: projects/{project}/releases/{release} </p></td>+ <td><p> </p></td></tr><tr>- <td>type</td>- <td><a href="#bytebase.store.PlanConfig.ChangeDatabaseConfig.Type">PlanConfig.ChangeDatabaseConfig.Type</a></td>- <td></td>- <td><p> </p></td>+ <td>database_group_uid</td>+ <td><a href="#int64">int64</a></td>+ <td>optional</td>+ <td><p><strong>Deprecated.</strong> </p></td></tr><tr><td>ghost_flags</td>- <td><a href="#bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry">PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry</a></td>+ <td><a href="#bytebase.store.PlanCheckRunConfig.GhostFlagsEntry">PlanCheckRunConfig.GhostFlagsEntry</a></td><td>repeated</td><td><p> </p></td></tr><tr>- <td>pre_update_backup_detail</td>- <td><a href="#bytebase.store.PreUpdateBackupDetail">PreUpdateBackupDetail</a></td>- <td>optional</td>+ <td>enable_prior_backup</td>+ <td><a href="#bool">bool</a></td>+ <td></td><td><p>If set, a backup of the modified data will be created automatically before any changes are applied. </p></td></tr>@@ -8465,10 +8432,31 @@ Format: projects/{project}/releases/{release} </p></td></table>+++ <h4>Fields with deprecated option</h4>+ <table>+ <thead>+ <tr>+ <td>Name</td>+ <td>Option</td>+ </tr>+ </thead>+ <tbody>++ <tr>+ <td>database_group_uid</td>+ <td><p>true</p></td>+ </tr>++ </tbody>+ </table>++- <h3 id="bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry">PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry</h3>+ <h3 id="bytebase.store.PlanCheckRunConfig.GhostFlagsEntry">PlanCheckRunConfig.GhostFlagsEntry</h3><p></p>@@ -8499,7 +8487,7 @@ Format: projects/{project}/releases/{release} </p></td>- <h3 id="bytebase.store.PlanConfig.CreateDatabaseConfig">PlanConfig.CreateDatabaseConfig</h3>+ <h3 id="bytebase.store.PlanCheckRunResult">PlanCheckRunResult</h3><p></p>@@ -8510,62 +8498,17 @@ Format: projects/{project}/releases/{release} </p></td><tbody><tr>- <td>target</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p>The resource name of the instance on which the database is created.-Format: instances/{instance} </p></td>- </tr>-- <tr>- <td>database</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p>The name of the database to create. </p></td>- </tr>-- <tr>- <td>table</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p>table is the name of the table, if it is not empty, Bytebase should create a table after creating the database.-For example, in MongoDB, it only creates the database when we first store data in that database. </p></td>- </tr>-- <tr>- <td>character_set</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p>character_set is the character set of the database. </p></td>- </tr>-- <tr>- <td>collation</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p>collation is the collation of the database. </p></td>- </tr>-- <tr>- <td>cluster</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p>cluster is the cluster of the database. This is only applicable to ClickHouse for "ON CLUSTER <<cluster>>". </p></td>- </tr>-- <tr>- <td>owner</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p>owner is the owner of the database. This is only applicable to Postgres for "WITH OWNER <<owner>>". </p></td>+ <td>results</td>+ <td><a href="#bytebase.store.PlanCheckRunResult.Result">PlanCheckRunResult.Result</a></td>+ <td>repeated</td>+ <td><p> </p></td></tr><tr>- <td>environment</td>+ <td>error</td><td><a href="#string">string</a></td><td></td>- <td><p>The environment resource.-Format: environments/prod where prod is the environment resource ID. </p></td>+ <td><p> </p></td></tr></tbody>@@ -8575,7 +8518,7 @@ Format: environments/prod where prod is the environment resource ID. </p></td>- <h3 id="bytebase.store.PlanConfig.Deployment">PlanConfig.Deployment</h3>+ <h3 id="bytebase.store.PlanCheckRunResult.Result">PlanCheckRunResult.Result</h3><p></p>@@ -8586,48 +8529,45 @@ Format: environments/prod where prod is the environment resource ID. </p></td><tbody><tr>- <td>environments</td>+ <td>status</td>+ <td><a href="#bytebase.store.PlanCheckRunResult.Result.Status">PlanCheckRunResult.Result.Status</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>title</td><td><a href="#string">string</a></td>- <td>repeated</td>- <td><p>The environments deploy order. </p></td>+ <td></td>+ <td><p> </p></td></tr><tr>- <td>database_group_mappings</td>- <td><a href="#bytebase.store.PlanConfig.Deployment.DatabaseGroupMapping">PlanConfig.Deployment.DatabaseGroupMapping</a></td>- <td>repeated</td>- <td><p>The database group mapping. </p></td>+ <td>content</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td></tr>- </tbody>- </table>------ <h3 id="bytebase.store.PlanConfig.Deployment.DatabaseGroupMapping">PlanConfig.Deployment.DatabaseGroupMapping</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>code</td>+ <td><a href="#int32">int32</a></td>+ <td></td>+ <td><p> </p></td>+ </tr><tr>- <td>database_group</td>- <td><a href="#string">string</a></td>+ <td>sql_summary_report</td>+ <td><a href="#bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport">PlanCheckRunResult.Result.SqlSummaryReport</a></td><td></td>- <td><p>Format: projects/{project}/databaseGroups/{databaseGroup}. </p></td>+ <td><p> </p></td></tr><tr>- <td>databases</td>- <td><a href="#string">string</a></td>- <td>repeated</td>- <td><p>Format: instances/{instance-id}/databases/{database-name}. </p></td>+ <td>sql_review_report</td>+ <td><a href="#bytebase.store.PlanCheckRunResult.Result.SqlReviewReport">PlanCheckRunResult.Result.SqlReviewReport</a></td>+ <td></td>+ <td><p> </p></td></tr></tbody>@@ -8637,7 +8577,7 @@ Format: environments/prod where prod is the environment resource ID. </p></td>- <h3 id="bytebase.store.PlanConfig.ExportDataConfig">PlanConfig.ExportDataConfig</h3>+ <h3 id="bytebase.store.PlanCheckRunResult.Result.SqlReviewReport">PlanCheckRunResult.Result.SqlReviewReport</h3><p></p>@@ -8648,35 +8588,32 @@ Format: environments/prod where prod is the environment resource ID. </p></td><tbody><tr>- <td>targets</td>- <td><a href="#string">string</a></td>- <td>repeated</td>- <td><p>The list of targets.-Multi-database format: [instances/{instance-id}/databases/{database-name}].-Single database group format: [projects/{project}/databaseGroups/{databaseGroup}]. </p></td>+ <td>line</td>+ <td><a href="#int32">int32</a></td>+ <td></td>+ <td><p> </p></td></tr><tr>- <td>sheet</td>- <td><a href="#string">string</a></td>+ <td>column</td>+ <td><a href="#int32">int32</a></td><td></td>- <td><p>The resource name of the sheet.-Format: projects/{project}/sheets/{sheet} </p></td>+ <td><p> </p></td></tr><tr>- <td>format</td>- <td><a href="#bytebase.store.ExportFormat">ExportFormat</a></td>+ <td>start_position</td>+ <td><a href="#bytebase.store.Position">Position</a></td><td></td>- <td><p>The format of the exported file. </p></td>+ <td><p>1-based Position of the SQL statement.+To supersede `line` and `column` above. </p></td></tr><tr>- <td>password</td>- <td><a href="#string">string</a></td>- <td>optional</td>- <td><p>The zip password provide by users.-Leave it empty if no needs to encrypt the zip file. </p></td>+ <td>end_position</td>+ <td><a href="#bytebase.store.Position">Position</a></td>+ <td></td>+ <td><p> </p></td></tr></tbody>@@ -8686,7 +8623,7 @@ Leave it empty if no needs to encrypt the zip file. </p></td>- <h3 id="bytebase.store.PlanConfig.Spec">PlanConfig.Spec</h3>+ <h3 id="bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport">PlanCheckRunResult.Result.SqlSummaryReport</h3><p></p>@@ -8697,29 +8634,22 @@ Leave it empty if no needs to encrypt the zip file. </p></td><tbody><tr>- <td>id</td>+ <td>statement_types</td><td><a href="#string">string</a></td>- <td></td>- <td><p>A UUID4 string that uniquely identifies the Spec. </p></td>- </tr>-- <tr>- <td>create_database_config</td>- <td><a href="#bytebase.store.PlanConfig.CreateDatabaseConfig">PlanConfig.CreateDatabaseConfig</a></td>- <td></td>- <td><p> </p></td>+ <td>repeated</td>+ <td><p>statement_types are the types of statements that are found in the sql. </p></td></tr><tr>- <td>change_database_config</td>- <td><a href="#bytebase.store.PlanConfig.ChangeDatabaseConfig">PlanConfig.ChangeDatabaseConfig</a></td>+ <td>affected_rows</td>+ <td><a href="#int32">int32</a></td><td></td><td><p> </p></td></tr><tr>- <td>export_data_config</td>- <td><a href="#bytebase.store.PlanConfig.ExportDataConfig">PlanConfig.ExportDataConfig</a></td>+ <td>changed_resources</td>+ <td><a href="#bytebase.store.ChangedResources">ChangedResources</a></td><td></td><td><p> </p></td></tr>@@ -8733,8 +8663,8 @@ Leave it empty if no needs to encrypt the zip file. </p></td>- <h3 id="bytebase.store.PlanConfig.ChangeDatabaseConfig.Type">PlanConfig.ChangeDatabaseConfig.Type</h3>- <p>Type is the database change type.</p>+ <h3 id="bytebase.store.PlanCheckRunConfig.ChangeDatabaseType">PlanCheckRunConfig.ChangeDatabaseType</h3>+ <p></p><table class="enum-table"><thead><tr><td>Name</td><td>Number</td><td>Description</td></tr>@@ -8742,33 +8672,74 @@ Leave it empty if no needs to encrypt the zip file. </p></td><tbody><tr>- <td>TYPE_UNSPECIFIED</td>+ <td>CHANGE_DATABASE_TYPE_UNSPECIFIED</td><td>0</td><td><p></p></td></tr><tr>- <td>MIGRATE</td>+ <td>DDL</td>+ <td>1</td>+ <td><p></p></td>+ </tr>++ <tr>+ <td>DML</td><td>2</td>- <td><p>Used for DDL changes including CREATE DATABASE.</p></td>+ <td><p></p></td></tr><tr>- <td>MIGRATE_SDL</td>+ <td>SDL</td><td>3</td>- <td><p>Used for schema changes via state-based schema migration including CREATE DATABASE.</p></td>+ <td><p></p></td></tr><tr>- <td>MIGRATE_GHOST</td>+ <td>DDL_GHOST</td><td>4</td>- <td><p>Used for DDL changes using gh-ost.</p></td>+ <td><p></p></td></tr><tr>- <td>DATA</td>- <td>6</td>- <td><p>Used for DML change.</p></td>+ <td>SQL_EDITOR</td>+ <td>5</td>+ <td><p></p></td>+ </tr>++ </tbody>+ </table>++ <h3 id="bytebase.store.PlanCheckRunResult.Result.Status">PlanCheckRunResult.Result.Status</h3>+ <p></p>+ <table class="enum-table">+ <thead>+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>STATUS_UNSPECIFIED</td>+ <td>0</td>+ <td><p></p></td>+ </tr>++ <tr>+ <td>ERROR</td>+ <td>1</td>+ <td><p></p></td>+ </tr>++ <tr>+ <td>WARNING</td>+ <td>2</td>+ <td><p></p></td>+ </tr>++ <tr>+ <td>SUCCESS</td>+ <td>3</td>+ <td><p></p></td></tr></tbody>@@ -11912,8 +11883,8 @@ Default to this mode.</p></td></tr><tr>- <td>pre_update_backup_detail</td>- <td><a href="#bytebase.store.PreUpdateBackupDetail">PreUpdateBackupDetail</a></td>+ <td>enable_prior_backup</td>+ <td><a href="#bool">bool</a></td><td></td><td><p> </p></td></tr>diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex ad1205f537..115207d123 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -446,7 +446,6 @@- [Plan](#bytebase-v1-Plan)- [Plan.ChangeDatabaseConfig](#bytebase-v1-Plan-ChangeDatabaseConfig)- [Plan.ChangeDatabaseConfig.GhostFlagsEntry](#bytebase-v1-Plan-ChangeDatabaseConfig-GhostFlagsEntry)- - [Plan.ChangeDatabaseConfig.PreUpdateBackupDetail](#bytebase-v1-Plan-ChangeDatabaseConfig-PreUpdateBackupDetail)- [Plan.CreateDatabaseConfig](#bytebase-v1-Plan-CreateDatabaseConfig)- [Plan.Deployment](#bytebase-v1-Plan-Deployment)- [Plan.Deployment.DatabaseGroupMapping](#bytebase-v1-Plan-Deployment-DatabaseGroupMapping)@@ -7332,7 +7331,7 @@ When paginating, all other parameters provided to `ListPlans` must match the cal| release | [string](#string) | | The resource name of the release. Format: projects/{project}/releases/{release} || type | [Plan.ChangeDatabaseConfig.Type](#bytebase-v1-Plan-ChangeDatabaseConfig-Type) | | || ghost_flags | [Plan.ChangeDatabaseConfig.GhostFlagsEntry](#bytebase-v1-Plan-ChangeDatabaseConfig-GhostFlagsEntry) | repeated | |-| pre_update_backup_detail | [Plan.ChangeDatabaseConfig.PreUpdateBackupDetail](#bytebase-v1-Plan-ChangeDatabaseConfig-PreUpdateBackupDetail) | optional | If set, a backup of the modified data will be created automatically before any changes are applied. |+| enable_prior_backup | [bool](#bool) | | If set, a backup of the modified data will be created automatically before any changes are applied. |@@ -7355,21 +7354,6 @@ When paginating, all other parameters provided to `ListPlans` must match the cal-<a name="bytebase-v1-Plan-ChangeDatabaseConfig-PreUpdateBackupDetail"></a>--### Plan.ChangeDatabaseConfig.PreUpdateBackupDetail----| Field | Type | Label | Description |-| ----- | ---- | ----- | ----------- |-| database | [string](#string) | | The database for keeping the backup data. Format: instances/{instance}/databases/{database} |------<a name="bytebase-v1-Plan-CreateDatabaseConfig"></a>### Plan.CreateDatabaseConfigdiff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.htmlindex b0c462ed3b..cfd8919d36 100644--- a/proto/gen/grpc-doc/v1/index.html+++ b/proto/gen/grpc-doc/v1/index.html@@ -1878,10 +1878,6 @@<a href="#bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry"><span class="badge">M</span>Plan.ChangeDatabaseConfig.GhostFlagsEntry</a></li>- <li>- <a href="#bytebase.v1.Plan.ChangeDatabaseConfig.PreUpdateBackupDetail"><span class="badge">M</span>Plan.ChangeDatabaseConfig.PreUpdateBackupDetail</a>- </li>-<li><a href="#bytebase.v1.Plan.CreateDatabaseConfig"><span class="badge">M</span>Plan.CreateDatabaseConfig</a></li>@@ -20483,9 +20479,9 @@ Format: projects/{project}/releases/{release} </p></td></tr><tr>- <td>pre_update_backup_detail</td>- <td><a href="#bytebase.v1.Plan.ChangeDatabaseConfig.PreUpdateBackupDetail">Plan.ChangeDatabaseConfig.PreUpdateBackupDetail</a></td>- <td>optional</td>+ <td>enable_prior_backup</td>+ <td><a href="#bool">bool</a></td>+ <td></td><td><p>If set, a backup of the modified data will be created automatically before any changes are applied. </p></td></tr>@@ -20527,31 +20523,6 @@ Format: projects/{project}/releases/{release} </p></td>- <h3 id="bytebase.v1.Plan.ChangeDatabaseConfig.PreUpdateBackupDetail">Plan.ChangeDatabaseConfig.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.v1.Plan.CreateDatabaseConfig">Plan.CreateDatabaseConfig</h3><p></p>diff --git a/proto/generated-go/store/plan.pb.go b/proto/generated-go/store/plan.pb.goindex 648b25af3a..3ac53afb01 100644--- a/proto/generated-go/store/plan.pb.go+++ b/proto/generated-go/store/plan.pb.go@@ -367,9 +367,9 @@ type PlanConfig_ChangeDatabaseConfig struct {Type PlanConfig_ChangeDatabaseConfig_Type `protobuf:"varint,3,opt,name=type,proto3,enum=bytebase.store.PlanConfig_ChangeDatabaseConfig_Type" json:"type,omitempty"`GhostFlags map[string]string `protobuf:"bytes,7,rep,name=ghost_flags,json=ghostFlags,proto3" json:"ghost_flags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`// If set, a backup of the modified data will be created automatically before any changes are applied.- PreUpdateBackupDetail *PreUpdateBackupDetail `protobuf:"bytes,8,opt,name=pre_update_backup_detail,json=preUpdateBackupDetail,proto3,oneof" json:"pre_update_backup_detail,omitempty"`- unknownFields protoimpl.UnknownFields- sizeCache protoimpl.SizeCache+ EnablePriorBackup bool `protobuf:"varint,8,opt,name=enable_prior_backup,json=enablePriorBackup,proto3" json:"enable_prior_backup,omitempty"`+ unknownFields protoimpl.UnknownFields+ sizeCache protoimpl.SizeCache}func (x *PlanConfig_ChangeDatabaseConfig) Reset() {@@ -437,11 +437,11 @@ func (x *PlanConfig_ChangeDatabaseConfig) GetGhostFlags() map[string]string {return nil}-func (x *PlanConfig_ChangeDatabaseConfig) GetPreUpdateBackupDetail() *PreUpdateBackupDetail {+func (x *PlanConfig_ChangeDatabaseConfig) GetEnablePriorBackup() bool {if x != nil {- return x.PreUpdateBackupDetail+ return x.EnablePriorBackup}- return nil+ return false}type PlanConfig_ExportDataConfig struct {@@ -632,7 +632,7 @@ var File_store_plan_proto protoreflect.FileDescriptorconst file_store_plan_proto_rawDesc = "" +"\n" +- "\x10store/plan.proto\x12\x0ebytebase.store\x1a\x1fgoogle/api/field_behavior.proto\x1a\x12store/common.proto\x1a\x1astore/plan_check_run.proto\"\xda\r\n" ++ "\x10store/plan.proto\x12\x0ebytebase.store\x1a\x1fgoogle/api/field_behavior.proto\x1a\x12store/common.proto\"\x88\r\n" +"\n" +"PlanConfig\x125\n" +"\x05specs\x18\x01 \x03(\v2\x1f.bytebase.store.PlanConfig.SpecR\x05specs\x12E\n" +@@ -653,7 +653,7 @@ const file_store_plan_proto_rawDesc = "" +"\tcollation\x18\x05 \x01(\tB\x04\xe2A\x01\x01R\tcollation\x12\x1e\n" +"\acluster\x18\x06 \x01(\tB\x04\xe2A\x01\x01R\acluster\x12\x1a\n" +"\x05owner\x18\a \x01(\tB\x04\xe2A\x01\x01R\x05owner\x12&\n" +- "\venvironment\x18\t \x01(\tB\x04\xe2A\x01\x01R\venvironment\x1a\xa6\x04\n" ++ "\venvironment\x18\t \x01(\tB\x04\xe2A\x01\x01R\venvironment\x1a\xd4\x03\n" +"\x14ChangeDatabaseConfig\x12\x18\n" +"\atargets\x18\n" +" \x03(\tR\atargets\x12\x14\n" +@@ -661,8 +661,8 @@ const file_store_plan_proto_rawDesc = "" +"\arelease\x18\t \x01(\tR\arelease\x12H\n" +"\x04type\x18\x03 \x01(\x0e24.bytebase.store.PlanConfig.ChangeDatabaseConfig.TypeR\x04type\x12`\n" +"\vghost_flags\x18\a \x03(\v2?.bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntryR\n" +- "ghostFlags\x12c\n" +- "\x18pre_update_backup_detail\x18\b \x01(\v2%.bytebase.store.PreUpdateBackupDetailH\x00R\x15preUpdateBackupDetail\x88\x01\x01\x1a=\n" ++ "ghostFlags\x12.\n" ++ "\x13enable_prior_backup\x18\b \x01(\bR\x11enablePriorBackup\x1a=\n" +"\x0fGhostFlagsEntry\x12\x10\n" +"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"W\n" +@@ -671,8 +671,7 @@ const file_store_plan_proto_rawDesc = "" +"\aMIGRATE\x10\x02\x12\x0f\n" +"\vMIGRATE_SDL\x10\x03\x12\x11\n" +"\rMIGRATE_GHOST\x10\x04\x12\b\n" +- "\x04DATA\x10\x06B\x1b\n" +- "\x19_pre_update_backup_detail\x1a\xa6\x01\n" ++ "\x04DATA\x10\x06\x1a\xa6\x01\n" +"\x10ExportDataConfig\x12\x18\n" +"\atargets\x18\x05 \x03(\tR\atargets\x12\x14\n" +"\x05sheet\x18\x02 \x01(\tR\x05sheet\x124\n" +@@ -711,25 +710,23 @@ var file_store_plan_proto_goTypes = []any{(*PlanConfig_Deployment)(nil), // 6: bytebase.store.PlanConfig.Deploymentnil, // 7: bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry(*PlanConfig_Deployment_DatabaseGroupMapping)(nil), // 8: bytebase.store.PlanConfig.Deployment.DatabaseGroupMapping- (*PreUpdateBackupDetail)(nil), // 9: bytebase.store.PreUpdateBackupDetail- (ExportFormat)(0), // 10: bytebase.store.ExportFormat+ (ExportFormat)(0), // 9: bytebase.store.ExportFormat}var file_store_plan_proto_depIdxs = []int32{- 2, // 0: bytebase.store.PlanConfig.specs:type_name -> bytebase.store.PlanConfig.Spec- 6, // 1: bytebase.store.PlanConfig.deployment:type_name -> bytebase.store.PlanConfig.Deployment- 3, // 2: bytebase.store.PlanConfig.Spec.create_database_config:type_name -> bytebase.store.PlanConfig.CreateDatabaseConfig- 4, // 3: bytebase.store.PlanConfig.Spec.change_database_config:type_name -> bytebase.store.PlanConfig.ChangeDatabaseConfig- 5, // 4: bytebase.store.PlanConfig.Spec.export_data_config:type_name -> bytebase.store.PlanConfig.ExportDataConfig- 0, // 5: bytebase.store.PlanConfig.ChangeDatabaseConfig.type:type_name -> bytebase.store.PlanConfig.ChangeDatabaseConfig.Type- 7, // 6: bytebase.store.PlanConfig.ChangeDatabaseConfig.ghost_flags:type_name -> bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry- 9, // 7: bytebase.store.PlanConfig.ChangeDatabaseConfig.pre_update_backup_detail:type_name -> bytebase.store.PreUpdateBackupDetail- 10, // 8: bytebase.store.PlanConfig.ExportDataConfig.format:type_name -> bytebase.store.ExportFormat- 8, // 9: bytebase.store.PlanConfig.Deployment.database_group_mappings:type_name -> bytebase.store.PlanConfig.Deployment.DatabaseGroupMapping- 10, // [10:10] is the sub-list for method output_type- 10, // [10:10] is the sub-list for method input_type- 10, // [10:10] is the sub-list for extension type_name- 10, // [10:10] is the sub-list for extension extendee- 0, // [0:10] is the sub-list for field type_name+ 2, // 0: bytebase.store.PlanConfig.specs:type_name -> bytebase.store.PlanConfig.Spec+ 6, // 1: bytebase.store.PlanConfig.deployment:type_name -> bytebase.store.PlanConfig.Deployment+ 3, // 2: bytebase.store.PlanConfig.Spec.create_database_config:type_name -> bytebase.store.PlanConfig.CreateDatabaseConfig+ 4, // 3: bytebase.store.PlanConfig.Spec.change_database_config:type_name -> bytebase.store.PlanConfig.ChangeDatabaseConfig+ 5, // 4: bytebase.store.PlanConfig.Spec.export_data_config:type_name -> bytebase.store.PlanConfig.ExportDataConfig+ 0, // 5: bytebase.store.PlanConfig.ChangeDatabaseConfig.type:type_name -> bytebase.store.PlanConfig.ChangeDatabaseConfig.Type+ 7, // 6: bytebase.store.PlanConfig.ChangeDatabaseConfig.ghost_flags:type_name -> bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry+ 9, // 7: bytebase.store.PlanConfig.ExportDataConfig.format:type_name -> bytebase.store.ExportFormat+ 8, // 8: bytebase.store.PlanConfig.Deployment.database_group_mappings:type_name -> bytebase.store.PlanConfig.Deployment.DatabaseGroupMapping+ 9, // [9:9] is the sub-list for method output_type+ 9, // [9:9] is the sub-list for method input_type+ 9, // [9:9] is the sub-list for extension type_name+ 9, // [9:9] is the sub-list for extension extendee+ 0, // [0:9] is the sub-list for field type_name}func init() { file_store_plan_proto_init() }@@ -738,13 +735,11 @@ func file_store_plan_proto_init() {return}file_store_common_proto_init()- file_store_plan_check_run_proto_init()file_store_plan_proto_msgTypes[1].OneofWrappers = []any{(*PlanConfig_Spec_CreateDatabaseConfig)(nil),(*PlanConfig_Spec_ChangeDatabaseConfig)(nil),(*PlanConfig_Spec_ExportDataConfig)(nil),}- file_store_plan_proto_msgTypes[3].OneofWrappers = []any{}file_store_plan_proto_msgTypes[4].OneofWrappers = []any{}type x struct{}out := protoimpl.TypeBuilder{diff --git a/proto/generated-go/store/plan_check_run.pb.go b/proto/generated-go/store/plan_check_run.pb.goindex 53da4c7db7..f83b14c930 100644--- a/proto/generated-go/store/plan_check_run.pb.go+++ b/proto/generated-go/store/plan_check_run.pb.go@@ -76,7 +76,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{1, 0}+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{0, 0}}type PlanCheckRunResult_Result_Status int32@@ -128,53 +128,7 @@ 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{2, 0, 0}-}--type PreUpdateBackupDetail struct {- state protoimpl.MessageState `protogen:"open.v1"`- // The database for keeping the backup data.- // Format: instances/{instance}/databases/{database}- Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`- unknownFields protoimpl.UnknownFields- sizeCache protoimpl.SizeCache-}--func (x *PreUpdateBackupDetail) Reset() {- *x = PreUpdateBackupDetail{}- 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 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 ""+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{1, 0, 0}}type PlanCheckRunConfig struct {@@ -187,14 +141,14 @@ 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" protobuf_val:"bytes,2,opt,name=value"`// If set, a backup of the modified data will be created automatically before any changes are applied.- PreUpdateBackupDetail *PreUpdateBackupDetail `protobuf:"bytes,7,opt,name=pre_update_backup_detail,json=preUpdateBackupDetail,proto3,oneof" json:"pre_update_backup_detail,omitempty"`- unknownFields protoimpl.UnknownFields- sizeCache protoimpl.SizeCache+ EnablePriorBackup bool `protobuf:"varint,7,opt,name=enable_prior_backup,json=enablePriorBackup,proto3" json:"enable_prior_backup,omitempty"`+ unknownFields protoimpl.UnknownFields+ sizeCache protoimpl.SizeCache}func (x *PlanCheckRunConfig) Reset() {*x = PlanCheckRunConfig{}- mi := &file_store_plan_check_run_proto_msgTypes[1]+ mi := &file_store_plan_check_run_proto_msgTypes[0]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -206,7 +160,7 @@ func (x *PlanCheckRunConfig) String() string {func (*PlanCheckRunConfig) ProtoMessage() {}func (x *PlanCheckRunConfig) ProtoReflect() protoreflect.Message {- mi := &file_store_plan_check_run_proto_msgTypes[1]+ mi := &file_store_plan_check_run_proto_msgTypes[0]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -219,7 +173,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{1}+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{0}}func (x *PlanCheckRunConfig) GetSheetUid() int32 {@@ -265,11 +219,11 @@ func (x *PlanCheckRunConfig) GetGhostFlags() map[string]string {return nil}-func (x *PlanCheckRunConfig) GetPreUpdateBackupDetail() *PreUpdateBackupDetail {+func (x *PlanCheckRunConfig) GetEnablePriorBackup() bool {if x != nil {- return x.PreUpdateBackupDetail+ return x.EnablePriorBackup}- return nil+ return false}type PlanCheckRunResult struct {@@ -282,7 +236,7 @@ type PlanCheckRunResult struct {func (x *PlanCheckRunResult) Reset() {*x = PlanCheckRunResult{}- mi := &file_store_plan_check_run_proto_msgTypes[2]+ mi := &file_store_plan_check_run_proto_msgTypes[1]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -294,7 +248,7 @@ func (x *PlanCheckRunResult) String() string {func (*PlanCheckRunResult) ProtoMessage() {}func (x *PlanCheckRunResult) ProtoReflect() protoreflect.Message {- mi := &file_store_plan_check_run_proto_msgTypes[2]+ mi := &file_store_plan_check_run_proto_msgTypes[1]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -307,7 +261,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{2}+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{1}}func (x *PlanCheckRunResult) GetResults() []*PlanCheckRunResult_Result {@@ -341,7 +295,7 @@ type PlanCheckRunResult_Result struct {func (x *PlanCheckRunResult_Result) Reset() {*x = PlanCheckRunResult_Result{}- mi := &file_store_plan_check_run_proto_msgTypes[4]+ mi := &file_store_plan_check_run_proto_msgTypes[3]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -353,7 +307,7 @@ func (x *PlanCheckRunResult_Result) String() string {func (*PlanCheckRunResult_Result) ProtoMessage() {}func (x *PlanCheckRunResult_Result) ProtoReflect() protoreflect.Message {- mi := &file_store_plan_check_run_proto_msgTypes[4]+ mi := &file_store_plan_check_run_proto_msgTypes[3]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -366,7 +320,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{2, 0}+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{1, 0}}func (x *PlanCheckRunResult_Result) GetStatus() PlanCheckRunResult_Result_Status {@@ -450,7 +404,7 @@ type PlanCheckRunResult_Result_SqlSummaryReport struct {func (x *PlanCheckRunResult_Result_SqlSummaryReport) Reset() {*x = PlanCheckRunResult_Result_SqlSummaryReport{}- mi := &file_store_plan_check_run_proto_msgTypes[5]+ mi := &file_store_plan_check_run_proto_msgTypes[4]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -462,7 +416,7 @@ func (x *PlanCheckRunResult_Result_SqlSummaryReport) String() string {func (*PlanCheckRunResult_Result_SqlSummaryReport) ProtoMessage() {}func (x *PlanCheckRunResult_Result_SqlSummaryReport) ProtoReflect() protoreflect.Message {- mi := &file_store_plan_check_run_proto_msgTypes[5]+ mi := &file_store_plan_check_run_proto_msgTypes[4]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -475,7 +429,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{2, 0, 0}+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{1, 0, 0}}func (x *PlanCheckRunResult_Result_SqlSummaryReport) GetStatementTypes() []string {@@ -513,7 +467,7 @@ type PlanCheckRunResult_Result_SqlReviewReport struct {func (x *PlanCheckRunResult_Result_SqlReviewReport) Reset() {*x = PlanCheckRunResult_Result_SqlReviewReport{}- mi := &file_store_plan_check_run_proto_msgTypes[6]+ mi := &file_store_plan_check_run_proto_msgTypes[5]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -525,7 +479,7 @@ func (x *PlanCheckRunResult_Result_SqlReviewReport) String() string {func (*PlanCheckRunResult_Result_SqlReviewReport) ProtoMessage() {}func (x *PlanCheckRunResult_Result_SqlReviewReport) ProtoReflect() protoreflect.Message {- mi := &file_store_plan_check_run_proto_msgTypes[6]+ mi := &file_store_plan_check_run_proto_msgTypes[5]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -538,7 +492,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{2, 0, 1}+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{1, 0, 1}}func (x *PlanCheckRunResult_Result_SqlReviewReport) GetLine() int32 {@@ -573,9 +527,7 @@ var File_store_plan_check_run_proto protoreflect.FileDescriptorconst file_store_plan_check_run_proto_rawDesc = "" +"\n" +- "\x1astore/plan_check_run.proto\x12\x0ebytebase.store\x1a\x15store/changelog.proto\x1a\x12store/common.proto\"3\n" +- "\x15PreUpdateBackupDetail\x12\x1a\n" +- "\bdatabase\x18\x01 \x01(\tR\bdatabase\"\xba\x05\n" ++ "\x1astore/plan_check_run.proto\x12\x0ebytebase.store\x1a\x15store/changelog.proto\x1a\x12store/common.proto\"\xe8\x04\n" +"\x12PlanCheckRunConfig\x12\x1b\n" +"\tsheet_uid\x18\x01 \x01(\x05R\bsheetUid\x12g\n" +"\x14change_database_type\x18\x02 \x01(\x0e25.bytebase.store.PlanCheckRunConfig.ChangeDatabaseTypeR\x12changeDatabaseType\x12\x1f\n" +@@ -584,8 +536,8 @@ const file_store_plan_check_run_proto_rawDesc = "" +"\rdatabase_name\x18\x04 \x01(\tR\fdatabaseName\x125\n" +"\x12database_group_uid\x18\x05 \x01(\x03B\x02\x18\x01H\x00R\x10databaseGroupUid\x88\x01\x01\x12S\n" +"\vghost_flags\x18\x06 \x03(\v22.bytebase.store.PlanCheckRunConfig.GhostFlagsEntryR\n" +- "ghostFlags\x12c\n" +- "\x18pre_update_backup_detail\x18\a \x01(\v2%.bytebase.store.PreUpdateBackupDetailH\x01R\x15preUpdateBackupDetail\x88\x01\x01\x1a=\n" ++ "ghostFlags\x12.\n" ++ "\x13enable_prior_backup\x18\a \x01(\bR\x11enablePriorBackup\x1a=\n" +"\x0fGhostFlagsEntry\x12\x10\n" +"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"t\n" +@@ -597,8 +549,7 @@ const file_store_plan_check_run_proto_rawDesc = "" +"\tDDL_GHOST\x10\x04\x12\x0e\n" +"\n" +"SQL_EDITOR\x10\x05B\x15\n" +- "\x13_database_group_uidB\x1b\n" +- "\x19_pre_update_backup_detail\"\xb0\a\n" ++ "\x13_database_group_uid\"\xb0\a\n" +"\x12PlanCheckRunResult\x12C\n" +"\aresults\x18\x01 \x03(\v2).bytebase.store.PlanCheckRunResult.ResultR\aresults\x12\x14\n" +"\x05error\x18\x02 \x01(\tR\x05error\x1a\xbe\x06\n" +@@ -638,36 +589,34 @@ func file_store_plan_check_run_proto_rawDescGZIP() []byte {}var file_store_plan_check_run_proto_enumTypes = make([]protoimpl.EnumInfo, 2)-var file_store_plan_check_run_proto_msgTypes = make([]protoimpl.MessageInfo, 7)+var file_store_plan_check_run_proto_msgTypes = make([]protoimpl.MessageInfo, 6)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- (*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- (*ChangedResources)(nil), // 9: bytebase.store.ChangedResources- (*Position)(nil), // 10: bytebase.store.Position+ (*PlanCheckRunConfig)(nil), // 2: bytebase.store.PlanCheckRunConfig+ (*PlanCheckRunResult)(nil), // 3: bytebase.store.PlanCheckRunResult+ nil, // 4: bytebase.store.PlanCheckRunConfig.GhostFlagsEntry+ (*PlanCheckRunResult_Result)(nil), // 5: bytebase.store.PlanCheckRunResult.Result+ (*PlanCheckRunResult_Result_SqlSummaryReport)(nil), // 6: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport+ (*PlanCheckRunResult_Result_SqlReviewReport)(nil), // 7: bytebase.store.PlanCheckRunResult.Result.SqlReviewReport+ (*ChangedResources)(nil), // 8: bytebase.store.ChangedResources+ (*Position)(nil), // 9: bytebase.store.Position}var file_store_plan_check_run_proto_depIdxs = []int32{- 0, // 0: bytebase.store.PlanCheckRunConfig.change_database_type:type_name -> bytebase.store.PlanCheckRunConfig.ChangeDatabaseType- 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.PreUpdateBackupDetail- 6, // 3: bytebase.store.PlanCheckRunResult.results:type_name -> bytebase.store.PlanCheckRunResult.Result- 1, // 4: bytebase.store.PlanCheckRunResult.Result.status:type_name -> bytebase.store.PlanCheckRunResult.Result.Status- 7, // 5: bytebase.store.PlanCheckRunResult.Result.sql_summary_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport- 8, // 6: bytebase.store.PlanCheckRunResult.Result.sql_review_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlReviewReport- 9, // 7: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport.changed_resources:type_name -> bytebase.store.ChangedResources- 10, // 8: bytebase.store.PlanCheckRunResult.Result.SqlReviewReport.start_position:type_name -> bytebase.store.Position- 10, // 9: bytebase.store.PlanCheckRunResult.Result.SqlReviewReport.end_position:type_name -> bytebase.store.Position- 10, // [10:10] is the sub-list for method output_type- 10, // [10:10] is the sub-list for method input_type- 10, // [10:10] is the sub-list for extension type_name- 10, // [10:10] is the sub-list for extension extendee- 0, // [0:10] is the sub-list for field type_name+ 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.PlanCheckRunResult.results:type_name -> bytebase.store.PlanCheckRunResult.Result+ 1, // 3: bytebase.store.PlanCheckRunResult.Result.status:type_name -> bytebase.store.PlanCheckRunResult.Result.Status+ 6, // 4: bytebase.store.PlanCheckRunResult.Result.sql_summary_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport+ 7, // 5: bytebase.store.PlanCheckRunResult.Result.sql_review_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlReviewReport+ 8, // 6: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport.changed_resources:type_name -> bytebase.store.ChangedResources+ 9, // 7: bytebase.store.PlanCheckRunResult.Result.SqlReviewReport.start_position:type_name -> bytebase.store.Position+ 9, // 8: bytebase.store.PlanCheckRunResult.Result.SqlReviewReport.end_position:type_name -> bytebase.store.Position+ 9, // [9:9] is the sub-list for method output_type+ 9, // [9:9] is the sub-list for method input_type+ 9, // [9:9] is the sub-list for extension type_name+ 9, // [9:9] is the sub-list for extension extendee+ 0, // [0:9] is the sub-list for field type_name}func init() { file_store_plan_check_run_proto_init() }@@ -677,8 +626,8 @@ func file_store_plan_check_run_proto_init() {}file_store_changelog_proto_init()file_store_common_proto_init()- file_store_plan_check_run_proto_msgTypes[1].OneofWrappers = []any{}- file_store_plan_check_run_proto_msgTypes[4].OneofWrappers = []any{+ file_store_plan_check_run_proto_msgTypes[0].OneofWrappers = []any{}+ file_store_plan_check_run_proto_msgTypes[3].OneofWrappers = []any{(*PlanCheckRunResult_Result_SqlSummaryReport_)(nil),(*PlanCheckRunResult_Result_SqlReviewReport_)(nil),}@@ -688,7 +637,7 @@ func file_store_plan_check_run_proto_init() {GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: unsafe.Slice(unsafe.StringData(file_store_plan_check_run_proto_rawDesc), len(file_store_plan_check_run_proto_rawDesc)),NumEnums: 2,- NumMessages: 7,+ NumMessages: 6,NumExtensions: 0,NumServices: 0,},diff --git a/proto/generated-go/store/task.pb.go b/proto/generated-go/store/task.pb.goindex 469c48f912..e4132691d4 100644--- a/proto/generated-go/store/task.pb.go+++ b/proto/generated-go/store/task.pb.go@@ -35,8 +35,8 @@ type TaskPayload struct {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"`// Update database fields.- SchemaVersion string `protobuf:"bytes,10,opt,name=schema_version,json=schemaVersion,proto3" json:"schema_version,omitempty"`- PreUpdateBackupDetail *PreUpdateBackupDetail `protobuf:"bytes,11,opt,name=pre_update_backup_detail,json=preUpdateBackupDetail,proto3" json:"pre_update_backup_detail,omitempty"`+ SchemaVersion string `protobuf:"bytes,10,opt,name=schema_version,json=schemaVersion,proto3" json:"schema_version,omitempty"`+ EnablePriorBackup bool `protobuf:"varint,11,opt,name=enable_prior_backup,json=enablePriorBackup,proto3" json:"enable_prior_backup,omitempty"`// ghost flags.Flags map[string]string `protobuf:"bytes,12,rep,name=flags,proto3" json:"flags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`TaskReleaseSource *TaskReleaseSource `protobuf:"bytes,13,opt,name=task_release_source,json=taskReleaseSource,proto3" json:"task_release_source,omitempty"`@@ -147,11 +147,11 @@ func (x *TaskPayload) GetSchemaVersion() string {return ""}-func (x *TaskPayload) GetPreUpdateBackupDetail() *PreUpdateBackupDetail {+func (x *TaskPayload) GetEnablePriorBackup() bool {if x != nil {- return x.PreUpdateBackupDetail+ return x.EnablePriorBackup}- return nil+ return false}func (x *TaskPayload) GetFlags() map[string]string {@@ -231,7 +231,7 @@ var File_store_task_proto protoreflect.FileDescriptorconst file_store_task_proto_rawDesc = "" +"\n" +- "\x10store/task.proto\x12\x0ebytebase.store\x1a\x12store/common.proto\x1a\x1astore/plan_check_run.proto\"\xd4\x05\n" ++ "\x10store/task.proto\x12\x0ebytebase.store\x1a\x12store/common.proto\"\xa4\x05\n" +"\vTaskPayload\x12\x18\n" +"\askipped\x18\x01 \x01(\bR\askipped\x12%\n" +"\x0eskipped_reason\x18\x02 \x01(\tR\rskippedReason\x12\x17\n" +@@ -244,8 +244,8 @@ const file_store_task_proto_rawDesc = "" +"\rcharacter_set\x18\b \x01(\tR\fcharacterSet\x12\x1c\n" +"\tcollation\x18\t \x01(\tR\tcollation\x12%\n" +"\x0eschema_version\x18\n" +- " \x01(\tR\rschemaVersion\x12^\n" +- "\x18pre_update_backup_detail\x18\v \x01(\v2%.bytebase.store.PreUpdateBackupDetailR\x15preUpdateBackupDetail\x12<\n" ++ " \x01(\tR\rschemaVersion\x12.\n" ++ "\x13enable_prior_backup\x18\v \x01(\bR\x11enablePriorBackup\x12<\n" +"\x05flags\x18\f \x03(\v2&.bytebase.store.TaskPayload.FlagsEntryR\x05flags\x12Q\n" +"\x13task_release_source\x18\r \x01(\v2!.bytebase.store.TaskReleaseSourceR\x11taskReleaseSource\x12\x1a\n" +"\bpassword\x18\x0e \x01(\tR\bpassword\x124\n" +@@ -271,22 +271,20 @@ func file_store_task_proto_rawDescGZIP() []byte {var file_store_task_proto_msgTypes = make([]protoimpl.MessageInfo, 3)var file_store_task_proto_goTypes = []any{- (*TaskPayload)(nil), // 0: bytebase.store.TaskPayload- (*TaskReleaseSource)(nil), // 1: bytebase.store.TaskReleaseSource- nil, // 2: bytebase.store.TaskPayload.FlagsEntry- (*PreUpdateBackupDetail)(nil), // 3: bytebase.store.PreUpdateBackupDetail- (ExportFormat)(0), // 4: bytebase.store.ExportFormat+ (*TaskPayload)(nil), // 0: bytebase.store.TaskPayload+ (*TaskReleaseSource)(nil), // 1: bytebase.store.TaskReleaseSource+ nil, // 2: bytebase.store.TaskPayload.FlagsEntry+ (ExportFormat)(0), // 3: bytebase.store.ExportFormat}var file_store_task_proto_depIdxs = []int32{- 3, // 0: bytebase.store.TaskPayload.pre_update_backup_detail:type_name -> bytebase.store.PreUpdateBackupDetail- 2, // 1: bytebase.store.TaskPayload.flags:type_name -> bytebase.store.TaskPayload.FlagsEntry- 1, // 2: bytebase.store.TaskPayload.task_release_source:type_name -> bytebase.store.TaskReleaseSource- 4, // 3: bytebase.store.TaskPayload.format:type_name -> bytebase.store.ExportFormat- 4, // [4:4] is the sub-list for method output_type- 4, // [4:4] is the sub-list for method input_type- 4, // [4:4] is the sub-list for extension type_name- 4, // [4:4] is the sub-list for extension extendee- 0, // [0:4] is the sub-list for field type_name+ 2, // 0: bytebase.store.TaskPayload.flags:type_name -> bytebase.store.TaskPayload.FlagsEntry+ 1, // 1: bytebase.store.TaskPayload.task_release_source:type_name -> bytebase.store.TaskReleaseSource+ 3, // 2: bytebase.store.TaskPayload.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() }@@ -295,7 +293,6 @@ func file_store_task_proto_init() {return}file_store_common_proto_init()- file_store_plan_check_run_proto_init()type x struct{}out := protoimpl.TypeBuilder{File: protoimpl.DescBuilder{diff --git a/proto/generated-go/v1/plan_service.pb.go b/proto/generated-go/v1/plan_service.pb.goindex b655335484..d1a8c3d99c 100644--- a/proto/generated-go/v1/plan_service.pb.go+++ b/proto/generated-go/v1/plan_service.pb.go@@ -1510,9 +1510,9 @@ type Plan_ChangeDatabaseConfig struct {Type Plan_ChangeDatabaseConfig_Type `protobuf:"varint,3,opt,name=type,proto3,enum=bytebase.v1.Plan_ChangeDatabaseConfig_Type" json:"type,omitempty"`GhostFlags map[string]string `protobuf:"bytes,7,rep,name=ghost_flags,json=ghostFlags,proto3" json:"ghost_flags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`// If set, a backup of the modified data will be created automatically before any changes are applied.- PreUpdateBackupDetail *Plan_ChangeDatabaseConfig_PreUpdateBackupDetail `protobuf:"bytes,8,opt,name=pre_update_backup_detail,json=preUpdateBackupDetail,proto3,oneof" json:"pre_update_backup_detail,omitempty"`- unknownFields protoimpl.UnknownFields- sizeCache protoimpl.SizeCache+ EnablePriorBackup bool `protobuf:"varint,8,opt,name=enable_prior_backup,json=enablePriorBackup,proto3" json:"enable_prior_backup,omitempty"`+ unknownFields protoimpl.UnknownFields+ sizeCache protoimpl.SizeCache}func (x *Plan_ChangeDatabaseConfig) Reset() {@@ -1580,11 +1580,11 @@ func (x *Plan_ChangeDatabaseConfig) GetGhostFlags() map[string]string {return nil}-func (x *Plan_ChangeDatabaseConfig) GetPreUpdateBackupDetail() *Plan_ChangeDatabaseConfig_PreUpdateBackupDetail {+func (x *Plan_ChangeDatabaseConfig) GetEnablePriorBackup() bool {if x != nil {- return x.PreUpdateBackupDetail+ return x.EnablePriorBackup}- return nil+ return false}type Plan_ExportDataConfig struct {@@ -1717,52 +1717,6 @@ func (x *Plan_Deployment) GetDatabaseGroupMappings() []*Plan_Deployment_Databasereturn nil}-type Plan_ChangeDatabaseConfig_PreUpdateBackupDetail struct {- state protoimpl.MessageState `protogen:"open.v1"`- // The database for keeping the backup data.- // Format: instances/{instance}/databases/{database}- Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`- unknownFields protoimpl.UnknownFields- sizeCache protoimpl.SizeCache-}--func (x *Plan_ChangeDatabaseConfig_PreUpdateBackupDetail) Reset() {- *x = Plan_ChangeDatabaseConfig_PreUpdateBackupDetail{}- mi := &file_v1_plan_service_proto_msgTypes[23]- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- ms.StoreMessageInfo(mi)-}--func (x *Plan_ChangeDatabaseConfig_PreUpdateBackupDetail) String() string {- return protoimpl.X.MessageStringOf(x)-}--func (*Plan_ChangeDatabaseConfig_PreUpdateBackupDetail) ProtoMessage() {}--func (x *Plan_ChangeDatabaseConfig_PreUpdateBackupDetail) ProtoReflect() protoreflect.Message {- mi := &file_v1_plan_service_proto_msgTypes[23]- if x != nil {- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- if ms.LoadMessageInfo() == nil {- ms.StoreMessageInfo(mi)- }- return ms- }- return mi.MessageOf(x)-}--// Deprecated: Use Plan_ChangeDatabaseConfig_PreUpdateBackupDetail.ProtoReflect.Descriptor instead.-func (*Plan_ChangeDatabaseConfig_PreUpdateBackupDetail) Descriptor() ([]byte, []int) {- return file_v1_plan_service_proto_rawDescGZIP(), []int{7, 4, 1}-}--func (x *Plan_ChangeDatabaseConfig_PreUpdateBackupDetail) GetDatabase() string {- if x != nil {- return x.Database- }- return ""-}-type Plan_Deployment_DatabaseGroupMapping struct {state protoimpl.MessageState `protogen:"open.v1"`// Format: projects/{project}/databaseGroups/{databaseGroup}.@@ -1775,7 +1729,7 @@ type Plan_Deployment_DatabaseGroupMapping struct {func (x *Plan_Deployment_DatabaseGroupMapping) Reset() {*x = Plan_Deployment_DatabaseGroupMapping{}- mi := &file_v1_plan_service_proto_msgTypes[24]+ mi := &file_v1_plan_service_proto_msgTypes[23]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1787,7 +1741,7 @@ func (x *Plan_Deployment_DatabaseGroupMapping) String() string {func (*Plan_Deployment_DatabaseGroupMapping) ProtoMessage() {}func (x *Plan_Deployment_DatabaseGroupMapping) ProtoReflect() protoreflect.Message {- mi := &file_v1_plan_service_proto_msgTypes[24]+ mi := &file_v1_plan_service_proto_msgTypes[23]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1834,7 +1788,7 @@ type PlanCheckRun_Result struct {func (x *PlanCheckRun_Result) Reset() {*x = PlanCheckRun_Result{}- mi := &file_v1_plan_service_proto_msgTypes[25]+ mi := &file_v1_plan_service_proto_msgTypes[24]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1846,7 +1800,7 @@ func (x *PlanCheckRun_Result) String() string {func (*PlanCheckRun_Result) ProtoMessage() {}func (x *PlanCheckRun_Result) ProtoReflect() protoreflect.Message {- mi := &file_v1_plan_service_proto_msgTypes[25]+ mi := &file_v1_plan_service_proto_msgTypes[24]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1943,7 +1897,7 @@ type PlanCheckRun_Result_SqlSummaryReport struct {func (x *PlanCheckRun_Result_SqlSummaryReport) Reset() {*x = PlanCheckRun_Result_SqlSummaryReport{}- mi := &file_v1_plan_service_proto_msgTypes[26]+ mi := &file_v1_plan_service_proto_msgTypes[25]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1955,7 +1909,7 @@ func (x *PlanCheckRun_Result_SqlSummaryReport) String() string {func (*PlanCheckRun_Result_SqlSummaryReport) ProtoMessage() {}func (x *PlanCheckRun_Result_SqlSummaryReport) ProtoReflect() protoreflect.Message {- mi := &file_v1_plan_service_proto_msgTypes[26]+ mi := &file_v1_plan_service_proto_msgTypes[25]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -2006,7 +1960,7 @@ type PlanCheckRun_Result_SqlReviewReport struct {func (x *PlanCheckRun_Result_SqlReviewReport) Reset() {*x = PlanCheckRun_Result_SqlReviewReport{}- mi := &file_v1_plan_service_proto_msgTypes[27]+ mi := &file_v1_plan_service_proto_msgTypes[26]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -2018,7 +1972,7 @@ func (x *PlanCheckRun_Result_SqlReviewReport) String() string {func (*PlanCheckRun_Result_SqlReviewReport) ProtoMessage() {}func (x *PlanCheckRun_Result_SqlReviewReport) ProtoReflect() protoreflect.Message {- mi := &file_v1_plan_service_proto_msgTypes[27]+ mi := &file_v1_plan_service_proto_msgTypes[26]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -2095,7 +2049,7 @@ const file_v1_plan_service_proto_rawDesc = "" +"\x11UpdatePlanRequest\x12+\n" +"\x04plan\x18\x01 \x01(\v2\x11.bytebase.v1.PlanB\x04\xe2A\x01\x02R\x04plan\x12A\n" +"\vupdate_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskB\x04\xe2A\x01\x02R\n" +- "updateMask\"\xcf\x12\n" ++ "updateMask\"\xb1\x11\n" +"\x04Plan\x12\x12\n" +"\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" +"\x05issue\x18\x03 \x01(\tR\x05issue\x12\x14\n" +@@ -2132,7 +2086,7 @@ const file_v1_plan_service_proto_rawDesc = "" +"\tcollation\x18\x05 \x01(\tB\x04\xe2A\x01\x01R\tcollation\x12\x1e\n" +"\acluster\x18\x06 \x01(\tB\x04\xe2A\x01\x01R\acluster\x12\x1a\n" +"\x05owner\x18\a \x01(\tB\x04\xe2A\x01\x01R\x05owner\x12&\n" +- "\venvironment\x18\t \x01(\tB\x04\xe2A\x01\x01R\venvironment\x1a\x87\x05\n" ++ "\venvironment\x18\t \x01(\tB\x04\xe2A\x01\x01R\venvironment\x1a\xe9\x03\n" +"\x14ChangeDatabaseConfig\x12\x18\n" +"\atargets\x18\n" +" \x03(\tR\atargets\x12\x14\n" +@@ -2141,20 +2095,17 @@ const file_v1_plan_service_proto_rawDesc = "" +"\x14bytebase.com/ReleaseR\arelease\x12?\n" +"\x04type\x18\x03 \x01(\x0e2+.bytebase.v1.Plan.ChangeDatabaseConfig.TypeR\x04type\x12W\n" +"\vghost_flags\x18\a \x03(\v26.bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntryR\n" +- "ghostFlags\x12z\n" +- "\x18pre_update_backup_detail\x18\b \x01(\v2<.bytebase.v1.Plan.ChangeDatabaseConfig.PreUpdateBackupDetailH\x00R\x15preUpdateBackupDetail\x88\x01\x01\x1a=\n" ++ "ghostFlags\x12.\n" ++ "\x13enable_prior_backup\x18\b \x01(\bR\x11enablePriorBackup\x1a=\n" +"\x0fGhostFlagsEntry\x12\x10\n" +"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +- "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a3\n" +- "\x15PreUpdateBackupDetail\x12\x1a\n" +- "\bdatabase\x18\x01 \x01(\tR\bdatabase\"W\n" ++ "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"W\n" +"\x04Type\x12\x14\n" +"\x10TYPE_UNSPECIFIED\x10\x00\x12\v\n" +"\aMIGRATE\x10\x02\x12\x0f\n" +"\vMIGRATE_SDL\x10\x03\x12\x11\n" +"\rMIGRATE_GHOST\x10\x04\x12\b\n" +- "\x04DATA\x10\x06B\x1b\n" +- "\x19_pre_update_backup_detailJ\x04\b\x05\x10\x06J\x04\b\x06\x10\a\x1a\xa3\x01\n" ++ "\x04DATA\x10\x06J\x04\b\x05\x10\x06J\x04\b\x06\x10\a\x1a\xa3\x01\n" +"\x10ExportDataConfig\x12\x18\n" +"\atargets\x18\x05 \x03(\tR\atargets\x12\x14\n" +"\x05sheet\x18\x02 \x01(\tR\x05sheet\x121\n" +@@ -2261,98 +2212,96 @@ func file_v1_plan_service_proto_rawDescGZIP() []byte {}var file_v1_plan_service_proto_enumTypes = make([]protoimpl.EnumInfo, 4)-var file_v1_plan_service_proto_msgTypes = make([]protoimpl.MessageInfo, 28)+var file_v1_plan_service_proto_msgTypes = make([]protoimpl.MessageInfo, 27)var file_v1_plan_service_proto_goTypes = []any{- (Plan_ChangeDatabaseConfig_Type)(0), // 0: bytebase.v1.Plan.ChangeDatabaseConfig.Type- (PlanCheckRun_Type)(0), // 1: bytebase.v1.PlanCheckRun.Type- (PlanCheckRun_Status)(0), // 2: bytebase.v1.PlanCheckRun.Status- (PlanCheckRun_Result_Status)(0), // 3: bytebase.v1.PlanCheckRun.Result.Status- (*GetPlanRequest)(nil), // 4: bytebase.v1.GetPlanRequest- (*ListPlansRequest)(nil), // 5: bytebase.v1.ListPlansRequest- (*ListPlansResponse)(nil), // 6: bytebase.v1.ListPlansResponse- (*SearchPlansRequest)(nil), // 7: bytebase.v1.SearchPlansRequest- (*SearchPlansResponse)(nil), // 8: bytebase.v1.SearchPlansResponse- (*CreatePlanRequest)(nil), // 9: bytebase.v1.CreatePlanRequest- (*UpdatePlanRequest)(nil), // 10: bytebase.v1.UpdatePlanRequest- (*Plan)(nil), // 11: bytebase.v1.Plan- (*ListPlanCheckRunsRequest)(nil), // 12: bytebase.v1.ListPlanCheckRunsRequest- (*ListPlanCheckRunsResponse)(nil), // 13: bytebase.v1.ListPlanCheckRunsResponse- (*RunPlanChecksRequest)(nil), // 14: bytebase.v1.RunPlanChecksRequest- (*RunPlanChecksResponse)(nil), // 15: bytebase.v1.RunPlanChecksResponse- (*BatchCancelPlanCheckRunsRequest)(nil), // 16: bytebase.v1.BatchCancelPlanCheckRunsRequest- (*BatchCancelPlanCheckRunsResponse)(nil), // 17: bytebase.v1.BatchCancelPlanCheckRunsResponse- (*PlanCheckRun)(nil), // 18: bytebase.v1.PlanCheckRun- (*Plan_Step)(nil), // 19: bytebase.v1.Plan.Step- (*Plan_Spec)(nil), // 20: bytebase.v1.Plan.Spec- nil, // 21: bytebase.v1.Plan.PlanCheckRunStatusCountEntry- (*Plan_CreateDatabaseConfig)(nil), // 22: bytebase.v1.Plan.CreateDatabaseConfig- (*Plan_ChangeDatabaseConfig)(nil), // 23: bytebase.v1.Plan.ChangeDatabaseConfig- (*Plan_ExportDataConfig)(nil), // 24: bytebase.v1.Plan.ExportDataConfig- (*Plan_Deployment)(nil), // 25: bytebase.v1.Plan.Deployment- nil, // 26: bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry- (*Plan_ChangeDatabaseConfig_PreUpdateBackupDetail)(nil), // 27: bytebase.v1.Plan.ChangeDatabaseConfig.PreUpdateBackupDetail- (*Plan_Deployment_DatabaseGroupMapping)(nil), // 28: bytebase.v1.Plan.Deployment.DatabaseGroupMapping- (*PlanCheckRun_Result)(nil), // 29: bytebase.v1.PlanCheckRun.Result- (*PlanCheckRun_Result_SqlSummaryReport)(nil), // 30: bytebase.v1.PlanCheckRun.Result.SqlSummaryReport- (*PlanCheckRun_Result_SqlReviewReport)(nil), // 31: bytebase.v1.PlanCheckRun.Result.SqlReviewReport- (*fieldmaskpb.FieldMask)(nil), // 32: google.protobuf.FieldMask- (*timestamppb.Timestamp)(nil), // 33: google.protobuf.Timestamp- (ExportFormat)(0), // 34: bytebase.v1.ExportFormat- (*ChangedResources)(nil), // 35: bytebase.v1.ChangedResources- (*Position)(nil), // 36: bytebase.v1.Position+ (Plan_ChangeDatabaseConfig_Type)(0), // 0: bytebase.v1.Plan.ChangeDatabaseConfig.Type+ (PlanCheckRun_Type)(0), // 1: bytebase.v1.PlanCheckRun.Type+ (PlanCheckRun_Status)(0), // 2: bytebase.v1.PlanCheckRun.Status+ (PlanCheckRun_Result_Status)(0), // 3: bytebase.v1.PlanCheckRun.Result.Status+ (*GetPlanRequest)(nil), // 4: bytebase.v1.GetPlanRequest+ (*ListPlansRequest)(nil), // 5: bytebase.v1.ListPlansRequest+ (*ListPlansResponse)(nil), // 6: bytebase.v1.ListPlansResponse+ (*SearchPlansRequest)(nil), // 7: bytebase.v1.SearchPlansRequest+ (*SearchPlansResponse)(nil), // 8: bytebase.v1.SearchPlansResponse+ (*CreatePlanRequest)(nil), // 9: bytebase.v1.CreatePlanRequest+ (*UpdatePlanRequest)(nil), // 10: bytebase.v1.UpdatePlanRequest+ (*Plan)(nil), // 11: bytebase.v1.Plan+ (*ListPlanCheckRunsRequest)(nil), // 12: bytebase.v1.ListPlanCheckRunsRequest+ (*ListPlanCheckRunsResponse)(nil), // 13: bytebase.v1.ListPlanCheckRunsResponse+ (*RunPlanChecksRequest)(nil), // 14: bytebase.v1.RunPlanChecksRequest+ (*RunPlanChecksResponse)(nil), // 15: bytebase.v1.RunPlanChecksResponse+ (*BatchCancelPlanCheckRunsRequest)(nil), // 16: bytebase.v1.BatchCancelPlanCheckRunsRequest+ (*BatchCancelPlanCheckRunsResponse)(nil), // 17: bytebase.v1.BatchCancelPlanCheckRunsResponse+ (*PlanCheckRun)(nil), // 18: bytebase.v1.PlanCheckRun+ (*Plan_Step)(nil), // 19: bytebase.v1.Plan.Step+ (*Plan_Spec)(nil), // 20: bytebase.v1.Plan.Spec+ nil, // 21: bytebase.v1.Plan.PlanCheckRunStatusCountEntry+ (*Plan_CreateDatabaseConfig)(nil), // 22: bytebase.v1.Plan.CreateDatabaseConfig+ (*Plan_ChangeDatabaseConfig)(nil), // 23: bytebase.v1.Plan.ChangeDatabaseConfig+ (*Plan_ExportDataConfig)(nil), // 24: bytebase.v1.Plan.ExportDataConfig+ (*Plan_Deployment)(nil), // 25: bytebase.v1.Plan.Deployment+ nil, // 26: bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry+ (*Plan_Deployment_DatabaseGroupMapping)(nil), // 27: bytebase.v1.Plan.Deployment.DatabaseGroupMapping+ (*PlanCheckRun_Result)(nil), // 28: bytebase.v1.PlanCheckRun.Result+ (*PlanCheckRun_Result_SqlSummaryReport)(nil), // 29: bytebase.v1.PlanCheckRun.Result.SqlSummaryReport+ (*PlanCheckRun_Result_SqlReviewReport)(nil), // 30: bytebase.v1.PlanCheckRun.Result.SqlReviewReport+ (*fieldmaskpb.FieldMask)(nil), // 31: google.protobuf.FieldMask+ (*timestamppb.Timestamp)(nil), // 32: google.protobuf.Timestamp+ (ExportFormat)(0), // 33: bytebase.v1.ExportFormat+ (*ChangedResources)(nil), // 34: bytebase.v1.ChangedResources+ (*Position)(nil), // 35: bytebase.v1.Position}var file_v1_plan_service_proto_depIdxs = []int32{11, // 0: bytebase.v1.ListPlansResponse.plans:type_name -> bytebase.v1.Plan11, // 1: bytebase.v1.SearchPlansResponse.plans:type_name -> bytebase.v1.Plan11, // 2: bytebase.v1.CreatePlanRequest.plan:type_name -> bytebase.v1.Plan11, // 3: bytebase.v1.UpdatePlanRequest.plan:type_name -> bytebase.v1.Plan- 32, // 4: bytebase.v1.UpdatePlanRequest.update_mask:type_name -> google.protobuf.FieldMask+ 31, // 4: bytebase.v1.UpdatePlanRequest.update_mask:type_name -> google.protobuf.FieldMask20, // 5: bytebase.v1.Plan.specs:type_name -> bytebase.v1.Plan.Spec- 33, // 6: bytebase.v1.Plan.create_time:type_name -> google.protobuf.Timestamp- 33, // 7: bytebase.v1.Plan.update_time:type_name -> google.protobuf.Timestamp+ 32, // 6: bytebase.v1.Plan.create_time:type_name -> google.protobuf.Timestamp+ 32, // 7: bytebase.v1.Plan.update_time:type_name -> google.protobuf.Timestamp21, // 8: bytebase.v1.Plan.plan_check_run_status_count:type_name -> bytebase.v1.Plan.PlanCheckRunStatusCountEntry25, // 9: bytebase.v1.Plan.deployment:type_name -> bytebase.v1.Plan.Deployment18, // 10: bytebase.v1.ListPlanCheckRunsResponse.plan_check_runs:type_name -> bytebase.v1.PlanCheckRun1, // 11: bytebase.v1.PlanCheckRun.type:type_name -> bytebase.v1.PlanCheckRun.Type2, // 12: bytebase.v1.PlanCheckRun.status:type_name -> bytebase.v1.PlanCheckRun.Status- 29, // 13: bytebase.v1.PlanCheckRun.results:type_name -> bytebase.v1.PlanCheckRun.Result- 33, // 14: bytebase.v1.PlanCheckRun.create_time:type_name -> google.protobuf.Timestamp+ 28, // 13: bytebase.v1.PlanCheckRun.results:type_name -> bytebase.v1.PlanCheckRun.Result+ 32, // 14: bytebase.v1.PlanCheckRun.create_time:type_name -> google.protobuf.Timestamp20, // 15: bytebase.v1.Plan.Step.specs:type_name -> bytebase.v1.Plan.Spec22, // 16: bytebase.v1.Plan.Spec.create_database_config:type_name -> bytebase.v1.Plan.CreateDatabaseConfig23, // 17: bytebase.v1.Plan.Spec.change_database_config:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig24, // 18: bytebase.v1.Plan.Spec.export_data_config:type_name -> bytebase.v1.Plan.ExportDataConfig0, // 19: bytebase.v1.Plan.ChangeDatabaseConfig.type:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.Type26, // 20: bytebase.v1.Plan.ChangeDatabaseConfig.ghost_flags:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry- 27, // 21: bytebase.v1.Plan.ChangeDatabaseConfig.pre_update_backup_detail:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.PreUpdateBackupDetail- 34, // 22: bytebase.v1.Plan.ExportDataConfig.format:type_name -> bytebase.v1.ExportFormat- 28, // 23: bytebase.v1.Plan.Deployment.database_group_mappings:type_name -> bytebase.v1.Plan.Deployment.DatabaseGroupMapping- 3, // 24: bytebase.v1.PlanCheckRun.Result.status:type_name -> bytebase.v1.PlanCheckRun.Result.Status- 30, // 25: bytebase.v1.PlanCheckRun.Result.sql_summary_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlSummaryReport- 31, // 26: bytebase.v1.PlanCheckRun.Result.sql_review_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlReviewReport- 35, // 27: bytebase.v1.PlanCheckRun.Result.SqlSummaryReport.changed_resources:type_name -> bytebase.v1.ChangedResources- 36, // 28: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.start_position:type_name -> bytebase.v1.Position- 36, // 29: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.end_position:type_name -> bytebase.v1.Position- 4, // 30: bytebase.v1.PlanService.GetPlan:input_type -> bytebase.v1.GetPlanRequest- 5, // 31: bytebase.v1.PlanService.ListPlans:input_type -> bytebase.v1.ListPlansRequest- 7, // 32: bytebase.v1.PlanService.SearchPlans:input_type -> bytebase.v1.SearchPlansRequest- 9, // 33: bytebase.v1.PlanService.CreatePlan:input_type -> bytebase.v1.CreatePlanRequest- 10, // 34: bytebase.v1.PlanService.UpdatePlan:input_type -> bytebase.v1.UpdatePlanRequest- 12, // 35: bytebase.v1.PlanService.ListPlanCheckRuns:input_type -> bytebase.v1.ListPlanCheckRunsRequest- 14, // 36: bytebase.v1.PlanService.RunPlanChecks:input_type -> bytebase.v1.RunPlanChecksRequest- 16, // 37: bytebase.v1.PlanService.BatchCancelPlanCheckRuns:input_type -> bytebase.v1.BatchCancelPlanCheckRunsRequest- 11, // 38: bytebase.v1.PlanService.GetPlan:output_type -> bytebase.v1.Plan- 6, // 39: bytebase.v1.PlanService.ListPlans:output_type -> bytebase.v1.ListPlansResponse- 8, // 40: bytebase.v1.PlanService.SearchPlans:output_type -> bytebase.v1.SearchPlansResponse- 11, // 41: bytebase.v1.PlanService.CreatePlan:output_type -> bytebase.v1.Plan- 11, // 42: bytebase.v1.PlanService.UpdatePlan:output_type -> bytebase.v1.Plan- 13, // 43: bytebase.v1.PlanService.ListPlanCheckRuns:output_type -> bytebase.v1.ListPlanCheckRunsResponse- 15, // 44: bytebase.v1.PlanService.RunPlanChecks:output_type -> bytebase.v1.RunPlanChecksResponse- 17, // 45: bytebase.v1.PlanService.BatchCancelPlanCheckRuns:output_type -> bytebase.v1.BatchCancelPlanCheckRunsResponse- 38, // [38:46] is the sub-list for method output_type- 30, // [30:38] is the sub-list for method input_type- 30, // [30:30] is the sub-list for extension type_name- 30, // [30:30] is the sub-list for extension extendee- 0, // [0:30] is the sub-list for field type_name+ 33, // 21: bytebase.v1.Plan.ExportDataConfig.format:type_name -> bytebase.v1.ExportFormat+ 27, // 22: bytebase.v1.Plan.Deployment.database_group_mappings:type_name -> bytebase.v1.Plan.Deployment.DatabaseGroupMapping+ 3, // 23: bytebase.v1.PlanCheckRun.Result.status:type_name -> bytebase.v1.PlanCheckRun.Result.Status+ 29, // 24: bytebase.v1.PlanCheckRun.Result.sql_summary_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlSummaryReport+ 30, // 25: bytebase.v1.PlanCheckRun.Result.sql_review_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlReviewReport+ 34, // 26: bytebase.v1.PlanCheckRun.Result.SqlSummaryReport.changed_resources:type_name -> bytebase.v1.ChangedResources+ 35, // 27: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.start_position:type_name -> bytebase.v1.Position+ 35, // 28: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.end_position:type_name -> bytebase.v1.Position+ 4, // 29: bytebase.v1.PlanService.GetPlan:input_type -> bytebase.v1.GetPlanRequest+ 5, // 30: bytebase.v1.PlanService.ListPlans:input_type -> bytebase.v1.ListPlansRequest+ 7, // 31: bytebase.v1.PlanService.SearchPlans:input_type -> bytebase.v1.SearchPlansRequest+ 9, // 32: bytebase.v1.PlanService.CreatePlan:input_type -> bytebase.v1.CreatePlanRequest+ 10, // 33: bytebase.v1.PlanService.UpdatePlan:input_type -> bytebase.v1.UpdatePlanRequest+ 12, // 34: bytebase.v1.PlanService.ListPlanCheckRuns:input_type -> bytebase.v1.ListPlanCheckRunsRequest+ 14, // 35: bytebase.v1.PlanService.RunPlanChecks:input_type -> bytebase.v1.RunPlanChecksRequest+ 16, // 36: bytebase.v1.PlanService.BatchCancelPlanCheckRuns:input_type -> bytebase.v1.BatchCancelPlanCheckRunsRequest+ 11, // 37: bytebase.v1.PlanService.GetPlan:output_type -> bytebase.v1.Plan+ 6, // 38: bytebase.v1.PlanService.ListPlans:output_type -> bytebase.v1.ListPlansResponse+ 8, // 39: bytebase.v1.PlanService.SearchPlans:output_type -> bytebase.v1.SearchPlansResponse+ 11, // 40: bytebase.v1.PlanService.CreatePlan:output_type -> bytebase.v1.Plan+ 11, // 41: bytebase.v1.PlanService.UpdatePlan:output_type -> bytebase.v1.Plan+ 13, // 42: bytebase.v1.PlanService.ListPlanCheckRuns:output_type -> bytebase.v1.ListPlanCheckRunsResponse+ 15, // 43: bytebase.v1.PlanService.RunPlanChecks:output_type -> bytebase.v1.RunPlanChecksResponse+ 17, // 44: bytebase.v1.PlanService.BatchCancelPlanCheckRuns:output_type -> bytebase.v1.BatchCancelPlanCheckRunsResponse+ 37, // [37:45] is the sub-list for method output_type+ 29, // [29:37] is the sub-list for method input_type+ 29, // [29:29] is the sub-list for extension type_name+ 29, // [29:29] is the sub-list for extension extendee+ 0, // [0:29] is the sub-list for field type_name}func init() { file_v1_plan_service_proto_init() }@@ -2368,9 +2317,8 @@ func file_v1_plan_service_proto_init() {(*Plan_Spec_ChangeDatabaseConfig)(nil),(*Plan_Spec_ExportDataConfig)(nil),}- file_v1_plan_service_proto_msgTypes[19].OneofWrappers = []any{}file_v1_plan_service_proto_msgTypes[20].OneofWrappers = []any{}- file_v1_plan_service_proto_msgTypes[25].OneofWrappers = []any{+ file_v1_plan_service_proto_msgTypes[24].OneofWrappers = []any{(*PlanCheckRun_Result_SqlSummaryReport_)(nil),(*PlanCheckRun_Result_SqlReviewReport_)(nil),}@@ -2380,7 +2328,7 @@ func file_v1_plan_service_proto_init() {GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_plan_service_proto_rawDesc), len(file_v1_plan_service_proto_rawDesc)),NumEnums: 4,- NumMessages: 28,+ NumMessages: 27,NumExtensions: 0,NumServices: 1,},diff --git a/proto/store/store/plan.proto b/proto/store/store/plan.protoindex 2f694eeab3..830bf5adf1 100644--- a/proto/store/store/plan.proto+++ b/proto/store/store/plan.proto@@ -4,7 +4,6 @@ package bytebase.store;import "google/api/field_behavior.proto";import "store/common.proto";-import "store/plan_check_run.proto";option go_package = "generated-go/store";@@ -74,7 +73,7 @@ message PlanConfig {map<string, string> ghost_flags = 7;// If set, a backup of the modified data will be created automatically before any changes are applied.- optional PreUpdateBackupDetail pre_update_backup_detail = 8;+ bool enable_prior_backup = 8;}message ExportDataConfig {diff --git a/proto/store/store/plan_check_run.proto b/proto/store/store/plan_check_run.protoindex 11cc5bce27..a3e585e1d6 100644--- a/proto/store/store/plan_check_run.proto+++ b/proto/store/store/plan_check_run.proto@@ -7,12 +7,6 @@ import "store/common.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;@@ -23,7 +17,7 @@ message PlanCheckRunConfig {map<string, string> ghost_flags = 6;// If set, a backup of the modified data will be created automatically before any changes are applied.- optional PreUpdateBackupDetail pre_update_backup_detail = 7;+ bool enable_prior_backup = 7;enum ChangeDatabaseType {CHANGE_DATABASE_TYPE_UNSPECIFIED = 0;diff --git a/proto/store/store/task.proto b/proto/store/store/task.protoindex 1882771519..a9f1a3cacf 100644--- a/proto/store/store/task.proto+++ b/proto/store/store/task.proto@@ -3,7 +3,6 @@ syntax = "proto3";package bytebase.store;import "store/common.proto";-import "store/plan_check_run.proto";option go_package = "generated-go/store";@@ -23,7 +22,7 @@ message TaskPayload {// Update database fields.string schema_version = 10;- PreUpdateBackupDetail pre_update_backup_detail = 11;+ bool enable_prior_backup = 11;// ghost flags.map<string, string> flags = 12;TaskReleaseSource task_release_source = 13;diff --git a/proto/v1/v1/plan_service.proto b/proto/v1/v1/plan_service.protoindex 5d0ee42f94..714e5f26b8 100644--- a/proto/v1/v1/plan_service.proto+++ b/proto/v1/v1/plan_service.proto@@ -307,13 +307,8 @@ message Plan {map<string, string> ghost_flags = 7;- 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 = 8;+ bool enable_prior_backup = 8;}message ExportDataConfig {