Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: update ghost directive comments to clarify merge behavior (#19091)
boojack8ccd33832304
diff --git a/action/command/file.go b/action/command/file.goindex fba80f0d4d..467547c18c 100644--- a/action/command/file.go+++ b/action/command/file.go@@ -47,10 +47,9 @@ func getReleaseFiles(w *world.World) ([]*v1pb.Release_File, error) {return []*v1pb.Release_File{{// use file pattern as the path- Path: w.FilePattern,- Version: w.CurrentTime.Format(versionFormat),- EnableGhost: false,- Statement: contents,+ Path: w.FilePattern,+ Version: w.CurrentTime.Format(versionFormat),+ Statement: contents,},}, nil}@@ -62,10 +61,9 @@ func getReleaseFiles(w *world.World) ([]*v1pb.Release_File, error) {return nil, err}files = append(files, &v1pb.Release_File{- Path: m,- Version: w.CurrentTime.Format(versionFormat),- EnableGhost: false,- Statement: content,+ Path: m,+ Version: w.CurrentTime.Format(versionFormat),+ Statement: content,})}return files, nil@@ -80,9 +78,6 @@ func getReleaseFiles(w *world.World) ([]*v1pb.Release_File, error) {base := strings.TrimSuffix(filepath.Base(m), filepath.Ext(m))- // Extract migration type from SQL front matter comments- t := extractMigrationTypeFromContent(string(content))-version := extractVersion(base)if version == "" {w.Logger.Warn("version not found. ignore the file", "file", m)@@ -90,10 +85,9 @@ func getReleaseFiles(w *world.World) ([]*v1pb.Release_File, error) {}files = append(files, &v1pb.Release_File{- Path: m,- Version: version,- EnableGhost: t,- Statement: content,+ Path: m,+ Version: version,+ Statement: content,})}@@ -112,29 +106,3 @@ func extractVersion(s string) string {// Return the first capture group which contains just the version numbersreturn matches[1]}--var migrationTypeReg = regexp.MustCompile(`(?i)^--\s*migration-type:\s*(\w+)`)--// extractMigrationTypeFromContent extracts enable_ghost setting from SQL front matter comments.-// Returns true if "-- migration-type: ghost" is found.-// Example:-//-// -- migration-type: ghost-// ALTER TABLE ...-func extractMigrationTypeFromContent(content string) bool {- lines := strings.Split(content, "\n")- for _, line := range lines {- line = strings.TrimSpace(line)- // Stop at first non-comment line- if line != "" && !strings.HasPrefix(line, "--") {- break- }- matches := migrationTypeReg.FindStringSubmatch(line)- if len(matches) >= 2 {- if strings.ToLower(matches[1]) == "ghost" {- return true- }- }- }- return false-}diff --git a/action/command/file_test.go b/action/command/file_test.goindex fbec743f4e..c235ff66ac 100644--- a/action/command/file_test.go+++ b/action/command/file_test.go@@ -96,101 +96,3 @@ func TestExtractVersion(t *testing.T) {})}}--func TestExtractMigrationTypeFromContent(t *testing.T) {- tests := []struct {- name string- content string- enableGhost bool- }{- {- name: "ghost type",- content: `-- migration-type: ghost-ALTER TABLE large_table ADD COLUMN new_col VARCHAR(255);`,- enableGhost: true,- },- {- name: "case insensitive Ghost",- content: `-- migration-type: Ghost-ALTER TABLE large_table ADD COLUMN new_col VARCHAR(255);`,- enableGhost: true,- },- {- name: "case insensitive GHOST",- content: `-- migration-type: GHOST-ALTER TABLE large_table ADD COLUMN new_col VARCHAR(255);`,- enableGhost: true,- },- {- name: "with extra spaces",- content: `-- migration-type: ghost-ALTER TABLE large_table ADD COLUMN new_col VARCHAR(255);`,- enableGhost: true,- },- {- name: "with multiple comment lines",- content: `-- This is a migration file--- Author: John Doe--- migration-type: ghost--- Date: 2024-01-01--ALTER TABLE large_table ADD COLUMN new_col VARCHAR(255);`,- enableGhost: true,- },- {- name: "no migration type specified",- content: `-- This is a migration file-ALTER TABLE users ADD COLUMN age INT;`,- enableGhost: false,- },- {- name: "ddl type - should not enable ghost",- content: `-- migration-type: ddl-ALTER TABLE users ADD COLUMN age INT;`,- enableGhost: false,- },- {- name: "dml type - should not enable ghost",- content: `-- migration-type: dml-UPDATE users SET active = true;`,- enableGhost: false,- },- {- name: "migration type after SQL statement",- content: `ALTER TABLE users ADD COLUMN age INT;--- migration-type: ghost`,- enableGhost: false,- },- {- name: "invalid migration type",- content: `-- migration-type: invalid-ALTER TABLE users ADD COLUMN age INT;`,- enableGhost: false,- },- {- name: "empty content",- content: ``,- enableGhost: false,- },- {- name: "only comments with ghost",- content: `-- migration-type: ghost--- More comments`,- enableGhost: true,- },- {- name: "with blank lines before statement",- content: `-- migration-type: ghost--ALTER TABLE users ADD COLUMN age INT;`,- enableGhost: true,- },- }-- for _, tt := range tests {- t.Run(tt.name, func(t *testing.T) {- result := extractMigrationTypeFromContent(tt.content)- require.Equal(t, tt.enableGhost, result)- })- }-}diff --git a/backend/api/mcp/gen/openapi.yaml b/backend/api/mcp/gen/openapi.yamlindex beefc9f6e6..7f2a5ec101 100644--- a/backend/api/mcp/gen/openapi.yaml+++ b/backend/api/mcp/gen/openapi.yaml@@ -13230,33 +13230,12 @@ components:description: |-The resource name of the release.Format: projects/{project}/releases/{release}- ghostFlags:- type: object- title: ghost_flags- additionalProperties:- type: string- title: valueenablePriorBackup:type: booleantitle: enable_prior_backupdescription: If set, a backup of the modified data will be created automatically before any changes are applied.- enableGhost:- type: boolean- title: enable_ghost- description: Whether to use gh-ost for online schema migration.title: ChangeDatabaseConfigadditionalProperties: false- bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry:- type: object- properties:- key:- type: string- title: key- value:- type: string- title: value- title: GhostFlagsEntry- additionalProperties: falsebytebase.v1.Plan.CreateDatabaseConfig:type: objectproperties:@@ -14423,10 +14402,6 @@ components:type: stringtitle: versiondescription: The version identifier for the file.- enableGhost:- type: boolean- title: enable_ghost- description: Whether to use gh-ost for online schema migration.sheet:type: stringtitle: sheetdiff --git a/backend/api/v1/plan_service.go b/backend/api/v1/plan_service.goindex c3feed14d7..3bea2d586f 100644--- a/backend/api/v1/plan_service.go+++ b/backend/api/v1/plan_service.go@@ -193,7 +193,7 @@ func (s *PlanService) CreatePlan(ctx context.Context, request *connect.Request[vreturn nil, connect.NewError(connect.CodeInternal, errors.Wrapf(err, "failed to create plan"))}- planCheckRun, err := getPlanCheckRunFromPlan(project, plan, databaseGroup)+ planCheckRun, err := getPlanCheckRunFromPlan(ctx, s.store, project, plan, databaseGroup)if err != nil {return nil, connect.NewError(connect.CodeInternal, errors.Wrapf(err, "failed to get plan check run for plan"))}@@ -362,7 +362,7 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *connect.Request[v}if planCheckRunsTrigger {- planCheckRun, err := getPlanCheckRunFromPlan(project, updatedPlan, databaseGroup)+ planCheckRun, err := getPlanCheckRunFromPlan(ctx, s.store, project, updatedPlan, databaseGroup)if err != nil {return nil, connect.NewError(connect.CodeInternal, errors.Wrapf(err, "failed to get plan check run for plan"))}@@ -449,7 +449,7 @@ func (s *PlanService) RunPlanChecks(ctx context.Context, request *connect.Reques}}}- planCheckRun, err := getPlanCheckRunFromPlan(project, plan, databaseGroup)+ planCheckRun, err := getPlanCheckRunFromPlan(ctx, s.store, project, plan, databaseGroup)if err != nil {return nil, connect.NewError(connect.CodeInternal, errors.Wrapf(err, "failed to get plan check run for plan"))}@@ -736,8 +736,8 @@ func storePlanConfigHasCreateDatabase(plan *storepb.PlanConfig) bool {// Converters section - ordered with callers before callees.// getPlanCheckRunFromPlan returns the plan check run for a plan.-func getPlanCheckRunFromPlan(project *store.ProjectMessage, plan *store.PlanMessage, databaseGroup *v1pb.DatabaseGroup) (*store.PlanCheckRunMessage, error) {- targets, err := plancheck.DeriveCheckTargets(project, plan, databaseGroup)+func getPlanCheckRunFromPlan(ctx context.Context, s *store.Store, project *store.ProjectMessage, plan *store.PlanMessage, databaseGroup *v1pb.DatabaseGroup) (*store.PlanCheckRunMessage, error) {+ targets, err := plancheck.DeriveCheckTargets(ctx, s, project, plan, databaseGroup)if err != nil {return nil, err}@@ -877,9 +877,7 @@ func convertToPlanSpecChangeDatabaseConfig(projectID string, config *storepb.PlaTargets: c.Targets,Sheet: sheet,Release: c.Release,- GhostFlags: c.GhostFlags,EnablePriorBackup: c.EnablePriorBackup,- EnableGhost: c.EnableGhost,},}}@@ -958,9 +956,7 @@ func convertPlanSpecChangeDatabaseConfig(config *v1pb.Plan_Spec_ChangeDatabaseCoTargets: c.Targets,SheetSha256: sheetSha256,Release: c.Release,- GhostFlags: c.GhostFlags,EnablePriorBackup: c.EnablePriorBackup,- EnableGhost: c.EnableGhost,},}}diff --git a/backend/api/v1/release_service.go b/backend/api/v1/release_service.goindex 9b71e4d953..91cd95d6ae 100644--- a/backend/api/v1/release_service.go+++ b/backend/api/v1/release_service.go@@ -150,7 +150,6 @@ func (s *ReleaseService) CreateRelease(ctx context.Context, req *connect.RequestPath: f.Path,SheetSha256: sheetSha256s[i],Version: f.Version,- EnableGhost: f.EnableGhost,})}@@ -332,7 +331,6 @@ func convertToRelease(release *store.ReleaseMessage) *v1pb.Release {Sheet: common.FormatSheet(release.ProjectID, f.SheetSha256),SheetSha256: f.SheetSha256,Version: f.Version,- EnableGhost: f.EnableGhost,})}return rdiff --git a/backend/api/v1/rollout_service_task.go b/backend/api/v1/rollout_service_task.goindex 91bfd9ac52..3ad12e3e39 100644--- a/backend/api/v1/rollout_service_task.go+++ b/backend/api/v1/rollout_service_task.go@@ -211,13 +211,22 @@ func getTaskCreatesFromChangeDatabaseConfig(}}- // Add ghost flags if specified- if c.EnableGhost {- if _, err := ghost.GetUserFlags(c.GhostFlags); err != nil {- return nil, errors.Wrapf(err, "invalid ghost flags %q", c.GhostFlags)+ // Validate ghost directive at task creation time (parsed at execution time)+ if c.SheetSha256 != "" {+ sheetContent, err := getSheetContentBySha256(ctx, s, c.SheetSha256)+ if err != nil {+ return nil, errors.Wrapf(err, "failed to get sheet content")+ }++ if ghost.IsGhostEnabled(sheetContent) {+ ghostFlags, err := ghost.ParseGhostDirective(sheetContent)+ if err != nil {+ return nil, errors.Wrapf(err, "failed to parse ghost directive")+ }+ if _, err := ghost.GetUserFlags(ghostFlags); err != nil {+ return nil, errors.Wrapf(err, "invalid ghost flags %q", ghostFlags)+ }}- payload.Flags = c.GhostFlags- payload.EnableGhost = c.EnableGhost}taskCreate := &store.TaskMessage{@@ -435,3 +444,14 @@ func getCreateDatabaseStatement(dbType storepb.Engine, c *storepb.PlanConfig_Crereturn "", errors.Errorf("unsupported database type %s", dbType)}}++func getSheetContentBySha256(ctx context.Context, s *store.Store, sha256 string) (string, error) {+ sheet, err := s.GetSheetFull(ctx, sha256)+ if err != nil {+ return "", err+ }+ if sheet == nil {+ return "", errors.Errorf("sheet not found for sha256: %s", sha256)+ }+ return sheet.Statement, nil+}diff --git a/backend/component/ghost/directive.go b/backend/component/ghost/directive.gonew file mode 100644index 0000000000..e77230aa85--- /dev/null+++ b/backend/component/ghost/directive.go@@ -0,0 +1,44 @@+package ghost++import (+ "encoding/json"+ "regexp"+ "strings"+)++// ghostDirectiveRegex matches: -- gh-ost = {"key":"value",...} or -- gh-ost = {} /*comment*/+// Captures the JSON object, allows optional trailing /* comment */+var ghostDirectiveRegex = regexp.MustCompile(`(?im)^\s*--\s*gh-ost\s*=\s*(\{[^}]*\})\s*(?:/\*.*\*/)?\s*$`)++// ParseGhostDirective extracts ghost configuration from sheet content.+// Returns nil if no ghost directive is found.+func ParseGhostDirective(content string) (map[string]string, error) {+ match := ghostDirectiveRegex.FindStringSubmatch(content)+ if len(match) < 2 {+ return nil, nil+ }++ var flags map[string]string+ if err := json.Unmarshal([]byte(match[1]), &flags); err != nil {+ return nil, err+ }++ return flags, nil+}++// IsGhostEnabled checks if ghost is enabled by checking for directive presence.+func IsGhostEnabled(content string) bool {+ return ghostDirectiveRegex.MatchString(content)+}++// RemoveGhostDirective removes the ghost directive from sheet content.+func RemoveGhostDirective(content string) string {+ lines := strings.Split(content, "\n")+ var result []string+ for _, line := range lines {+ if !ghostDirectiveRegex.MatchString(line) {+ result = append(result, line)+ }+ }+ return strings.TrimSpace(strings.Join(result, "\n"))+}diff --git a/backend/component/ghost/directive_test.go b/backend/component/ghost/directive_test.gonew file mode 100644index 0000000000..01a92da920--- /dev/null+++ b/backend/component/ghost/directive_test.go@@ -0,0 +1,161 @@+package ghost++import (+ "testing"++ "github.com/stretchr/testify/require"+)++func TestParseGhostDirective(t *testing.T) {+ tests := []struct {+ name string+ content string+ want map[string]string+ wantErr bool+ }{+ {+ name: "no directive",+ content: "ALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: nil,+ },+ {+ name: "empty flags",+ content: "-- gh-ost = {}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: map[string]string{},+ },+ {+ name: "single flag",+ content: "-- gh-ost = {\"max-lag-millis\":\"1500\"}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: map[string]string{"max-lag-millis": "1500"},+ },+ {+ name: "multiple flags",+ content: "-- gh-ost = {\"max-lag-millis\":\"1500\",\"cut-over-lock-timeout-seconds\":\"10\"}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: map[string]string{"max-lag-millis": "1500", "cut-over-lock-timeout-seconds": "10"},+ },+ {+ name: "with other directives",+ content: "-- txn-mode = on\n-- gh-ost = {\"max-lag-millis\":\"1500\"}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: map[string]string{"max-lag-millis": "1500"},+ },+ {+ name: "case insensitive",+ content: "-- GH-OST = {\"max-lag-millis\":\"1500\"}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: map[string]string{"max-lag-millis": "1500"},+ },+ {+ name: "with spaces around equals",+ content: "-- gh-ost = {\"max-lag-millis\":\"1500\"}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: map[string]string{"max-lag-millis": "1500"},+ },+ {+ name: "invalid json",+ content: "-- gh-ost = {invalid}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ wantErr: true,+ },+ {+ name: "empty flags with comment",+ content: "-- gh-ost = {} /*default config*/\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: map[string]string{},+ },+ {+ name: "empty flags with new default comment",+ content: "-- gh-ost = {} /* using default config */\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: map[string]string{},+ },+ {+ name: "with flags and comment",+ content: "-- gh-ost = {\"max-lag-millis\":\"1500\"} /*custom config*/\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: map[string]string{"max-lag-millis": "1500"},+ },+ {+ name: "with flags and new merge comment",+ content: "-- gh-ost = {\"max-lag-millis\":\"1500\"} /* merges with default config */\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: map[string]string{"max-lag-millis": "1500"},+ },+ }++ for _, tt := range tests {+ t.Run(tt.name, func(t *testing.T) {+ got, err := ParseGhostDirective(tt.content)+ if tt.wantErr {+ require.Error(t, err)+ return+ }+ require.NoError(t, err)+ require.Equal(t, tt.want, got)+ })+ }+}++func TestIsGhostEnabled(t *testing.T) {+ tests := []struct {+ name string+ content string+ want bool+ }{+ {+ name: "no directive",+ content: "ALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: false,+ },+ {+ name: "with directive",+ content: "-- gh-ost = {}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: true,+ },+ {+ name: "with flags",+ content: "-- gh-ost = {\"max-lag-millis\":\"1500\"}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: true,+ },+ {+ name: "with comment",+ content: "-- gh-ost = {} /*default config*/\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: true,+ },+ }++ for _, tt := range tests {+ t.Run(tt.name, func(t *testing.T) {+ got := IsGhostEnabled(tt.content)+ require.Equal(t, tt.want, got)+ })+ }+}++func TestRemoveGhostDirective(t *testing.T) {+ tests := []struct {+ name string+ content string+ want string+ }{+ {+ name: "no directive",+ content: "ALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: "ALTER TABLE users ADD COLUMN status VARCHAR(50);",+ },+ {+ name: "with directive",+ content: "-- gh-ost = {\"max-lag-millis\":\"1500\"}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: "ALTER TABLE users ADD COLUMN status VARCHAR(50);",+ },+ {+ name: "with other directives",+ content: "-- txn-mode = on\n-- gh-ost = {\"max-lag-millis\":\"1500\"}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: "-- txn-mode = on\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ },+ {+ name: "with comment",+ content: "-- gh-ost = {} /*default config*/\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: "ALTER TABLE users ADD COLUMN status VARCHAR(50);",+ },+ }++ for _, tt := range tests {+ t.Run(tt.name, func(t *testing.T) {+ got := RemoveGhostDirective(tt.content)+ require.Equal(t, tt.want, got)+ })+ }+}diff --git a/backend/generated-go/store/plan.pb.go b/backend/generated-go/store/plan.pb.goindex 2d9215aebb..fc58cb92e0 100644--- a/backend/generated-go/store/plan.pb.go+++ b/backend/generated-go/store/plan.pb.go@@ -303,14 +303,11 @@ type PlanConfig_ChangeDatabaseConfig struct {SheetSha256 string `protobuf:"bytes,2,opt,name=sheet_sha256,json=sheetSha256,proto3" json:"sheet_sha256,omitempty"`// The resource name of the release.// Format: projects/{project}/releases/{release}- Release string `protobuf:"bytes,9,opt,name=release,proto3" json:"release,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"`+ Release string `protobuf:"bytes,9,opt,name=release,proto3" json:"release,omitempty"`// If set, a backup of the modified data will be created automatically before any changes are applied.EnablePriorBackup bool `protobuf:"varint,8,opt,name=enable_prior_backup,json=enablePriorBackup,proto3" json:"enable_prior_backup,omitempty"`- // Whether to use gh-ost for online schema migration.- EnableGhost bool `protobuf:"varint,12,opt,name=enable_ghost,json=enableGhost,proto3" json:"enable_ghost,omitempty"`- unknownFields protoimpl.UnknownFields- sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields+ sizeCache protoimpl.SizeCache}func (x *PlanConfig_ChangeDatabaseConfig) Reset() {@@ -364,13 +361,6 @@ func (x *PlanConfig_ChangeDatabaseConfig) GetRelease() string {return ""}-func (x *PlanConfig_ChangeDatabaseConfig) GetGhostFlags() map[string]string {- if x != nil {- return x.GhostFlags- }- return nil-}-func (x *PlanConfig_ChangeDatabaseConfig) GetEnablePriorBackup() bool {if x != nil {return x.EnablePriorBackup@@ -378,13 +368,6 @@ func (x *PlanConfig_ChangeDatabaseConfig) GetEnablePriorBackup() bool {return false}-func (x *PlanConfig_ChangeDatabaseConfig) GetEnableGhost() bool {- if x != nil {- return x.EnableGhost- }- return false-}-type PlanConfig_ExportDataConfig struct {state protoimpl.MessageState `protogen:"open.v1"`// The list of targets.@@ -464,7 +447,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\"\xf0\t\n" ++ "\x10store/plan.proto\x12\x0ebytebase.store\x1a\x1fgoogle/api/field_behavior.proto\x1a\x12store/common.proto\"\xac\b\n" +"\n" +"PlanConfig\x125\n" +"\x05specs\x18\x01 \x03(\v2\x1f.bytebase.store.PlanConfig.SpecR\x05specs\x12\x1f\n" +@@ -484,19 +467,13 @@ const file_store_plan_proto_rawDesc = "" +"\tcollation\x18\x05 \x01(\tB\x03\xe0A\x01R\tcollation\x12\x1d\n" +"\acluster\x18\x06 \x01(\tB\x03\xe0A\x01R\acluster\x12\x19\n" +"\x05owner\x18\a \x01(\tB\x03\xe0A\x01R\x05owner\x12%\n" +- "\venvironment\x18\t \x01(\tB\x03\xe0A\x01R\venvironment\x1a\xe1\x02\n" ++ "\venvironment\x18\t \x01(\tB\x03\xe0A\x01R\venvironment\x1a\x9d\x01\n" +"\x14ChangeDatabaseConfig\x12\x18\n" +"\atargets\x18\n" +" \x03(\tR\atargets\x12!\n" +"\fsheet_sha256\x18\x02 \x01(\tR\vsheetSha256\x12\x18\n" +- "\arelease\x18\t \x01(\tR\arelease\x12`\n" +- "\vghost_flags\x18\a \x03(\v2?.bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntryR\n" +- "ghostFlags\x12.\n" +- "\x13enable_prior_backup\x18\b \x01(\bR\x11enablePriorBackup\x12!\n" +- "\fenable_ghost\x18\f \x01(\bR\venableGhost\x1a=\n" +- "\x0fGhostFlagsEntry\x12\x10\n" +- "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +- "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a\xb3\x01\n" ++ "\arelease\x18\t \x01(\tR\arelease\x12.\n" ++ "\x13enable_prior_backup\x18\b \x01(\bR\x11enablePriorBackup\x1a\xb3\x01\n" +"\x10ExportDataConfig\x12\x18\n" +"\atargets\x18\x05 \x03(\tR\atargets\x12!\n" +"\fsheet_sha256\x18\x02 \x01(\tR\vsheetSha256\x124\n" +@@ -517,28 +494,26 @@ func file_store_plan_proto_rawDescGZIP() []byte {return file_store_plan_proto_rawDescData}-var file_store_plan_proto_msgTypes = make([]protoimpl.MessageInfo, 6)+var file_store_plan_proto_msgTypes = make([]protoimpl.MessageInfo, 5)var file_store_plan_proto_goTypes = []any{(*PlanConfig)(nil), // 0: bytebase.store.PlanConfig(*PlanConfig_Spec)(nil), // 1: bytebase.store.PlanConfig.Spec(*PlanConfig_CreateDatabaseConfig)(nil), // 2: bytebase.store.PlanConfig.CreateDatabaseConfig(*PlanConfig_ChangeDatabaseConfig)(nil), // 3: bytebase.store.PlanConfig.ChangeDatabaseConfig(*PlanConfig_ExportDataConfig)(nil), // 4: bytebase.store.PlanConfig.ExportDataConfig- nil, // 5: bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry- (ExportFormat)(0), // 6: bytebase.store.ExportFormat+ (ExportFormat)(0), // 5: bytebase.store.ExportFormat}var file_store_plan_proto_depIdxs = []int32{1, // 0: bytebase.store.PlanConfig.specs:type_name -> bytebase.store.PlanConfig.Spec2, // 1: bytebase.store.PlanConfig.Spec.create_database_config:type_name -> bytebase.store.PlanConfig.CreateDatabaseConfig3, // 2: bytebase.store.PlanConfig.Spec.change_database_config:type_name -> bytebase.store.PlanConfig.ChangeDatabaseConfig4, // 3: bytebase.store.PlanConfig.Spec.export_data_config:type_name -> bytebase.store.PlanConfig.ExportDataConfig- 5, // 4: bytebase.store.PlanConfig.ChangeDatabaseConfig.ghost_flags:type_name -> bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry- 6, // 5: bytebase.store.PlanConfig.ExportDataConfig.format:type_name -> bytebase.store.ExportFormat- 6, // [6:6] is the sub-list for method output_type- 6, // [6:6] is the sub-list for method input_type- 6, // [6:6] is the sub-list for extension type_name- 6, // [6:6] is the sub-list for extension extendee- 0, // [0:6] is the sub-list for field type_name+ 5, // 4: bytebase.store.PlanConfig.ExportDataConfig.format:type_name -> bytebase.store.ExportFormat+ 5, // [5:5] is the sub-list for method output_type+ 5, // [5:5] is the sub-list for method input_type+ 5, // [5:5] is the sub-list for extension type_name+ 5, // [5:5] is the sub-list for extension extendee+ 0, // [0:5] is the sub-list for field type_name}func init() { file_store_plan_proto_init() }@@ -559,7 +534,7 @@ func file_store_plan_proto_init() {GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: unsafe.Slice(unsafe.StringData(file_store_plan_proto_rawDesc), len(file_store_plan_proto_rawDesc)),NumEnums: 0,- NumMessages: 6,+ NumMessages: 5,NumExtensions: 0,NumServices: 0,},diff --git a/backend/generated-go/store/plan_equal.pb.go b/backend/generated-go/store/plan_equal.pb.goindex be49e995d4..411d959ef3 100644--- a/backend/generated-go/store/plan_equal.pb.go+++ b/backend/generated-go/store/plan_equal.pb.go@@ -80,24 +80,9 @@ func (x *PlanConfig_ChangeDatabaseConfig) Equal(y *PlanConfig_ChangeDatabaseConfif x.Release != y.Release {return false}- if len(x.GhostFlags) != len(y.GhostFlags) {- return false- }- for k := range x.GhostFlags {- _, ok := y.GhostFlags[k]- if !ok {- return false- }- if x.GhostFlags[k] != y.GhostFlags[k] {- return false- }- }if x.EnablePriorBackup != y.EnablePriorBackup {return false}- if x.EnableGhost != y.EnableGhost {- return false- }return true}diff --git a/backend/generated-go/store/release.pb.go b/backend/generated-go/store/release.pb.goindex ba656eb26c..e7152b5256 100644--- a/backend/generated-go/store/release.pb.go+++ b/backend/generated-go/store/release.pb.go@@ -86,10 +86,8 @@ type ReleasePayload_File struct {// The path of the file, e.g., `2.2/V0001_create_table.sql`.Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`// The SHA256 hash of the sheet content (hex-encoded).- SheetSha256 string `protobuf:"bytes,4,opt,name=sheet_sha256,json=sheetSha256,proto3" json:"sheet_sha256,omitempty"`- Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"`- // Whether to use gh-ost for online schema migration.- EnableGhost bool `protobuf:"varint,7,opt,name=enable_ghost,json=enableGhost,proto3" json:"enable_ghost,omitempty"`+ SheetSha256 string `protobuf:"bytes,4,opt,name=sheet_sha256,json=sheetSha256,proto3" json:"sheet_sha256,omitempty"`+ Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"`unknownFields protoimpl.UnknownFieldssizeCache protoimpl.SizeCache}@@ -145,13 +143,6 @@ func (x *ReleasePayload_File) GetVersion() string {return ""}-func (x *ReleasePayload_File) GetEnableGhost() bool {- if x != nil {- return x.EnableGhost- }- return false-}-type ReleasePayload_VCSSource struct {state protoimpl.MessageState `protogen:"open.v1"`VcsType VCSType `protobuf:"varint,1,opt,name=vcs_type,json=vcsType,proto3,enum=bytebase.store.VCSType" json:"vcs_type,omitempty"`@@ -208,17 +199,16 @@ var File_store_release_proto protoreflect.FileDescriptorconst file_store_release_proto_rawDesc = "" +"\n" +- "\x13store/release.proto\x12\x0ebytebase.store\x1a\x12store/common.proto\"\x99\x03\n" ++ "\x13store/release.proto\x12\x0ebytebase.store\x1a\x12store/common.proto\"\xf6\x02\n" +"\x0eReleasePayload\x129\n" +"\x05files\x18\x02 \x03(\v2#.bytebase.store.ReleasePayload.FileR\x05files\x12G\n" +"\n" +"vcs_source\x18\x03 \x01(\v2(.bytebase.store.ReleasePayload.VCSSourceR\tvcsSource\x124\n" +- "\x04type\x18\x04 \x01(\x0e2 .bytebase.store.SchemaChangeTypeR\x04type\x1az\n" ++ "\x04type\x18\x04 \x01(\x0e2 .bytebase.store.SchemaChangeTypeR\x04type\x1aW\n" +"\x04File\x12\x12\n" +"\x04path\x18\x02 \x01(\tR\x04path\x12!\n" +"\fsheet_sha256\x18\x04 \x01(\tR\vsheetSha256\x12\x18\n" +- "\aversion\x18\x06 \x01(\tR\aversion\x12!\n" +- "\fenable_ghost\x18\a \x01(\bR\venableGhost\x1aQ\n" ++ "\aversion\x18\x06 \x01(\tR\aversion\x1aQ\n" +"\tVCSSource\x122\n" +"\bvcs_type\x18\x01 \x01(\x0e2\x17.bytebase.store.VCSTypeR\avcsType\x12\x10\n" +"\x03url\x18\x02 \x01(\tR\x03urlB\x8f\x01\n" +diff --git a/backend/generated-go/store/release_equal.pb.go b/backend/generated-go/store/release_equal.pb.goindex a334fd5bef..dee5ba984e 100644--- a/backend/generated-go/store/release_equal.pb.go+++ b/backend/generated-go/store/release_equal.pb.go@@ -19,9 +19,6 @@ func (x *ReleasePayload_File) Equal(y *ReleasePayload_File) bool {if x.Version != y.Version {return false}- if x.EnableGhost != y.EnableGhost {- return false- }return true}diff --git a/backend/generated-go/store/task.pb.go b/backend/generated-go/store/task.pb.goindex eec764cf7c..9013b8d98f 100644--- a/backend/generated-go/store/task.pb.go+++ b/backend/generated-go/store/task.pb.go@@ -97,12 +97,8 @@ type Task struct {Source isTask_Source `protobuf_oneof:"source"`// Whether to create an automatic backup before applying changes.EnablePriorBackup bool `protobuf:"varint,11,opt,name=enable_prior_backup,json=enablePriorBackup,proto3" json:"enable_prior_backup,omitempty"`- // Configuration flags for gh-ost migration tool.- 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"`- // Whether to use gh-ost for online schema migration.- EnableGhost bool `protobuf:"varint,16,opt,name=enable_ghost,json=enableGhost,proto3" json:"enable_ghost,omitempty"`- unknownFields protoimpl.UnknownFields- sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields+ sizeCache protoimpl.SizeCache}func (x *Task) Reset() {@@ -188,20 +184,6 @@ func (x *Task) GetEnablePriorBackup() bool {return false}-func (x *Task) GetFlags() map[string]string {- if x != nil {- return x.Flags- }- return nil-}--func (x *Task) GetEnableGhost() bool {- if x != nil {- return x.EnableGhost- }- return false-}-type isTask_Source interface {isTask_Source()}@@ -226,7 +208,7 @@ var File_store_task_proto protoreflect.FileDescriptorconst file_store_task_proto_rawDesc = "" +"\n" +- "\x10store/task.proto\x12\x0ebytebase.store\"\xd2\x03\n" ++ "\x10store/task.proto\x12\x0ebytebase.store\"\xbe\x02\n" +"\x04Task\x12\x18\n" +"\askipped\x18\x01 \x01(\bR\askipped\x12%\n" +"\x0eskipped_reason\x18\x02 \x01(\tR\rskippedReason\x12\x17\n" +@@ -234,13 +216,7 @@ const file_store_task_proto_rawDesc = "" +"\fsheet_sha256\x18\n" +" \x01(\tH\x00R\vsheetSha256\x12\x1a\n" +"\arelease\x18\r \x01(\tH\x00R\arelease\x12.\n" +- "\x13enable_prior_backup\x18\v \x01(\bR\x11enablePriorBackup\x125\n" +- "\x05flags\x18\f \x03(\v2\x1f.bytebase.store.Task.FlagsEntryR\x05flags\x12!\n" +- "\fenable_ghost\x18\x10 \x01(\bR\venableGhost\x1a8\n" +- "\n" +- "FlagsEntry\x12\x10\n" +- "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +- "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"a\n" ++ "\x13enable_prior_backup\x18\v \x01(\bR\x11enablePriorBackup\"a\n" +"\x04Type\x12\x19\n" +"\x15TASK_TYPE_UNSPECIFIED\x10\x00\x12\x13\n" +"\x0fDATABASE_CREATE\x10\x01\x12\x14\n" +@@ -262,19 +238,17 @@ func file_store_task_proto_rawDescGZIP() []byte {}var file_store_task_proto_enumTypes = make([]protoimpl.EnumInfo, 1)-var file_store_task_proto_msgTypes = make([]protoimpl.MessageInfo, 2)+var file_store_task_proto_msgTypes = make([]protoimpl.MessageInfo, 1)var file_store_task_proto_goTypes = []any{(Task_Type)(0), // 0: bytebase.store.Task.Type(*Task)(nil), // 1: bytebase.store.Task- nil, // 2: bytebase.store.Task.FlagsEntry}var file_store_task_proto_depIdxs = []int32{- 2, // 0: bytebase.store.Task.flags:type_name -> bytebase.store.Task.FlagsEntry- 1, // [1:1] is the sub-list for method output_type- 1, // [1:1] is the sub-list for method input_type- 1, // [1:1] is the sub-list for extension type_name- 1, // [1:1] is the sub-list for extension extendee- 0, // [0:1] is the sub-list for field type_name+ 0, // [0:0] is the sub-list for method output_type+ 0, // [0:0] is the sub-list for method input_type+ 0, // [0:0] is the sub-list for extension type_name+ 0, // [0:0] is the sub-list for extension extendee+ 0, // [0:0] is the sub-list for field type_name}func init() { file_store_task_proto_init() }@@ -292,7 +266,7 @@ func file_store_task_proto_init() {GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: unsafe.Slice(unsafe.StringData(file_store_task_proto_rawDesc), len(file_store_task_proto_rawDesc)),NumEnums: 1,- NumMessages: 2,+ NumMessages: 1,NumExtensions: 0,NumServices: 0,},diff --git a/backend/generated-go/store/task_equal.pb.go b/backend/generated-go/store/task_equal.pb.goindex c55a0060be..e7d09a72cf 100644--- a/backend/generated-go/store/task_equal.pb.go+++ b/backend/generated-go/store/task_equal.pb.go@@ -28,20 +28,5 @@ func (x *Task) Equal(y *Task) bool {if x.EnablePriorBackup != y.EnablePriorBackup {return false}- if len(x.Flags) != len(y.Flags) {- return false- }- for k := range x.Flags {- _, ok := y.Flags[k]- if !ok {- return false- }- if x.Flags[k] != y.Flags[k] {- return false- }- }- if x.EnableGhost != y.EnableGhost {- return false- }return true}diff --git a/backend/generated-go/v1/plan_service.pb.go b/backend/generated-go/v1/plan_service.pb.goindex 3735f09160..e7a9c624bb 100644--- a/backend/generated-go/v1/plan_service.pb.go+++ b/backend/generated-go/v1/plan_service.pb.go@@ -1124,14 +1124,11 @@ type Plan_ChangeDatabaseConfig struct {Sheet string `protobuf:"bytes,2,opt,name=sheet,proto3" json:"sheet,omitempty"`// The resource name of the release.// Format: projects/{project}/releases/{release}- Release string `protobuf:"bytes,3,opt,name=release,proto3" json:"release,omitempty"`- GhostFlags map[string]string `protobuf:"bytes,5,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"`+ Release string `protobuf:"bytes,3,opt,name=release,proto3" json:"release,omitempty"`// If set, a backup of the modified data will be created automatically before any changes are applied.EnablePriorBackup bool `protobuf:"varint,6,opt,name=enable_prior_backup,json=enablePriorBackup,proto3" json:"enable_prior_backup,omitempty"`- // Whether to use gh-ost for online schema migration.- EnableGhost bool `protobuf:"varint,7,opt,name=enable_ghost,json=enableGhost,proto3" json:"enable_ghost,omitempty"`- unknownFields protoimpl.UnknownFields- sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields+ sizeCache protoimpl.SizeCache}func (x *Plan_ChangeDatabaseConfig) Reset() {@@ -1185,13 +1182,6 @@ func (x *Plan_ChangeDatabaseConfig) GetRelease() string {return ""}-func (x *Plan_ChangeDatabaseConfig) GetGhostFlags() map[string]string {- if x != nil {- return x.GhostFlags- }- return nil-}-func (x *Plan_ChangeDatabaseConfig) GetEnablePriorBackup() bool {if x != nil {return x.EnablePriorBackup@@ -1199,13 +1189,6 @@ func (x *Plan_ChangeDatabaseConfig) GetEnablePriorBackup() bool {return false}-func (x *Plan_ChangeDatabaseConfig) GetEnableGhost() bool {- if x != nil {- return x.EnableGhost- }- return false-}-type Plan_ExportDataConfig struct {state protoimpl.MessageState `protogen:"open.v1"`// The list of targets.@@ -1303,7 +1286,7 @@ type PlanCheckRun_Result struct {func (x *PlanCheckRun_Result) Reset() {*x = PlanCheckRun_Result{}- mi := &file_v1_plan_service_proto_msgTypes[18]+ mi := &file_v1_plan_service_proto_msgTypes[17]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1315,7 +1298,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[18]+ mi := &file_v1_plan_service_proto_msgTypes[17]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1425,7 +1408,7 @@ type PlanCheckRun_Result_SqlSummaryReport struct {func (x *PlanCheckRun_Result_SqlSummaryReport) Reset() {*x = PlanCheckRun_Result_SqlSummaryReport{}- mi := &file_v1_plan_service_proto_msgTypes[19]+ mi := &file_v1_plan_service_proto_msgTypes[18]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1437,7 +1420,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[19]+ mi := &file_v1_plan_service_proto_msgTypes[18]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1478,7 +1461,7 @@ type PlanCheckRun_Result_SqlReviewReport struct {func (x *PlanCheckRun_Result_SqlReviewReport) Reset() {*x = PlanCheckRun_Result_SqlReviewReport{}- mi := &file_v1_plan_service_proto_msgTypes[20]+ mi := &file_v1_plan_service_proto_msgTypes[19]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -1490,7 +1473,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[20]+ mi := &file_v1_plan_service_proto_msgTypes[19]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1546,7 +1529,7 @@ const file_v1_plan_service_proto_rawDesc = "" +"\x04plan\x18\x01 \x01(\v2\x11.bytebase.v1.PlanB\x03\xe0A\x02R\x04plan\x12@\n" +"\vupdate_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskB\x03\xe0A\x02R\n" +"updateMask\x12#\n" +- "\rallow_missing\x18\x03 \x01(\bR\fallowMissing\"\x80\x0e\n" ++ "\rallow_missing\x18\x03 \x01(\bR\fallowMissing\"\xc5\f\n" +"\x04Plan\x12\x12\n" +"\x04name\x18\x01 \x01(\tR\x04name\x12(\n" +"\x05state\x18\x02 \x01(\x0e2\x12.bytebase.v1.StateR\x05state\x12\x19\n" +@@ -1580,19 +1563,13 @@ const file_v1_plan_service_proto_rawDesc = "" +"\tcollation\x18\x05 \x01(\tB\x03\xe0A\x01R\tcollation\x12\x1d\n" +"\acluster\x18\x06 \x01(\tB\x03\xe0A\x01R\acluster\x12\x19\n" +"\x05owner\x18\a \x01(\tB\x03\xe0A\x01R\x05owner\x12%\n" +- "\venvironment\x18\t \x01(\tB\x03\xe0A\x01R\venvironment\x1a\xe6\x02\n" ++ "\venvironment\x18\t \x01(\tB\x03\xe0A\x01R\venvironment\x1a\xab\x01\n" +"\x14ChangeDatabaseConfig\x12\x18\n" +"\atargets\x18\x01 \x03(\tR\atargets\x12\x14\n" +"\x05sheet\x18\x02 \x01(\tR\x05sheet\x123\n" +"\arelease\x18\x03 \x01(\tB\x19\xfaA\x16\n" +- "\x14bytebase.com/ReleaseR\arelease\x12W\n" +- "\vghost_flags\x18\x05 \x03(\v26.bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntryR\n" +- "ghostFlags\x12.\n" +- "\x13enable_prior_backup\x18\x06 \x01(\bR\x11enablePriorBackup\x12!\n" +- "\fenable_ghost\x18\a \x01(\bR\venableGhost\x1a=\n" +- "\x0fGhostFlagsEntry\x12\x10\n" +- "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +- "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a\xa3\x01\n" ++ "\x14bytebase.com/ReleaseR\arelease\x12.\n" ++ "\x13enable_prior_backup\x18\x06 \x01(\bR\x11enablePriorBackup\x1a\xa3\x01\n" +"\x10ExportDataConfig\x12\x18\n" +"\atargets\x18\x01 \x03(\tR\atargets\x12\x14\n" +"\x05sheet\x18\x02 \x01(\tR\x05sheet\x121\n" +@@ -1676,7 +1653,7 @@ func file_v1_plan_service_proto_rawDescGZIP() []byte {}var file_v1_plan_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2)-var file_v1_plan_service_proto_msgTypes = make([]protoimpl.MessageInfo, 21)+var file_v1_plan_service_proto_msgTypes = make([]protoimpl.MessageInfo, 20)var file_v1_plan_service_proto_goTypes = []any{(PlanCheckRun_Status)(0), // 0: bytebase.v1.PlanCheckRun.Status(PlanCheckRun_Result_Type)(0), // 1: bytebase.v1.PlanCheckRun.Result.Type@@ -1697,62 +1674,60 @@ var file_v1_plan_service_proto_goTypes = []any{(*Plan_CreateDatabaseConfig)(nil), // 16: bytebase.v1.Plan.CreateDatabaseConfig(*Plan_ChangeDatabaseConfig)(nil), // 17: bytebase.v1.Plan.ChangeDatabaseConfig(*Plan_ExportDataConfig)(nil), // 18: bytebase.v1.Plan.ExportDataConfig- nil, // 19: bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry- (*PlanCheckRun_Result)(nil), // 20: bytebase.v1.PlanCheckRun.Result- (*PlanCheckRun_Result_SqlSummaryReport)(nil), // 21: bytebase.v1.PlanCheckRun.Result.SqlSummaryReport- (*PlanCheckRun_Result_SqlReviewReport)(nil), // 22: bytebase.v1.PlanCheckRun.Result.SqlReviewReport- (*fieldmaskpb.FieldMask)(nil), // 23: google.protobuf.FieldMask- (State)(0), // 24: bytebase.v1.State- (*timestamppb.Timestamp)(nil), // 25: google.protobuf.Timestamp- (ExportFormat)(0), // 26: bytebase.v1.ExportFormat- (Advice_Level)(0), // 27: bytebase.v1.Advice.Level- (StatementType)(0), // 28: bytebase.v1.StatementType- (*Position)(nil), // 29: bytebase.v1.Position+ (*PlanCheckRun_Result)(nil), // 19: bytebase.v1.PlanCheckRun.Result+ (*PlanCheckRun_Result_SqlSummaryReport)(nil), // 20: bytebase.v1.PlanCheckRun.Result.SqlSummaryReport+ (*PlanCheckRun_Result_SqlReviewReport)(nil), // 21: bytebase.v1.PlanCheckRun.Result.SqlReviewReport+ (*fieldmaskpb.FieldMask)(nil), // 22: google.protobuf.FieldMask+ (State)(0), // 23: bytebase.v1.State+ (*timestamppb.Timestamp)(nil), // 24: google.protobuf.Timestamp+ (ExportFormat)(0), // 25: bytebase.v1.ExportFormat+ (Advice_Level)(0), // 26: bytebase.v1.Advice.Level+ (StatementType)(0), // 27: bytebase.v1.StatementType+ (*Position)(nil), // 28: bytebase.v1.Position}var file_v1_plan_service_proto_depIdxs = []int32{7, // 0: bytebase.v1.ListPlansResponse.plans:type_name -> bytebase.v1.Plan7, // 1: bytebase.v1.CreatePlanRequest.plan:type_name -> bytebase.v1.Plan7, // 2: bytebase.v1.UpdatePlanRequest.plan:type_name -> bytebase.v1.Plan- 23, // 3: bytebase.v1.UpdatePlanRequest.update_mask:type_name -> google.protobuf.FieldMask- 24, // 4: bytebase.v1.Plan.state:type_name -> bytebase.v1.State+ 22, // 3: bytebase.v1.UpdatePlanRequest.update_mask:type_name -> google.protobuf.FieldMask+ 23, // 4: bytebase.v1.Plan.state:type_name -> bytebase.v1.State14, // 5: bytebase.v1.Plan.specs:type_name -> bytebase.v1.Plan.Spec- 25, // 6: bytebase.v1.Plan.create_time:type_name -> google.protobuf.Timestamp- 25, // 7: bytebase.v1.Plan.update_time:type_name -> google.protobuf.Timestamp+ 24, // 6: bytebase.v1.Plan.create_time:type_name -> google.protobuf.Timestamp+ 24, // 7: bytebase.v1.Plan.update_time:type_name -> google.protobuf.Timestamp15, // 8: bytebase.v1.Plan.plan_check_run_status_count:type_name -> bytebase.v1.Plan.PlanCheckRunStatusCountEntry0, // 9: bytebase.v1.PlanCheckRun.status:type_name -> bytebase.v1.PlanCheckRun.Status- 20, // 10: bytebase.v1.PlanCheckRun.results:type_name -> bytebase.v1.PlanCheckRun.Result- 25, // 11: bytebase.v1.PlanCheckRun.create_time:type_name -> google.protobuf.Timestamp+ 19, // 10: bytebase.v1.PlanCheckRun.results:type_name -> bytebase.v1.PlanCheckRun.Result+ 24, // 11: bytebase.v1.PlanCheckRun.create_time:type_name -> google.protobuf.Timestamp16, // 12: bytebase.v1.Plan.Spec.create_database_config:type_name -> bytebase.v1.Plan.CreateDatabaseConfig17, // 13: bytebase.v1.Plan.Spec.change_database_config:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig18, // 14: bytebase.v1.Plan.Spec.export_data_config:type_name -> bytebase.v1.Plan.ExportDataConfig- 19, // 15: bytebase.v1.Plan.ChangeDatabaseConfig.ghost_flags:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry- 26, // 16: bytebase.v1.Plan.ExportDataConfig.format:type_name -> bytebase.v1.ExportFormat- 27, // 17: bytebase.v1.PlanCheckRun.Result.status:type_name -> bytebase.v1.Advice.Level- 1, // 18: bytebase.v1.PlanCheckRun.Result.type:type_name -> bytebase.v1.PlanCheckRun.Result.Type- 21, // 19: bytebase.v1.PlanCheckRun.Result.sql_summary_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlSummaryReport- 22, // 20: bytebase.v1.PlanCheckRun.Result.sql_review_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlReviewReport- 28, // 21: bytebase.v1.PlanCheckRun.Result.SqlSummaryReport.statement_types:type_name -> bytebase.v1.StatementType- 29, // 22: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.start_position:type_name -> bytebase.v1.Position- 29, // 23: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.end_position:type_name -> bytebase.v1.Position- 2, // 24: bytebase.v1.PlanService.GetPlan:input_type -> bytebase.v1.GetPlanRequest- 3, // 25: bytebase.v1.PlanService.ListPlans:input_type -> bytebase.v1.ListPlansRequest- 5, // 26: bytebase.v1.PlanService.CreatePlan:input_type -> bytebase.v1.CreatePlanRequest- 6, // 27: bytebase.v1.PlanService.UpdatePlan:input_type -> bytebase.v1.UpdatePlanRequest- 8, // 28: bytebase.v1.PlanService.GetPlanCheckRun:input_type -> bytebase.v1.GetPlanCheckRunRequest- 9, // 29: bytebase.v1.PlanService.RunPlanChecks:input_type -> bytebase.v1.RunPlanChecksRequest- 11, // 30: bytebase.v1.PlanService.CancelPlanCheckRun:input_type -> bytebase.v1.CancelPlanCheckRunRequest- 7, // 31: bytebase.v1.PlanService.GetPlan:output_type -> bytebase.v1.Plan- 4, // 32: bytebase.v1.PlanService.ListPlans:output_type -> bytebase.v1.ListPlansResponse- 7, // 33: bytebase.v1.PlanService.CreatePlan:output_type -> bytebase.v1.Plan- 7, // 34: bytebase.v1.PlanService.UpdatePlan:output_type -> bytebase.v1.Plan- 13, // 35: bytebase.v1.PlanService.GetPlanCheckRun:output_type -> bytebase.v1.PlanCheckRun- 10, // 36: bytebase.v1.PlanService.RunPlanChecks:output_type -> bytebase.v1.RunPlanChecksResponse- 12, // 37: bytebase.v1.PlanService.CancelPlanCheckRun:output_type -> bytebase.v1.CancelPlanCheckRunResponse- 31, // [31:38] is the sub-list for method output_type- 24, // [24:31] is the sub-list for method input_type- 24, // [24:24] is the sub-list for extension type_name- 24, // [24:24] is the sub-list for extension extendee- 0, // [0:24] is the sub-list for field type_name+ 25, // 15: bytebase.v1.Plan.ExportDataConfig.format:type_name -> bytebase.v1.ExportFormat+ 26, // 16: bytebase.v1.PlanCheckRun.Result.status:type_name -> bytebase.v1.Advice.Level+ 1, // 17: bytebase.v1.PlanCheckRun.Result.type:type_name -> bytebase.v1.PlanCheckRun.Result.Type+ 20, // 18: bytebase.v1.PlanCheckRun.Result.sql_summary_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlSummaryReport+ 21, // 19: bytebase.v1.PlanCheckRun.Result.sql_review_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlReviewReport+ 27, // 20: bytebase.v1.PlanCheckRun.Result.SqlSummaryReport.statement_types:type_name -> bytebase.v1.StatementType+ 28, // 21: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.start_position:type_name -> bytebase.v1.Position+ 28, // 22: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.end_position:type_name -> bytebase.v1.Position+ 2, // 23: bytebase.v1.PlanService.GetPlan:input_type -> bytebase.v1.GetPlanRequest+ 3, // 24: bytebase.v1.PlanService.ListPlans:input_type -> bytebase.v1.ListPlansRequest+ 5, // 25: bytebase.v1.PlanService.CreatePlan:input_type -> bytebase.v1.CreatePlanRequest+ 6, // 26: bytebase.v1.PlanService.UpdatePlan:input_type -> bytebase.v1.UpdatePlanRequest+ 8, // 27: bytebase.v1.PlanService.GetPlanCheckRun:input_type -> bytebase.v1.GetPlanCheckRunRequest+ 9, // 28: bytebase.v1.PlanService.RunPlanChecks:input_type -> bytebase.v1.RunPlanChecksRequest+ 11, // 29: bytebase.v1.PlanService.CancelPlanCheckRun:input_type -> bytebase.v1.CancelPlanCheckRunRequest+ 7, // 30: bytebase.v1.PlanService.GetPlan:output_type -> bytebase.v1.Plan+ 4, // 31: bytebase.v1.PlanService.ListPlans:output_type -> bytebase.v1.ListPlansResponse+ 7, // 32: bytebase.v1.PlanService.CreatePlan:output_type -> bytebase.v1.Plan+ 7, // 33: bytebase.v1.PlanService.UpdatePlan:output_type -> bytebase.v1.Plan+ 13, // 34: bytebase.v1.PlanService.GetPlanCheckRun:output_type -> bytebase.v1.PlanCheckRun+ 10, // 35: bytebase.v1.PlanService.RunPlanChecks:output_type -> bytebase.v1.RunPlanChecksResponse+ 12, // 36: bytebase.v1.PlanService.CancelPlanCheckRun:output_type -> bytebase.v1.CancelPlanCheckRunResponse+ 30, // [30:37] is the sub-list for method output_type+ 23, // [23:30] is the sub-list for method input_type+ 23, // [23:23] is the sub-list for extension type_name+ 23, // [23:23] is the sub-list for extension extendee+ 0, // [0:23] is the sub-list for field type_name}func init() { file_v1_plan_service_proto_init() }@@ -1770,7 +1745,7 @@ func file_v1_plan_service_proto_init() {(*Plan_Spec_ExportDataConfig)(nil),}file_v1_plan_service_proto_msgTypes[16].OneofWrappers = []any{}- file_v1_plan_service_proto_msgTypes[18].OneofWrappers = []any{+ file_v1_plan_service_proto_msgTypes[17].OneofWrappers = []any{(*PlanCheckRun_Result_SqlSummaryReport_)(nil),(*PlanCheckRun_Result_SqlReviewReport_)(nil),}@@ -1780,7 +1755,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: 2,- NumMessages: 21,+ NumMessages: 20,NumExtensions: 0,NumServices: 1,},diff --git a/backend/generated-go/v1/plan_service_equal.pb.go b/backend/generated-go/v1/plan_service_equal.pb.goindex 8470e2a7bf..4bc51291a8 100644--- a/backend/generated-go/v1/plan_service_equal.pb.go+++ b/backend/generated-go/v1/plan_service_equal.pb.go@@ -180,24 +180,9 @@ func (x *Plan_ChangeDatabaseConfig) Equal(y *Plan_ChangeDatabaseConfig) bool {if x.Release != y.Release {return false}- if len(x.GhostFlags) != len(y.GhostFlags) {- return false- }- for k := range x.GhostFlags {- _, ok := y.GhostFlags[k]- if !ok {- return false- }- if x.GhostFlags[k] != y.GhostFlags[k] {- return false- }- }if x.EnablePriorBackup != y.EnablePriorBackup {return false}- if x.EnableGhost != y.EnableGhost {- return false- }return true}diff --git a/backend/generated-go/v1/release_service.pb.go b/backend/generated-go/v1/release_service.pb.goindex d5b6eea562..d501ac1b54 100644--- a/backend/generated-go/v1/release_service.pb.go+++ b/backend/generated-go/v1/release_service.pb.go@@ -925,8 +925,6 @@ type Release_File struct {Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`// The version identifier for the file.Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"`- // Whether to use gh-ost for online schema migration.- EnableGhost bool `protobuf:"varint,9,opt,name=enable_ghost,json=enableGhost,proto3" json:"enable_ghost,omitempty"`// For inputs, we must either use `sheet` or `statement`.// For outputs, we always use `sheet`. `statement` is the preview of the sheet content.//@@ -985,13 +983,6 @@ func (x *Release_File) GetVersion() string {return ""}-func (x *Release_File) GetEnableGhost() bool {- if x != nil {- return x.EnableGhost- }- return false-}-func (x *Release_File) GetSheet() string {if x != nil {return x.Sheet@@ -1127,7 +1118,7 @@ const file_v1_release_service_proto_rawDesc = "" +"\x1dListReleaseCategoriesResponse\x12\x1e\n" +"\n" +"categories\x18\x01 \x03(\tR\n" +- "categories\"\x91\x06\n" ++ "categories\"\xee\x05\n" +"\aRelease\x12\x17\n" +"\x04name\x18\x01 \x01(\tB\x03\xe0A\x03R\x04name\x12\x1a\n" +"\bcategory\x18\x02 \x01(\tR\bcategory\x12/\n" +@@ -1138,11 +1129,10 @@ const file_v1_release_service_proto_rawDesc = "" +"\vcreate_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\n" +"createTime\x12-\n" +"\x05state\x18\a \x01(\x0e2\x12.bytebase.v1.StateB\x03\xe0A\x03R\x05state\x12-\n" +- "\x04type\x18\b \x01(\x0e2\x19.bytebase.v1.Release.TypeR\x04type\x1a\xd1\x01\n" ++ "\x04type\x18\b \x01(\x0e2\x19.bytebase.v1.Release.TypeR\x04type\x1a\xae\x01\n" +"\x04File\x12\x12\n" +"\x04path\x18\x02 \x01(\tR\x04path\x12\x18\n" +- "\aversion\x18\x06 \x01(\tR\aversion\x12!\n" +- "\fenable_ghost\x18\t \x01(\bR\venableGhost\x12-\n" ++ "\aversion\x18\x06 \x01(\tR\aversion\x12-\n" +"\x05sheet\x18\x03 \x01(\tB\x17\xfaA\x14\n" +"\x12bytebase.com/SheetR\x05sheet\x12!\n" +"\tstatement\x18\a \x01(\fB\x03\xe0A\x04R\tstatement\x12&\n" +diff --git a/backend/generated-go/v1/release_service_equal.pb.go b/backend/generated-go/v1/release_service_equal.pb.goindex f0cea9e852..ff2f4a7202 100644--- a/backend/generated-go/v1/release_service_equal.pb.go+++ b/backend/generated-go/v1/release_service_equal.pb.go@@ -260,9 +260,6 @@ func (x *Release_File) Equal(y *Release_File) bool {if x.Version != y.Version {return false}- if x.EnableGhost != y.EnableGhost {- return false- }if x.Sheet != y.Sheet {return false}diff --git a/backend/plugin/parser/base/transaction_mode.go b/backend/plugin/parser/base/transaction_mode.goindex 829ff5e30f..e1d01fff33 100644--- a/backend/plugin/parser/base/transaction_mode.go+++ b/backend/plugin/parser/base/transaction_mode.go@@ -17,6 +17,10 @@ var (// txnIsolationDirectiveRegex matches the isolation level directive.// Format: -- txn-isolation = READ UNCOMMITTED|READ COMMITTED|REPEATABLE READ|SERIALIZABLEtxnIsolationDirectiveRegex = regexp.MustCompile(`(?i)^\s*--\s*txn-isolation\s*=\s*(READ\s+UNCOMMITTED|READ\s+COMMITTED|REPEATABLE\s+READ|SERIALIZABLE)\s*$`)++ // ghostDirectiveRegex matches the ghost configuration directive.+ // Format: -- gh-ost = {"key":"value",...} or -- gh-ost = {} /*comment*/+ ghostDirectiveRegex = regexp.MustCompile(`(?i)^\s*--\s*gh-ost\s*=\s*\{[^}]*\}\s*(?:/\*.*\*/)?\s*$`))// ParseTransactionConfig extracts both transaction mode and isolation level directives from the SQL script.@@ -104,3 +108,26 @@ func ConvertToSQLIsolation(level common.IsolationLevel) sql.IsolationLevel {return sql.LevelDefault}}++// CleanDirectives removes all Bytebase directive comments from a SQL statement.+// This includes: -- txn-mode, -- txn-isolation, -- ghost+// Use this before passing statements to external tools (like gh-ost) that may not handle directives.+func CleanDirectives(script string) string {+ lines := strings.Split(script, "\n")+ if len(lines) == 0 {+ return script+ }++ var remainingLines []string+ for _, line := range lines {+ // Check if this line is a directive+ if txnModeDirectiveRegex.MatchString(line) ||+ txnIsolationDirectiveRegex.MatchString(line) ||+ ghostDirectiveRegex.MatchString(line) {+ continue+ }+ remainingLines = append(remainingLines, line)+ }++ return strings.Join(remainingLines, "\n")+}diff --git a/backend/plugin/parser/base/transaction_mode_test.go b/backend/plugin/parser/base/transaction_mode_test.gonew file mode 100644index 0000000000..e902407f39--- /dev/null+++ b/backend/plugin/parser/base/transaction_mode_test.go@@ -0,0 +1,101 @@+package base++import (+ "testing"++ "github.com/stretchr/testify/require"+)++func TestCleanDirectives(t *testing.T) {+ tests := []struct {+ name string+ input string+ expected string+ }{+ {+ name: "no directives",+ input: "ALTER TABLE users ADD COLUMN age INT;",+ expected: "ALTER TABLE users ADD COLUMN age INT;",+ },+ {+ name: "txn-mode directive only",+ input: `-- txn-mode = on+ALTER TABLE users ADD COLUMN age INT;`,+ expected: "ALTER TABLE users ADD COLUMN age INT;",+ },+ {+ name: "txn-isolation directive only",+ input: `-- txn-isolation = REPEATABLE READ+ALTER TABLE users ADD COLUMN age INT;`,+ expected: "ALTER TABLE users ADD COLUMN age INT;",+ },+ {+ name: "ghost directive only",+ input: `-- gh-ost = {"max-lag-millis":"1500"}+ALTER TABLE users ADD COLUMN age INT;`,+ expected: "ALTER TABLE users ADD COLUMN age INT;",+ },+ {+ name: "all directives",+ input: `-- txn-mode = on+-- txn-isolation = REPEATABLE READ+-- gh-ost = {"cut-over":"default"}+ALTER TABLE users ADD COLUMN age INT;`,+ expected: "ALTER TABLE users ADD COLUMN age INT;",+ },+ {+ name: "directives with other comments",+ input: `-- txn-mode = on+-- This is a regular comment+-- gh-ost = {}+ALTER TABLE users ADD COLUMN age INT;`,+ expected: `-- This is a regular comment+ALTER TABLE users ADD COLUMN age INT;`,+ },+ {+ name: "case insensitive",+ input: `-- TXN-MODE = ON+-- TXN-ISOLATION = repeatable read+-- GH-OST = {"key":"value"}+ALTER TABLE users ADD COLUMN age INT;`,+ expected: "ALTER TABLE users ADD COLUMN age INT;",+ },+ {+ name: "directives with extra spaces",+ input: `-- txn-mode = on+-- gh-ost = {"key":"value"}+ALTER TABLE users ADD COLUMN age INT;`,+ expected: "ALTER TABLE users ADD COLUMN age INT;",+ },+ {+ name: "empty input",+ input: "",+ expected: "",+ },+ {+ name: "multiline statement preserved",+ input: `-- gh-ost = {}+CREATE TABLE users (+ id INT PRIMARY KEY,+ name VARCHAR(100)+);`,+ expected: `CREATE TABLE users (+ id INT PRIMARY KEY,+ name VARCHAR(100)+);`,+ },+ {+ name: "ghost directive with comment",+ input: `-- gh-ost = {} /*gh-ost with default config*/+ALTER TABLE users ADD COLUMN age INT;`,+ expected: "ALTER TABLE users ADD COLUMN age INT;",+ },+ }++ for _, tt := range tests {+ t.Run(tt.name, func(t *testing.T) {+ result := CleanDirectives(tt.input)+ require.Equal(t, tt.expected, result)+ })+ }+}diff --git a/backend/runner/plancheck/derive.go b/backend/runner/plancheck/derive.goindex 68cfb08bcf..32744b67a3 100644--- a/backend/runner/plancheck/derive.go+++ b/backend/runner/plancheck/derive.go@@ -1,8 +1,11 @@package plancheckimport (+ "context"+"github.com/pkg/errors"+ "github.com/bytebase/bytebase/backend/component/ghost"storepb "github.com/bytebase/bytebase/backend/generated-go/store"v1pb "github.com/bytebase/bytebase/backend/generated-go/v1""github.com/bytebase/bytebase/backend/store"@@ -10,7 +13,7 @@ import (// DeriveCheckTargets derives check targets from a plan and optional database group.// This replaces the stored config by computing targets at runtime.-func DeriveCheckTargets(project *store.ProjectMessage, plan *store.PlanMessage, databaseGroup *v1pb.DatabaseGroup) ([]*CheckTarget, error) {+func DeriveCheckTargets(ctx context.Context, s *store.Store, project *store.ProjectMessage, plan *store.PlanMessage, databaseGroup *v1pb.DatabaseGroup) ([]*CheckTarget, error) {var targets []*CheckTargetfor _, spec := range plan.Config.Specs {@@ -41,7 +44,23 @@ func DeriveCheckTargets(project *store.ProjectMessage, plan *store.PlanMessage,}}- enableGhost := config.ChangeDatabaseConfig.EnableGhost+ // Parse ghost config from sheet content+ var enableGhost bool+ var ghostFlags map[string]string++ sheetContent, err := getSheetContent(ctx, s, config.ChangeDatabaseConfig.SheetSha256)+ if err != nil {+ return nil, errors.Wrapf(err, "failed to get sheet content")+ }+ if sheetContent != "" {+ enableGhost = ghost.IsGhostEnabled(sheetContent)+ if enableGhost {+ ghostFlags, err = ghost.ParseGhostDirective(sheetContent)+ if err != nil {+ return nil, errors.Wrapf(err, "failed to parse ghost directive")+ }+ }+ }for _, target := range databases {types := []storepb.PlanCheckType{@@ -56,8 +75,8 @@ func DeriveCheckTargets(project *store.ProjectMessage, plan *store.PlanMessage,Target: target,SheetSha256: config.ChangeDatabaseConfig.SheetSha256,EnablePriorBackup: config.ChangeDatabaseConfig.EnablePriorBackup,- EnableGhost: config.ChangeDatabaseConfig.EnableGhost,- GhostFlags: config.ChangeDatabaseConfig.GhostFlags,+ EnableGhost: enableGhost,+ GhostFlags: ghostFlags,Types: types,})}@@ -68,3 +87,17 @@ func DeriveCheckTargets(project *store.ProjectMessage, plan *store.PlanMessage,return targets, nil}++func getSheetContent(ctx context.Context, s *store.Store, sheetSha256 string) (string, error) {+ if sheetSha256 == "" {+ return "", nil+ }+ sheet, err := s.GetSheetFull(ctx, sheetSha256)+ if err != nil {+ return "", err+ }+ if sheet == nil {+ return "", nil+ }+ return sheet.Statement, nil+}diff --git a/backend/runner/plancheck/scheduler.go b/backend/runner/plancheck/scheduler.goindex 33a8f852c0..e722f6c9a5 100644--- a/backend/runner/plancheck/scheduler.go+++ b/backend/runner/plancheck/scheduler.go@@ -125,7 +125,7 @@ func (s *Scheduler) runPlanCheckRun(ctx context.Context, uid int, planUID int64)}// Derive check targets from plan- targets, err := DeriveCheckTargets(project, plan, databaseGroup)+ targets, err := DeriveCheckTargets(ctxWithCancel, s.store, project, plan, databaseGroup)if err != nil {s.markPlanCheckRunFailed(ctxWithCancel, uid, err.Error())returndiff --git a/backend/runner/taskrun/database_migrate_executor.go b/backend/runner/taskrun/database_migrate_executor.goindex c4bed86c0d..87c519638c 100644--- a/backend/runner/taskrun/database_migrate_executor.go+++ b/backend/runner/taskrun/database_migrate_executor.go@@ -120,7 +120,7 @@ func (exec *DatabaseMigrateExecutor) RunOnce(ctx context.Context, driverCtx contreturn nil, errors.Errorf("sheet not found: %s", task.Payload.GetSheetSha256())}- if task.Payload.GetEnableGhost() {+ if ghost.IsGhostEnabled(sheet.Statement) {return exec.runGhostMigration(ctx, driverCtx, task, taskRunUID, sheet, instance, database, project)}return exec.runStandardMigration(ctx, driverCtx, task, taskRunUID, sheet, instance, database, project)@@ -283,7 +283,14 @@ func (exec *DatabaseMigrateExecutor) runStandardMigration(ctx context.Context, d}func (exec *DatabaseMigrateExecutor) runGhostMigration(ctx context.Context, driverCtx context.Context, task *store.TaskMessage, taskRunUID int, sheet *store.SheetMessage, instance *store.InstanceMessage, database *store.DatabaseMessage, project *store.ProjectMessage) (*storepb.TaskRunResult, error) {- flags := task.Payload.GetFlags()+ // Parse ghost flags from sheet directive+ flags, err := ghost.ParseGhostDirective(sheet.Statement)+ if err != nil {+ return nil, errors.Wrapf(err, "failed to parse ghost directive")+ }+ if flags == nil {+ flags = make(map[string]string)+ }// Get database driverdriver, err := exec.dbFactory.GetAdminDatabaseDriver(ctx, instance, database, db.ConnectionContext{@@ -312,7 +319,9 @@ func (exec *DatabaseMigrateExecutor) runGhostMigration(ctx context.Context, driv}// Prepare gh-ost migration context before beginning migration- statement := strings.TrimSpace(sheet.Statement)+ // Remove all Bytebase directives from statement before passing to gh-ost+ cleanedStatement := parserbase.CleanDirectives(sheet.Statement)+ statement := strings.TrimSpace(cleanedStatement)// Trim trailing semicolons.statement = strings.TrimRight(statement, ";")@@ -326,7 +335,7 @@ func (exec *DatabaseMigrateExecutor) runGhostMigration(ctx context.Context, drivreturn nil, common.Errorf(common.Internal, "admin data source not found for instance %s", instance.ResourceID)}- migrationContext, err := ghost.NewMigrationContext(ctx, task.ID, database, adminDataSource, tableName, fmt.Sprintf("_%d", time.Now().Unix()), sheet.Statement, false, flags, 10000000)+ migrationContext, err := ghost.NewMigrationContext(ctx, task.ID, database, adminDataSource, tableName, fmt.Sprintf("_%d", time.Now().Unix()), cleanedStatement, false, flags, 10000000)if err != nil {return nil, errors.Wrap(err, "failed to init migrationContext for gh-ost")}diff --git a/backend/tests/gitops_test.go b/backend/tests/gitops_test.goindex 1a0d07f41d..d46561b5f2 100644--- a/backend/tests/gitops_test.go+++ b/backend/tests/gitops_test.go@@ -82,9 +82,8 @@ func TestGitOpsCheck(t *testing.T) {Type: v1pb.Release_VERSIONED,Files: []*v1pb.Release_File{{- Path: "migrations/001__create_users_table.sql",- Version: "001",- EnableGhost: false,+ Path: "migrations/001__create_users_table.sql",+ Version: "001",Statement: []byte(`CREATE TABLE users (id INTEGER PRIMARY KEY AUTOINCREMENT,username TEXT NOT NULL UNIQUE,@@ -93,10 +92,9 @@ func TestGitOpsCheck(t *testing.T) {);`),},{- Path: "migrations/002__add_email_index.sql",- Version: "002",- EnableGhost: false,- Statement: []byte(`CREATE INDEX idx_users_email ON users(email);`),+ Path: "migrations/002__add_email_index.sql",+ Version: "002",+ Statement: []byte(`CREATE INDEX idx_users_email ON users(email);`),},},}@@ -201,9 +199,8 @@ func TestGitOpsRollout(t *testing.T) {Type: v1pb.Release_VERSIONED,Files: []*v1pb.Release_File{{- Path: "migrations/001__create_products_table.sql",- Version: "001",- EnableGhost: false,+ Path: "migrations/001__create_products_table.sql",+ Version: "001",Statement: []byte(`CREATE TABLE products (id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT NOT NULL,@@ -385,27 +382,24 @@ func TestGitOpsRolloutMultiTarget(t *testing.T) {Type: v1pb.Release_VERSIONED,Files: []*v1pb.Release_File{{- Path: "migrations/1.0.0__create_table_one.sql",- Version: "1.0.0",- EnableGhost: false,+ Path: "migrations/1.0.0__create_table_one.sql",+ Version: "1.0.0",Statement: []byte(`CREATE TABLE table_one (id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT NOT NULL);`),},{- Path: "migrations/1.0.1__create_table_two.sql",- Version: "1.0.1",- EnableGhost: false,+ Path: "migrations/1.0.1__create_table_two.sql",+ Version: "1.0.1",Statement: []byte(`CREATE TABLE table_two (id INTEGER PRIMARY KEY AUTOINCREMENT,value TEXT NOT NULL);`),},{- Path: "migrations/1.0.2__create_table_three.sql",- Version: "1.0.2",- EnableGhost: false,+ Path: "migrations/1.0.2__create_table_three.sql",+ Version: "1.0.2",Statement: []byte(`CREATE TABLE table_three (id INTEGER PRIMARY KEY AUTOINCREMENT,data TEXT NULL@@ -614,9 +608,8 @@ func TestGitOpsCheckAppliedButChanged(t *testing.T) {Type: v1pb.Release_VERSIONED,Files: []*v1pb.Release_File{{- Path: "migrations/1.0.0__create_users_table.sql",- Version: "1.0.0",- EnableGhost: false,+ Path: "migrations/1.0.0__create_users_table.sql",+ Version: "1.0.0",Statement: []byte(`CREATE TABLE users (id INTEGER PRIMARY KEY AUTOINCREMENT,username TEXT NOT NULL,@@ -681,9 +674,8 @@ func TestGitOpsCheckAppliedButChanged(t *testing.T) {Type: v1pb.Release_VERSIONED,Files: []*v1pb.Release_File{{- Path: "migrations/1.0.0__create_users_table.sql",- Version: "1.0.0",- EnableGhost: false,+ Path: "migrations/1.0.0__create_users_table.sql",+ Version: "1.0.0",Statement: []byte(`CREATE TABLE users (id INTEGER PRIMARY KEY AUTOINCREMENT,username TEXT NOT NULL,diff --git a/backend/tests/rollout.go b/backend/tests/rollout.goindex 63ff06794a..ec0e119f1a 100644--- a/backend/tests/rollout.go+++ b/backend/tests/rollout.go@@ -13,14 +13,13 @@ import (v1pb "github.com/bytebase/bytebase/backend/generated-go/v1")-func (ctl *controller) changeDatabase(ctx context.Context, project *v1pb.Project, database *v1pb.Database, sheet *v1pb.Sheet, enableGhost bool) error {+func (ctl *controller) changeDatabase(ctx context.Context, project *v1pb.Project, database *v1pb.Database, sheet *v1pb.Sheet, _ bool) error {spec := &v1pb.Plan_Spec{Id: uuid.NewString(),Config: &v1pb.Plan_Spec_ChangeDatabaseConfig{ChangeDatabaseConfig: &v1pb.Plan_ChangeDatabaseConfig{- Targets: []string{database.Name},- Sheet: sheet.Name,- EnableGhost: enableGhost,+ Targets: []string{database.Name},+ Sheet: sheet.Name,},},}diff --git a/backend/tests/sql_review_test.go b/backend/tests/sql_review_test.goindex 0a0d20c334..1e32aadb63 100644--- a/backend/tests/sql_review_test.go+++ b/backend/tests/sql_review_test.go@@ -471,9 +471,8 @@ func createIssueAndReturnSQLReviewResult(ctx context.Context, a *require.AssertiId: uuid.NewString(),Config: &v1pb.Plan_Spec_ChangeDatabaseConfig{ChangeDatabaseConfig: &v1pb.Plan_ChangeDatabaseConfig{- Targets: []string{database.Name},- Sheet: sheet.Msg.Name,- EnableGhost: false,+ Targets: []string{database.Name},+ Sheet: sheet.Msg.Name,},},},diff --git a/docs/plans/BYT-8740-ghost-directive.md b/docs/plans/BYT-8740-ghost-directive.mdnew file mode 100644index 0000000000..84f35964fe--- /dev/null+++ b/docs/plans/BYT-8740-ghost-directive.md@@ -0,0 +1,874 @@+# Implementation Plan: BYT-8740 - Move Ghost Configuration to Sheet Content Directives++## Overview++Move ghost configuration from plan spec proto fields (`enable_ghost`, `ghost_flags`) to a single-line JSON directive embedded in sheet content.++**Before:**+```protobuf+message ChangeDatabaseConfig {+ map<string, string> ghost_flags = 5;+ bool enable_ghost = 7;+}+```++**After:**+```sql+-- ghost = {"max-lag-millis":"1500","cut-over-lock-timeout-seconds":"10"}+ALTER TABLE users ADD COLUMN status VARCHAR(50);+```++---++## Task 1: Add Ghost Directive Support to Frontend directiveUtils.ts++**File:** `frontend/src/components/Plan/components/StatementSection/directiveUtils.ts`++### 1.1 Add Ghost Directive Regex++After line 22 (after `ROLE_SETTER_REGEX`), add:++```typescript+// Ghost configuration directive pattern+// Matches: -- ghost = {"key":"value",...}+const GHOST_DIRECTIVE_REGEX = /^\s*--\s*ghost\s*=\s*(\{.*\})\s*$/i;+```++### 1.2 Extend ParsedStatement Interface++Update the interface at lines 30-39:++```typescript+export interface ParsedStatement {+ // Line 1 directive (currently only transaction mode)+ transactionMode?: "on" | "off";+ // Line 2 directive (isolation level, only valid when txn-mode is on)+ isolationLevel?: IsolationLevel;+ // Ghost configuration (JSON object with gh-ost flags)+ ghostConfig?: Record<string, string>;+ // Role setter block if present+ roleSetterBlock?: string;+ // The main SQL content (everything except directives and role setter)+ mainContent: string;+}+```++### 1.3 Update parseStatement() Function++In the directive scanning loop (around line 67-83), add ghost directive parsing:++```typescript+// Check for ghost directive+const ghostMatch = line.match(GHOST_DIRECTIVE_REGEX);+if (ghostMatch) {+ try {+ result.ghostConfig = JSON.parse(ghostMatch[1]);+ } catch {+ // Invalid JSON, treat as regular comment+ }+ directiveLines.add(i);+ continue;+}+```++### 1.4 Update buildStatement() Function++After the isolation level section (around line 125), add:++```typescript+// Ghost directive (if present)+if (components.ghostConfig && Object.keys(components.ghostConfig).length > 0) {+ parts.push(`-- ghost = ${JSON.stringify(components.ghostConfig)}`);+}+```++### 1.5 Add Ghost Helper Functions++Add at end of file:++```typescript+/**+ * Updates the ghost configuration in a statement while preserving other components.+ * Pass undefined or empty object to remove ghost config.+ */+export function updateGhostConfig(+ statement: string,+ config: Record<string, string> | undefined+): string {+ const parsed = parseStatement(statement);+ parsed.ghostConfig = config && Object.keys(config).length > 0 ? config : undefined;+ return buildStatement(parsed);+}++/**+ * Gets the ghost configuration from a statement.+ * Returns undefined if no ghost directive is present.+ */+export function getGhostConfig(+ statement: string+): Record<string, string> | undefined {+ const parsed = parseStatement(statement);+ return parsed.ghostConfig;+}++/**+ * Checks if ghost is enabled for a statement (directive is present).+ */+export function isGhostEnabled(statement: string): boolean {+ const parsed = parseStatement(statement);+ return parsed.ghostConfig !== undefined;+}+```++**Verification:** Run `pnpm --dir frontend type-check`++---++## Task 2: Update GhostSwitch.vue to Use Sheet Directives++**File:** `frontend/src/components/Plan/components/Configuration/GhostSection/GhostSwitch.vue`++### 2.1 Add Imports++Add to imports section (around line 29):++```typescript+import {+ updateGhostConfig,+ isGhostEnabled,+} from "@/components/Plan/components/StatementSection/directiveUtils";+import { useSpecSheet } from "@/components/Plan/components/StatementSection/useSpecSheet";+import { updateSpecSheetWithStatement } from "@/components/Plan/components/StatementSection/useUpdateSpecSheetWithStatement";+```++### 2.2 Add Sheet Access++After the context destructuring (around line 54), add:++```typescript+const { sheet, sheetStatement, sheetReady } = useSpecSheet(+ computed(() => selectedSpec.value!)+);+```++### 2.3 Update enabled Computed++Replace the `enabled` from context with a local computed that reads from sheet:++```typescript+const enabled = computed(() => {+ if (!sheetReady.value) return false;+ return isGhostEnabled(sheetStatement.value);+});+```++### 2.4 Replace toggleChecked Function++Replace lines 134-171:++```typescript+const toggleChecked = async (on: boolean) => {+ if (errors.value.length > 0) {+ return;+ }++ // Get current ghost config from sheet (to preserve flags when toggling)+ const currentConfig = on ? {} : undefined;+ const updatedStatement = updateGhostConfig(sheetStatement.value, currentConfig);++ if (isCreating.value) {+ // When creating a plan, update the local sheet directly.+ if (!sheet.value) return;+ setSheetStatement(sheet.value, updatedStatement);+ } else {+ // For created plans, create new sheet and update plan/spec+ await updateSpecSheetWithStatement(+ plan.value,+ selectedSpec.value,+ updatedStatement+ );+ events.emit("update");+ pushNotification({+ module: "bytebase",+ style: "SUCCESS",+ title: t("common.updated"),+ });+ }+};+```++### 2.5 Add Missing Import++```typescript+import { setSheetStatement } from "@/utils";+```++**Verification:** Run `pnpm --dir frontend type-check`++---++## Task 3: Update GhostFlagsPanel.vue to Use Sheet Directives++**File:** `frontend/src/components/Plan/components/Configuration/GhostSection/GhostFlagsPanel.vue`++### 3.1 Add Imports++Replace/add imports (around line 38):++```typescript+import {+ updateGhostConfig,+ getGhostConfig,+} from "@/components/Plan/components/StatementSection/directiveUtils";+import { useSpecSheet } from "@/components/Plan/components/StatementSection/useSpecSheet";+import { updateSpecSheetWithStatement } from "@/components/Plan/components/StatementSection/useUpdateSpecSheetWithStatement";+import { setSheetStatement } from "@/utils";+```++### 3.2 Add Sheet Access++After context destructuring (around line 63), add:++```typescript+const { sheet, sheetStatement, sheetReady } = useSpecSheet(+ computed(() => selectedSpec.value!)+);+```++### 3.3 Update flags Initialization++Replace the config computed and flags ref (lines 68-73):++```typescript+const flags = ref<Record<string, string>>({});++// Get current flags from sheet directive+const currentFlags = computed(() => {+ if (!sheetReady.value) return {};+ return getGhostConfig(sheetStatement.value) ?? {};+});+```++### 3.4 Update isDirty Computed++Replace lines 75-77:++```typescript+const isDirty = computed(() => {+ return !isEqual(currentFlags.value, flags.value);+});+```++### 3.5 Replace trySave Function++Replace lines 96-133:++```typescript+const trySave = async () => {+ if (errors.value.length > 0) {+ return;+ }++ const updatedStatement = updateGhostConfig(sheetStatement.value, cloneDeep(flags.value));++ if (isCreating.value) {+ // When creating a plan, update the local sheet directly.+ if (!sheet.value) return;+ setSheetStatement(sheet.value, updatedStatement);+ } else {+ // For created plans, create new sheet and update plan/spec+ await updateSpecSheetWithStatement(+ plan.value,+ selectedSpec.value,+ updatedStatement+ );+ events.emit("update");+ pushNotification({+ module: "bytebase",+ style: "SUCCESS",+ title: t("common.updated"),+ });+ }+ close();+};+```++### 3.6 Update Watch++Replace lines 136-145:++```typescript+watch(+ currentFlags,+ (newFlags, oldFlags) => {+ if (isEqual(newFlags, oldFlags)) {+ return;+ }+ flags.value = cloneDeep(newFlags);+ },+ { immediate: true, deep: true }+);+```++### 3.7 Update close Function++Replace lines 91-94:++```typescript+const close = () => {+ flags.value = cloneDeep(currentFlags.value);+ emits("update:show", false);+};+```++**Verification:** Run `pnpm --dir frontend type-check`++---++## Task 4: Update common.ts to Read from Sheet++**File:** `frontend/src/components/Plan/components/Configuration/GhostSection/common.ts`++### 4.1 Remove getGhostEnabledForSpec Function++Delete the entire `getGhostEnabledForSpec` function (lines 32-51). This function reads from `config.enableGhost` which will no longer exist.++Components should use `isGhostEnabled(sheetStatement)` from `directiveUtils.ts` instead.++**Verification:** Run `pnpm --dir frontend type-check` and fix any import errors in files that used `getGhostEnabledForSpec`++---++## Task 5: Update context.ts to Remove Proto-Based enabled++**File:** `frontend/src/components/Plan/components/Configuration/GhostSection/context.ts`++Review this file and remove any computed properties that read `enableGhost` or `ghostFlags` from the plan spec config. The context should no longer provide `enabled` computed that reads from proto - components will read from sheet directive instead.++**Verification:** Run `pnpm --dir frontend type-check`++---++## Task 6: Add Ghost Directive Parser to Backend++**File:** `backend/component/ghost/directive.go` (NEW FILE)++Create a new file:++```go+package ghost++import (+ "encoding/json"+ "regexp"+ "strings"+)++// ghostDirectiveRegex matches: -- ghost = {"key":"value",...}+var ghostDirectiveRegex = regexp.MustCompile(`(?im)^\s*--\s*ghost\s*=\s*(\{.*\})\s*$`)++// ParseGhostDirective extracts ghost configuration from sheet content.+// Returns nil if no ghost directive is found.+func ParseGhostDirective(content string) (map[string]string, error) {+ match := ghostDirectiveRegex.FindStringSubmatch(content)+ if match == nil || len(match) < 2 {+ return nil, nil+ }++ var flags map[string]string+ if err := json.Unmarshal([]byte(match[1]), &flags); err != nil {+ return nil, err+ }++ return flags, nil+}++// IsGhostEnabled checks if ghost is enabled by checking for directive presence.+func IsGhostEnabled(content string) bool {+ return ghostDirectiveRegex.MatchString(content)+}++// RemoveGhostDirective removes the ghost directive from sheet content.+func RemoveGhostDirective(content string) string {+ return ghostDirectiveRegex.ReplaceAllString(content, "")+}++// GetStatementWithoutDirectives returns the SQL statement without any directives.+// This is used when executing the actual SQL.+func GetStatementWithoutDirectives(content string) string {+ lines := strings.Split(content, "\n")+ var result []string+ for _, line := range lines {+ trimmed := strings.TrimSpace(line)+ // Skip directive lines+ if strings.HasPrefix(trimmed, "-- ghost") ||+ strings.HasPrefix(trimmed, "-- txn-mode") ||+ strings.HasPrefix(trimmed, "-- txn-isolation") {+ continue+ }+ result = append(result, line)+ }+ return strings.TrimSpace(strings.Join(result, "\n"))+}+```++**Verification:** Run `go build ./backend/component/ghost/...`++---++## Task 7: Add Tests for Ghost Directive Parser++**File:** `backend/component/ghost/directive_test.go` (NEW FILE)++```go+package ghost++import (+ "testing"++ "github.com/stretchr/testify/require"+)++func TestParseGhostDirective(t *testing.T) {+ tests := []struct {+ name string+ content string+ want map[string]string+ wantErr bool+ }{+ {+ name: "no directive",+ content: "ALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: nil,+ },+ {+ name: "empty flags",+ content: "-- ghost = {}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: map[string]string{},+ },+ {+ name: "single flag",+ content: "-- ghost = {\"max-lag-millis\":\"1500\"}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: map[string]string{"max-lag-millis": "1500"},+ },+ {+ name: "multiple flags",+ content: "-- ghost = {\"max-lag-millis\":\"1500\",\"cut-over-lock-timeout-seconds\":\"10\"}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: map[string]string{"max-lag-millis": "1500", "cut-over-lock-timeout-seconds": "10"},+ },+ {+ name: "with other directives",+ content: "-- txn-mode = on\n-- ghost = {\"max-lag-millis\":\"1500\"}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: map[string]string{"max-lag-millis": "1500"},+ },+ {+ name: "case insensitive",+ content: "-- GHOST = {\"max-lag-millis\":\"1500\"}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: map[string]string{"max-lag-millis": "1500"},+ },+ }++ for _, tt := range tests {+ t.Run(tt.name, func(t *testing.T) {+ got, err := ParseGhostDirective(tt.content)+ if tt.wantErr {+ require.Error(t, err)+ return+ }+ require.NoError(t, err)+ require.Equal(t, tt.want, got)+ })+ }+}++func TestIsGhostEnabled(t *testing.T) {+ tests := []struct {+ name string+ content string+ want bool+ }{+ {+ name: "no directive",+ content: "ALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: false,+ },+ {+ name: "with directive",+ content: "-- ghost = {}\nALTER TABLE users ADD COLUMN status VARCHAR(50);",+ want: true,+ },+ }++ for _, tt := range tests {+ t.Run(tt.name, func(t *testing.T) {+ got := IsGhostEnabled(tt.content)+ require.Equal(t, tt.want, got)+ })+ }+}+```++**Verification:** Run `go test -v ./backend/component/ghost/...`++---++## Task 8: Update Plan Check Derivation++**File:** `backend/runner/plancheck/derive.go`++### 8.1 Add Import++Add to imports:++```go+"github.com/bytebase/bytebase/backend/component/ghost"+```++### 8.2 Update DeriveCheckTargets Function++Replace lines 44-62. The function needs to:+1. Get sheet content using `SheetSha256`+2. Parse ghost directive from content+3. Set `EnableGhost` and `GhostFlags` from parsed directive++This requires adding a store parameter to fetch sheet content:++```go+func DeriveCheckTargets(ctx context.Context, s *store.Store, project *store.ProjectMessage, plan *store.PlanMessage, databaseGroup *v1pb.DatabaseGroup) ([]*CheckTarget, error) {+```++Then in the `ChangeDatabaseConfig` case, replace the ghost handling:++```go+// Parse ghost config from sheet content+var enableGhost bool+var ghostFlags map[string]string++sheetContent, err := getSheetContent(ctx, s, config.ChangeDatabaseConfig.SheetSha256)+if err != nil {+ return nil, errors.Wrapf(err, "failed to get sheet content")+}+if sheetContent != "" {+ enableGhost = ghost.IsGhostEnabled(sheetContent)+ if enableGhost {+ ghostFlags, err = ghost.ParseGhostDirective(sheetContent)+ if err != nil {+ return nil, errors.Wrapf(err, "failed to parse ghost directive")+ }+ }+}++for _, target := range databases {+ types := []storepb.PlanCheckType{+ storepb.PlanCheckType_PLAN_CHECK_TYPE_STATEMENT_ADVISE,+ storepb.PlanCheckType_PLAN_CHECK_TYPE_STATEMENT_SUMMARY_REPORT,+ }+ if enableGhost {+ types = append(types, storepb.PlanCheckType_PLAN_CHECK_TYPE_GHOST_SYNC)+ }++ targets = append(targets, &CheckTarget{+ Target: target,+ SheetSha256: config.ChangeDatabaseConfig.SheetSha256,+ EnablePriorBackup: config.ChangeDatabaseConfig.EnablePriorBackup,+ EnableGhost: enableGhost,+ GhostFlags: ghostFlags,+ Types: types,+ })+}+```++### 8.3 Add Helper Function++Add helper to get sheet content by SHA256:++```go+func getSheetContent(ctx context.Context, s *store.Store, sheetSha256 string) (string, error) {+ if sheetSha256 == "" {+ return "", nil+ }+ sheet, err := s.GetSheetBySha256(ctx, sheetSha256)+ if err != nil {+ return "", err+ }+ if sheet == nil {+ return "", nil+ }+ return sheet.Statement, nil+}+```++**Verification:** Run `go build ./backend/runner/plancheck/...`++---++## Task 9: Update Task Creation in rollout_service_task.go++**File:** `backend/api/v1/rollout_service_task.go`++### 9.1 Add Import++Add to imports:++```go+"github.com/bytebase/bytebase/backend/component/ghost"+```++### 9.2 Update getTaskCreatesFromChangeDatabaseConfig++Replace lines 214-221 (the ghost handling block). The function needs to:+1. Get sheet content+2. Parse ghost directive+3. Set task payload flags++```go+// Parse ghost config from sheet content+if c.SheetSha256 != "" {+ sheetContent, err := getSheetContentBySha256(ctx, s, c.SheetSha256)+ if err != nil {+ return nil, errors.Wrapf(err, "failed to get sheet content")+ }++ if ghost.IsGhostEnabled(sheetContent) {+ ghostFlags, err := ghost.ParseGhostDirective(sheetContent)+ if err != nil {+ return nil, errors.Wrapf(err, "failed to parse ghost directive")+ }+ if _, err := ghost.GetUserFlags(ghostFlags); err != nil {+ return nil, errors.Wrapf(err, "invalid ghost flags %q", ghostFlags)+ }+ payload.Flags = ghostFlags+ payload.EnableGhost = true+ }+}+```++### 9.3 Add Helper Function++Add helper if not already present:++```go+func getSheetContentBySha256(ctx context.Context, s *store.Store, sha256 string) (string, error) {+ sheet, err := s.GetSheetBySha256(ctx, sha256)+ if err != nil {+ return "", err+ }+ if sheet == nil {+ return "", errors.Errorf("sheet not found for sha256: %s", sha256)+ }+ return sheet.Statement, nil+}+```++**Verification:** Run `go build ./backend/api/v1/...`++---++## Task 10: Remove Ghost Fields from v1 Plan Proto++**File:** `proto/v1/v1/plan_service.proto`++### 10.1 Remove Fields++Delete lines 279 and 285 (ghost_flags and enable_ghost):++```protobuf+message ChangeDatabaseConfig {+ repeated string targets = 1;+ string sheet = 2;+ string release = 3 [(google.api.resource_reference) = {type: "bytebase.com/Release"}];+ // REMOVED: map<string, string> ghost_flags = 5;+ bool enable_prior_backup = 6;+ // REMOVED: bool enable_ghost = 7;+}+```++Keep field numbers reserved to prevent reuse.++**Verification:** Run `buf lint proto`++---++## Task 11: Remove Ghost Fields from Store Plan Proto++**File:** `proto/store/store/plan.proto`++### 11.1 Remove Fields++Delete lines 60 and 66 (ghost_flags and enable_ghost):++```protobuf+message ChangeDatabaseConfig {+ repeated string targets = 10;+ string sheet_sha256 = 2;+ string release = 9;+ // REMOVED: map<string, string> ghost_flags = 7;+ bool enable_prior_backup = 8;+ // REMOVED: bool enable_ghost = 12;+}+```++**Verification:** Run `buf lint proto`++---++## Task 12: Keep Task Proto Fields (For Backward Compatibility)++**File:** `proto/store/store/task.proto`++The `flags` and `enable_ghost` fields in the Task proto should be **kept** because:+1. They are populated during task creation from the sheet directive+2. They are read by the task executor+3. Existing tasks in the database have these fields populated++No changes needed to this file.++---++## Task 13: Regenerate Proto Files++Run:++```bash+buf format -w proto+buf lint proto+cd proto && buf generate+```++**Verification:** Ensure no lint errors and generation succeeds++---++## Task 14: Update plan_service.go Conversions++**File:** `backend/api/v1/plan_service.go`++### 14.1 Update convertToPlanSpecChangeDatabaseConfig++Remove lines that reference `GhostFlags` and `EnableGhost` (around lines 880, 882):++```go+return &v1pb.Plan_Spec_ChangeDatabaseConfig{+ ChangeDatabaseConfig: &v1pb.Plan_ChangeDatabaseConfig{+ Targets: c.Targets,+ Sheet: sheet,+ Release: c.Release,+ // REMOVED: GhostFlags+ EnablePriorBackup: c.EnablePriorBackup,+ // REMOVED: EnableGhost+ },+}+```++### 14.2 Update convertPlanSpecChangeDatabaseConfig++Remove lines that reference `GhostFlags` and `EnableGhost` (around lines 961, 963):++```go+return &storepb.PlanConfig_Spec_ChangeDatabaseConfig{+ ChangeDatabaseConfig: &storepb.PlanConfig_ChangeDatabaseConfig{+ Targets: c.Targets,+ SheetSha256: sheetSha256,+ Release: c.Release,+ // REMOVED: GhostFlags+ EnablePriorBackup: c.EnablePriorBackup,+ // REMOVED: EnableGhost+ },+}+```++**Verification:** Run `go build ./backend/api/v1/...`++---++## Task 15: Update Release Service (If Applicable)++**File:** `backend/api/v1/release_service.go`++Review and remove any references to `EnableGhost` in release file handling if present.++**Verification:** Run `go build ./backend/api/v1/...`++---++## Task 16: Update Tests++### 16.1 Ghost Test++**File:** `backend/tests/ghost_test.go`++Update test statements to include ghost directive:++```go+// Before+statement := "ALTER TABLE book ADD author VARCHAR(54)"++// After+statement := "-- ghost = {\"max-lag-millis\":\"1500\"}\nALTER TABLE book ADD author VARCHAR(54)"+```++### 16.2 GitOps Test++**File:** `backend/tests/gitops_test.go`++Remove any `EnableGhost: false` from test plan configs.++### 16.3 Rollout Test++**File:** `backend/tests/rollout.go`++Update any test helpers that set `EnableGhost` on plan specs.++**Verification:** Run `go test -v ./backend/tests/...`++---++## Task 17: Run Full Lint and Build++```bash+# Backend+golangci-lint run --allow-parallel-runners+go build -ldflags "-w -s" -p=16 -o ./bytebase-build/bytebase ./backend/bin/server/main.go++# Frontend+pnpm --dir frontend fix+pnpm --dir frontend check+pnpm --dir frontend type-check+```++---++## Task 18: Manual Testing Checklist++1. Create a new plan with ghost enabled+ - Verify directive appears in sheet content+ - Verify ghost flags are preserved when editing++2. Toggle ghost on existing plan+ - Verify sheet content is updated+ - Verify directive is added/removed correctly++3. Edit ghost flags on existing plan+ - Verify flags are saved to sheet directive+ - Verify other directives (txn-mode, role setter) are preserved++4. Plan check with ghost enabled+ - Verify ghost sync check runs+ - Verify flags are correctly passed to ghost executor++5. Execute migration with ghost+ - Verify task has correct flags from sheet directive+ - Verify migration completes successfully++---++## Summary++| Phase | Files Modified | Key Changes |+|-------|---------------|-------------|+| Frontend | 5 files | Add directive utils, update Ghost components to use sheet |+| Backend | 6 files | Add directive parser, update plan check and task creation |+| Proto | 2 files | Remove ghost_flags and enable_ghost from ChangeDatabaseConfig |+| Tests | 4 files | Update test statements to use directive format |++**Total estimated files:** ~17 files (excluding generated)diff --git a/frontend/src/components/Plan/components/Configuration/Configuration.vue b/frontend/src/components/Plan/components/Configuration/Configuration.vueindex b95fc1356a..c87e6618c0 100644--- a/frontend/src/components/Plan/components/Configuration/Configuration.vue+++ b/frontend/src/components/Plan/components/Configuration/Configuration.vue@@ -5,8 +5,8 @@<InstanceRoleSection v-if="shouldShowInstanceRoleSection" /><TransactionModeSection v-if="shouldShowTransactionModeSection" /><IsolationLevelSection v-if="shouldShowIsolationLevelSection" />- <PreBackupSection v-if="shouldShowPreBackupSection" /><GhostSection v-if="shouldShowGhostSection" />+ <PreBackupSection v-if="shouldShowPreBackupSection" /></div><div v-else class="text-sm text-control-light">{{ $t("plan.options.no-options-available") }}diff --git a/frontend/src/components/Plan/components/Configuration/GhostSection/FlagsForm/constants.ts b/frontend/src/components/Plan/components/Configuration/GhostSection/FlagsForm/constants.tsindex 2218cd2c86..040fcb4165 100644--- a/frontend/src/components/Plan/components/Configuration/GhostSection/FlagsForm/constants.ts+++ b/frontend/src/components/Plan/components/Configuration/GhostSection/FlagsForm/constants.ts@@ -48,3 +48,17 @@ export const isFloatParameter = (): param is GhostParameter<"float"> => {return param.type === "float";};++/**+ * Returns the default ghost configuration from SupportedGhostParameters.+ * Only includes parameters with non-empty defaults.+ */+export const getDefaultGhostFlags = (): Record<string, string> => {+ const defaults: Record<string, string> = {};+ for (const param of SupportedGhostParameters) {+ if (param.defaults !== "") {+ defaults[param.key] = param.defaults;+ }+ }+ return defaults;+};diff --git a/frontend/src/components/Plan/components/Configuration/GhostSection/GhostFlagsPanel.vue b/frontend/src/components/Plan/components/Configuration/GhostSection/GhostFlagsPanel.vueindex 8ab8c17e65..b426eaec57 100644--- a/frontend/src/components/Plan/components/Configuration/GhostSection/GhostFlagsPanel.vue+++ b/frontend/src/components/Plan/components/Configuration/GhostSection/GhostFlagsPanel.vue@@ -7,7 +7,7 @@<template #default><div class="flex flex-col gap-y-4"><p class="font-medium text-control">- {{ $t("task.online-migration.gho\st-parameters") }}+ {{ $t("task.online-migration.ghost-parameters") }}<LearnMoreLinkclass="text-sm ml-1"url="https://github.com/github/gh-ost/blob/master/doc/command-line-flags.md"@@ -36,17 +36,22 @@</template><script setup lang="ts">-import { create } from "@bufbuild/protobuf";import { cloneDeep, isEqual } from "lodash-es";import { NButton, NTooltip } from "naive-ui";import { computed, ref, watch } from "vue";import { useI18n } from "vue-i18n";import LearnMoreLink from "@/components/LearnMoreLink.vue";import ErrorList from "@/components/misc/ErrorList.vue";+import { updateSpecSheetWithStatement } from "@/components/Plan/logic";import { Drawer, DrawerContent } from "@/components/v2";-import { planServiceClientConnect } from "@/connect";import { pushNotification } from "@/store";-import { UpdatePlanRequestSchema } from "@/types/proto-es/v1/plan_service_pb";+import { setSheetStatement } from "@/utils";+import { useSelectedSpec } from "../../SpecDetailView/context";+import {+ getGhostConfig,+ updateGhostConfig,+} from "../../StatementSection/directiveUtils";+import { useSpecSheet } from "../../StatementSection/useSpecSheet";import { useGhostSettingContext } from "./context";import FlagsForm from "./FlagsForm";@@ -59,22 +64,26 @@ const emits = defineEmits<{}>();const { t } = useI18n();-const { isCreating, allowChange, plan, selectedSpec, events } =- useGhostSettingContext();+const { isCreating, allowChange, plan, events } = useGhostSettingContext();+const { selectedSpec } = useSelectedSpec();+const { sheet, sheetStatement, sheetReady } = useSpecSheet(selectedSpec);const title = computed(() => {return t("task.online-migration.configure-ghost-parameters");});-const config = computed(() => {- return selectedSpec.value?.config?.case === "changeDatabaseConfig"- ? selectedSpec.value.config.value- : undefined;-});+const flags = ref<Record<string, string>>({});+// Get current flags from sheet directive+const currentFlags = computed(() => {+ if (!sheetReady.value) return {};+ return getGhostConfig(sheetStatement.value) ?? {};+});+const isDirty = computed(() => {- return !isEqual(config.value?.ghostFlags ?? {}, flags.value);+ return !isEqual(currentFlags.value, flags.value);});+const errors = computed(() => {const errors: string[] = [];if (!isDirty.value) {@@ -89,7 +98,7 @@ const readonly = computed(() => {});const close = () => {- flags.value = cloneDeep(config.value?.ghostFlags ?? {});+ flags.value = cloneDeep(currentFlags.value);emits("update:show", false);};@@ -98,31 +107,22 @@ const trySave = async () => {return;}+ const updatedStatement = updateGhostConfig(+ sheetStatement.value,+ cloneDeep(flags.value)+ );+if (isCreating.value) {- if (- !selectedSpec.value ||- selectedSpec.value.config?.case !== "changeDatabaseConfig"- )- return;- selectedSpec.value.config.value.ghostFlags = cloneDeep(flags.value);+ // When creating a plan, update the local sheet directly.+ if (!sheet.value) return;+ setSheetStatement(sheet.value, updatedStatement);} else {- const planPatch = cloneDeep(plan.value);- const spec = (planPatch?.specs || []).find((spec) => {- return spec.id === selectedSpec.value?.id;- });- if (!planPatch || !spec || spec.config?.case !== "changeDatabaseConfig") {- // Should not reach here.- throw new Error(- "Plan or spec is not defined. Cannot update gh-ost flags."- );- }-- spec.config.value.ghostFlags = cloneDeep(flags.value);- const request = create(UpdatePlanRequestSchema, {- plan: planPatch,- updateMask: { paths: ["specs"] },- });- await planServiceClientConnect.updatePlan(request);+ // For created plans, create new sheet and update plan/spec+ await updateSpecSheetWithStatement(+ plan.value,+ selectedSpec.value,+ updatedStatement+ );events.emit("update");pushNotification({module: "bytebase",@@ -134,12 +134,12 @@ const trySave = async () => {};watch(- () => config.value?.ghostFlags,+ currentFlags,(newFlags, oldFlags) => {if (isEqual(newFlags, oldFlags)) {return;}- flags.value = cloneDeep(newFlags ?? {});+ flags.value = cloneDeep(newFlags);},{ immediate: true, deep: true });diff --git a/frontend/src/components/Plan/components/Configuration/GhostSection/GhostSection.vue b/frontend/src/components/Plan/components/Configuration/GhostSection/GhostSection.vueindex d8186f6c31..acd1b86fa2 100644--- a/frontend/src/components/Plan/components/Configuration/GhostSection/GhostSection.vue+++ b/frontend/src/components/Plan/components/Configuration/GhostSection/GhostSection.vue@@ -45,8 +45,11 @@<script lang="ts" setup>import { WrenchIcon } from "lucide-vue-next";import { NButton } from "naive-ui";-import { ref } from "vue";+import { computed, ref } from "vue";import LearnMoreLink from "@/components/LearnMoreLink.vue";+import { useSelectedSpec } from "../../SpecDetailView/context";+import { isGhostEnabled } from "../../StatementSection/directiveUtils";+import { useSpecSheet } from "../../StatementSection/useSpecSheet";import OptionRow from "../OptionRow.vue";import { useGhostSettingContext } from "./context";import GhostFlagsPanel from "./GhostFlagsPanel.vue";@@ -54,5 +57,12 @@ import GhostSwitch from "./GhostSwitch.vue";const showFlagsPanel = ref(false);-const { allowChange, enabled } = useGhostSettingContext();+const { allowChange } = useGhostSettingContext();+const { selectedSpec } = useSelectedSpec();+const { sheetStatement, sheetReady } = useSpecSheet(selectedSpec);++const enabled = computed(() => {+ if (!sheetReady.value) return false;+ return isGhostEnabled(sheetStatement.value);+});</script>diff --git a/frontend/src/components/Plan/components/Configuration/GhostSection/GhostSwitch.vue b/frontend/src/components/Plan/components/Configuration/GhostSection/GhostSwitch.vueindex 8f7fc95f9e..e33d896d2c 100644--- a/frontend/src/components/Plan/components/Configuration/GhostSection/GhostSwitch.vue+++ b/frontend/src/components/Plan/components/Configuration/GhostSection/GhostSwitch.vue@@ -26,32 +26,39 @@</template><script setup lang="tsx">-import { create } from "@bufbuild/protobuf";-import { cloneDeep } from "lodash-es";import { NSwitch, NTooltip } from "naive-ui";import { computed } from "vue";import { useI18n } from "vue-i18n";import LearnMoreLink from "@/components/LearnMoreLink.vue";import type { ErrorItem } from "@/components/misc/ErrorList.vue";import { default as ErrorList } from "@/components/misc/ErrorList.vue";-import { targetsForSpec } from "@/components/Plan/logic";-import { planServiceClientConnect } from "@/connect";+import {+ targetsForSpec,+ updateSpecSheetWithStatement,+} from "@/components/Plan/logic";import { pushNotification } from "@/store";-import { UpdatePlanRequestSchema } from "@/types/proto-es/v1/plan_service_pb";-import { extractDatabaseResourceName } from "@/utils";+import { extractDatabaseResourceName, setSheetStatement } from "@/utils";+import { useSelectedSpec } from "../../SpecDetailView/context";+import {+ getDefaultGhostConfig,+ getGhostConfig,+ isGhostEnabled,+ updateGhostConfig,+} from "../../StatementSection/directiveUtils";+import { useSpecSheet } from "../../StatementSection/useSpecSheet";import { allowGhostForDatabase } from "./common";import { useGhostSettingContext } from "./context";const { t } = useI18n();-const {- isCreating,- plan,- selectedSpec,- allowChange,- enabled,- events,- databases,-} = useGhostSettingContext();+const { isCreating, plan, allowChange, events, databases } =+ useGhostSettingContext();+const { selectedSpec } = useSelectedSpec();+const { sheet, sheetStatement, sheetReady } = useSpecSheet(selectedSpec);++const enabled = computed(() => {+ if (!sheetReady.value) return false;+ return isGhostEnabled(sheetStatement.value);+});const errors = computed(() => {const errors: ErrorItem[] = [];@@ -136,31 +143,26 @@ const toggleChecked = async (on: boolean) => {return;}+ // Get current ghost config from sheet (to preserve flags when enabling)+ const currentConfig = on+ ? (getGhostConfig(sheetStatement.value) ?? getDefaultGhostConfig())+ : undefined;+ const updatedStatement = updateGhostConfig(+ sheetStatement.value,+ currentConfig+ );+if (isCreating.value) {- if (- !selectedSpec.value ||- selectedSpec.value.config?.case !== "changeDatabaseConfig"- )- return;- selectedSpec.value.config.value.enableGhost = on;+ // When creating a plan, update the local sheet directly.+ if (!sheet.value) return;+ setSheetStatement(sheet.value, updatedStatement);} else {- const planPatch = cloneDeep(plan.value);- const spec = (planPatch?.specs || []).find((spec) => {- return spec.id === selectedSpec.value?.id;- });- if (!planPatch || !spec || spec.config?.case !== "changeDatabaseConfig") {- // Should not reach here.- throw new Error(- "Plan or spec is not defined. Cannot update gh-ost setting."- );- }-- spec.config.value.enableGhost = on;- const request = create(UpdatePlanRequestSchema, {- plan: planPatch,- updateMask: { paths: ["specs"] },- });- await planServiceClientConnect.updatePlan(request);+ // For created plans, create new sheet and update plan/spec+ await updateSpecSheetWithStatement(+ plan.value,+ selectedSpec.value,+ updatedStatement+ );events.emit("update");pushNotification({module: "bytebase",diff --git a/frontend/src/components/Plan/components/Configuration/GhostSection/common.ts b/frontend/src/components/Plan/components/Configuration/GhostSection/common.tsindex 8e6ea0904c..95c4b7d797 100644--- a/frontend/src/components/Plan/components/Configuration/GhostSection/common.ts+++ b/frontend/src/components/Plan/components/Configuration/GhostSection/common.ts@@ -1,7 +1,5 @@-import { isDBGroupChangeSpec } from "@/components/Plan/logic";import { Engine } from "@/types/proto-es/v1/common_pb";import type { Database } from "@/types/proto-es/v1/database_service_pb";-import { type Plan_Spec } from "@/types/proto-es/v1/plan_service_pb";import { getInstanceResource, semverCompare } from "@/utils";export const GHOST_AVAILABLE_ENGINES = [Engine.MYSQL, Engine.MARIADB];@@ -28,24 +26,3 @@ export const allowGhostForDatabase = (database: Database) => {)));};--export const getGhostEnabledForSpec = (- spec: Plan_Spec-): boolean | undefined => {- if (isDBGroupChangeSpec(spec)) {- return undefined;- }- const config =- spec?.config?.case === "changeDatabaseConfig"- ? spec.config.value- : undefined;- if (!config) {- return undefined;- }- // Ghost is only available for sheet-based migrations (not release-based).- // Release-based migrations don't support ghost configuration.- if (!config.release) {- return config.enableGhost === true;- }- return undefined;-};diff --git a/frontend/src/components/Plan/components/Configuration/GhostSection/context.ts b/frontend/src/components/Plan/components/Configuration/GhostSection/context.tsindex 9a175869a1..ab6b35cd00 100644--- a/frontend/src/components/Plan/components/Configuration/GhostSection/context.ts+++ b/frontend/src/components/Plan/components/Configuration/GhostSection/context.ts@@ -5,8 +5,8 @@ import { targetsForSpec } from "@/components/Plan/logic";import { useDatabaseV1Store } from "@/store";import { isValidDatabaseName } from "@/types";import type { Plan, Plan_Spec } from "@/types/proto-es/v1/plan_service_pb";-import { getInstanceResource, isNullOrUndefined } from "@/utils";-import { GHOST_AVAILABLE_ENGINES, getGhostEnabledForSpec } from "./common";+import { getInstanceResource } from "@/utils";+import { GHOST_AVAILABLE_ENGINES } from "./common";export const KEY = Symbol("bb.plan.setting.gh-ost"@@ -40,20 +40,22 @@ export const provideGhostSettingContext = (refs: {});const shouldShow = computed(() => {- return (- selectedSpec.value &&- databases.value.every((db) =>- GHOST_AVAILABLE_ENGINES.includes(getInstanceResource(db).engine)- ) &&- !isNullOrUndefined(getGhostEnabledForSpec(selectedSpec.value))- );- });+ if (!selectedSpec.value) return false;- const enabled = computed(() => {- return (- (selectedSpec.value && getGhostEnabledForSpec(selectedSpec.value)) ||- false+ // Check if all databases support ghost (engine check)+ const allDatabasesSupportGhost = databases.value.every((db) =>+ GHOST_AVAILABLE_ENGINES.includes(getInstanceResource(db).engine));+ if (!allDatabasesSupportGhost) return false;++ // Check if this is a change database config+ if (selectedSpec.value.config?.case !== "changeDatabaseConfig") {+ return false;+ }+ const config = selectedSpec.value.config.value;+ // Show for sheet-based migrations only (not release-based).+ // Release-based migrations don't support ghost configuration.+ return !config.release;});const context = {@@ -62,7 +64,6 @@ export const provideGhostSettingContext = (refs: {plan,shouldShow,allowChange,- enabled,databases,events,};diff --git a/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckButton.vue b/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckButton.vueindex 0c7467398f..3aef6a557f 100644--- a/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckButton.vue+++ b/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckButton.vue@@ -73,7 +73,6 @@ import {import type { Defer, VueStyle } from "@/utils";import { defer } from "@/utils";import { useSpecSheet } from "../StatementSection/useSpecSheet";-import { getSpecChangeType } from "./common";import { usePlanSQLCheckContext } from "./context";withDefaults(@@ -102,8 +101,6 @@ const advices = computed(() => {return checkResult.value?.results.flatMap((r) => r.advices);});-const migrationType = computed(() => getSpecChangeType(selectedSpec.value));-const statementErrors = asyncComputed(async () => {if (sheetStatement.value.length === 0) {return [t("issue.sql-check.statement-is-required")];@@ -123,8 +120,8 @@ const runCheckInternal = async (statement: string) => {{// Use "0" for dummy version.version: "0",+ // Ghost directive (-- ghost = {...}) is embedded in the statement if enabledstatement: new TextEncoder().encode(statement),- enableGhost: migrationType.value,},],},diff --git a/frontend/src/components/Plan/components/SQLCheckSection/common.ts b/frontend/src/components/Plan/components/SQLCheckSection/common.tsdeleted file mode 100644index 30efad2fc3..0000000000--- a/frontend/src/components/Plan/components/SQLCheckSection/common.ts+++ /dev/null@@ -1,13 +0,0 @@-import type { Plan_Spec } from "@/types/proto-es/v1/plan_service_pb";--export const getSpecChangeType = (spec?: Plan_Spec): boolean => {- const changeDatabaseConfig =- spec?.config?.case === "changeDatabaseConfig"- ? spec.config.value- : undefined;- // Ghost is only available for sheet-based migrations (not release-based).- if (changeDatabaseConfig && !changeDatabaseConfig.release) {- return changeDatabaseConfig.enableGhost === true;- }- return false;-};diff --git a/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vue b/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vueindex de7212417f..8c94815892 100644--- a/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vue+++ b/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vue@@ -212,6 +212,7 @@ const runChecks = async () => {const targets = targetsForSpec(selectedSpec.value);// Run check for all targets+ // Ghost directive (-- ghost = {...}) is embedded in the statement if enabledconst request = create(CheckReleaseRequestSchema, {parent: `${projectNamePrefix}${extractProjectResourceName(plan.value.name)}`,release: {@@ -221,7 +222,6 @@ const runChecks = async () => {// Use "0" for dummy version.version: "0",statement: new TextEncoder().encode(statement),- enableGhost: !config.release && config.enableGhost,},],},diff --git a/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue b/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vueindex 99328913ce..bd6c616c60 100644--- a/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue+++ b/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue@@ -231,6 +231,7 @@ import {} from "@/utils";import { engineSupportsSchemaEditor } from "@/utils/schemaEditor";import { useSelectedSpec } from "../../SpecDetailView/context";+import { isGhostEnabled } from "../directiveUtils";import SchemaEditorDrawer from "../SchemaEditorDrawer.vue";import { useSpecSheet } from "../useSpecSheet";import { useSQLAdviceMarkers } from "../useSQLAdviceMarkers";@@ -369,9 +370,9 @@ const shouldShowSchemaEditorButton = computed(() => {return false;}- // Now TypeScript knows config.value is Plan_ChangeDatabaseConfig// Only for regular DDL (not gh-ost) schema changes- if (spec.config.value.enableGhost) {+ // Check if ghost is enabled via sheet directive+ if (isGhostEnabled(sheetStatement.value)) {return false;}diff --git a/frontend/src/components/Plan/components/StatementSection/ReleaseView/ReleaseView.vue b/frontend/src/components/Plan/components/StatementSection/ReleaseView/ReleaseView.vueindex ba52dc2d51..fdbcb7f438 100644--- a/frontend/src/components/Plan/components/StatementSection/ReleaseView/ReleaseView.vue+++ b/frontend/src/components/Plan/components/StatementSection/ReleaseView/ReleaseView.vue@@ -78,10 +78,7 @@><div class="flex-1 min-w-0 mr-2"><div class="font-medium truncate">{{ file.path }}</div>- <div class="text-gray-500">- {{ file.version }} •- {{ getChangeTypeText(file.enableGhost) }}- </div>+ <div class="text-gray-500">{{ file.version }}</div></div><divv-if="release.type"@@ -197,12 +194,6 @@ const displayedFiles = computed(() => {return release.value.files.slice(0, maxDisplayedFiles);});-const getChangeTypeText = (enableGhost: boolean) => {- return enableGhost- ? t("release.change-type.ddl-ghost")- : t("release.change-type.ddl");-};-const getReleaseFileTypeText = (fileType: Release_Type) => {switch (fileType) {case Release_Type.VERSIONED:diff --git a/frontend/src/components/Plan/components/StatementSection/directiveUtils.ts b/frontend/src/components/Plan/components/StatementSection/directiveUtils.tsindex 6f7eb4ea07..5c72da7ce7 100644--- a/frontend/src/components/Plan/components/StatementSection/directiveUtils.ts+++ b/frontend/src/components/Plan/components/StatementSection/directiveUtils.ts@@ -21,6 +21,11 @@ const TXN_ISOLATION_REGEX =const ROLE_SETTER_REGEX =/\/\*\s*=== Bytebase Role Setter\. DO NOT EDIT\. === \*\/\s*SET ROLE ([a-zA-Z_][a-zA-Z0-9_]{0,62});/;+// Ghost configuration directive pattern+// Matches: -- gh-ost = {"key":"value",...} or -- gh-ost = {} /*comment*/+const GHOST_DIRECTIVE_REGEX =+ /^\s*--\s*gh-ost\s*=\s*(\{[^}]*\})\s*(?:\/\*.*\*\/)?\s*$/i;+export type IsolationLevel =| "READ_UNCOMMITTED"| "READ_COMMITTED"@@ -32,6 +37,8 @@ export interface ParsedStatement {transactionMode?: "on" | "off";// Line 2 directive (isolation level, only valid when txn-mode is on)isolationLevel?: IsolationLevel;+ // Ghost configuration (JSON object with gh-ost flags)+ ghostConfig?: Record<string, string>;// Role setter block if presentroleSetterBlock?: string;// The main SQL content (everything except directives and role setter)@@ -81,6 +88,18 @@ export function parseStatement(statement: string): ParsedStatement {directiveLines.add(i);continue;}++ // Check for ghost directive+ const ghostMatch = line.match(GHOST_DIRECTIVE_REGEX);+ if (ghostMatch) {+ try {+ result.ghostConfig = JSON.parse(ghostMatch[1]);+ } catch {+ // Invalid JSON, treat as regular comment+ }+ directiveLines.add(i);+ continue;+ }}// Build remaining content without directive lines@@ -124,6 +143,19 @@ export function buildStatement(components: ParsedStatement): string {parts.push(`-- txn-isolation = ${isolation}`);}+ // Ghost directive+ if (components.ghostConfig !== undefined) {+ if (Object.keys(components.ghostConfig).length === 0) {+ parts.push(`-- gh-ost = {} /* using default config */`);+ } else {+ parts.push(+ `-- gh-ost = ${JSON.stringify(+ components.ghostConfig+ )} /* merges with default config */`+ );+ }+ }+// Role setter block (if present) - place it before main contentif (components.roleSetterBlock) {parts.push(components.roleSetterBlock);@@ -178,3 +210,43 @@ export function updateRoleSetter(return buildStatement(parsed);}++/**+ * Updates the ghost configuration in a statement while preserving other components.+ * Pass undefined to remove ghost config, or an empty object {} to enable ghost with no flags.+ */+export function updateGhostConfig(+ statement: string,+ config: Record<string, string> | undefined+): string {+ const parsed = parseStatement(statement);+ parsed.ghostConfig = config;+ return buildStatement(parsed);+}++/**+ * Gets the ghost configuration from a statement.+ * Returns undefined if no ghost directive is present.+ */+export function getGhostConfig(+ statement: string+): Record<string, string> | undefined {+ const parsed = parseStatement(statement);+ return parsed.ghostConfig;+}++/**+ * Checks if ghost is enabled for a statement (directive is present).+ */+export function isGhostEnabled(statement: string): boolean {+ const parsed = parseStatement(statement);+ return parsed.ghostConfig !== undefined;+}++/**+ * Returns the default ghost configuration.+ * Empty object {} means "use default config" - will be rendered as -- gh-ost = {} /*default config*\/+ */+export function getDefaultGhostConfig(): Record<string, string> {+ return {};+}diff --git a/frontend/src/components/Plan/logic/initialize/create.ts b/frontend/src/components/Plan/logic/initialize/create.tsindex 0e6fcc806b..0d5c48fb19 100644--- a/frontend/src/components/Plan/logic/initialize/create.ts+++ b/frontend/src/components/Plan/logic/initialize/create.ts@@ -110,7 +110,6 @@ const buildSpecForTargetsV1 = async (value: createProto(Plan_ChangeDatabaseConfigSchema, {targets,sheet,- enableGhost: false,enablePriorBackup: project.autoEnableBackup,}),};diff --git a/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabasePanel.vue b/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabasePanel.vueindex 4d6b4c7b17..87442cac1e 100644--- a/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabasePanel.vue+++ b/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabasePanel.vue@@ -105,10 +105,6 @@ const handleCreate = async () => {return;}- // Determine enableGhost from release files- const firstFile = release.value.files?.[0];- const enableGhost = firstFile?.enableGhost ?? false;-const parts = release.value.name.split("/");const releaseName = parts[parts.length - 1] || release.value.name;@@ -126,8 +122,6 @@ const handleCreate = async () => {? state.targetSelectState.selectedDatabaseNameList: [state.targetSelectState.selectedDatabaseGroup!]) || [],release: release.value.name,-- enableGhost,}),},},diff --git a/frontend/src/components/Release/ReleaseDetail/ReleaseFileTable/ReleaseFileTable.vue b/frontend/src/components/Release/ReleaseDetail/ReleaseFileTable/ReleaseFileTable.vueindex 57915d300b..dd76ee04e9 100644--- a/frontend/src/components/Release/ReleaseDetail/ReleaseFileTable/ReleaseFileTable.vue+++ b/frontend/src/components/Release/ReleaseDetail/ReleaseFileTable/ReleaseFileTable.vue@@ -86,14 +86,13 @@ const columnList = computed(() => {return columns.filter((column) => !column.hide);});-const getReleaseFileTypeText = (file: Release_File) => {+const getReleaseFileTypeText = (_file: Release_File) => {switch (props.releaseType) {case Release_Type.DECLARATIVE:return "SDL";case Release_Type.VERSIONED:- return file.enableGhost- ? `${t("issue.title.change-database")} (gh-ost)`- : t("issue.title.change-database");+ // Ghost configuration is now in sheet content via directive (-- ghost = {...})+ return t("issue.title.change-database");case Release_Type.TYPE_UNSPECIFIED:return "";default:diff --git a/frontend/src/components/RolloutV1/components/ReleaseInfoCard.vue b/frontend/src/components/RolloutV1/components/ReleaseInfoCard.vueindex 0f6527828b..d1766e695d 100644--- a/frontend/src/components/RolloutV1/components/ReleaseInfoCard.vue+++ b/frontend/src/components/RolloutV1/components/ReleaseInfoCard.vue@@ -73,10 +73,7 @@><div class="flex-1 min-w-0 mr-2"><div class="font-medium truncate">{{ file.path }}</div>- <div class="text-gray-500">- {{ file.version }} •- {{ getChangeTypeText(file.enableGhost) }}- </div>+ <div class="text-gray-500">{{ file.version }}</div></div><divv-if="release.type"@@ -189,12 +186,6 @@ const displayedFiles = computed(() => {return release.value.files.slice(0, maxDisplayedFiles.value);});-const getChangeTypeText = (enableGhost: boolean) => {- return enableGhost- ? t("release.change-type.ddl-ghost")- : t("release.change-type.ddl");-};-const getReleaseFileTypeText = (fileType: Release_Type) => {switch (fileType) {case Release_Type.VERSIONED:diff --git a/frontend/src/components/RolloutV1/components/TaskRunRollbackDrawer.vue b/frontend/src/components/RolloutV1/components/TaskRunRollbackDrawer.vueindex dd901e2fee..434da86982 100644--- a/frontend/src/components/RolloutV1/components/TaskRunRollbackDrawer.vue+++ b/frontend/src/components/RolloutV1/components/TaskRunRollbackDrawer.vue@@ -310,8 +310,6 @@ const handleConfirm = async () => {case: "changeDatabaseConfig",value: create(Plan_ChangeDatabaseConfigSchema, {targets: [preview.task.target],-- enableGhost: false,sheet: sheet.name,}),},diff --git a/frontend/src/components/SQLCheck/SQLCheckButton.vue b/frontend/src/components/SQLCheck/SQLCheckButton.vueindex 04a720cc63..a6bd6cb3ff 100644--- a/frontend/src/components/SQLCheck/SQLCheckButton.vue+++ b/frontend/src/components/SQLCheck/SQLCheckButton.vue@@ -104,7 +104,6 @@ const props = withDefaults(databaseMetadata?: DatabaseMetadata;buttonProps?: ButtonProps;buttonStyle?: VueStyle;- enableGhost?: boolean;showCodeLocation?: boolean;ignoreIssueCreationRestriction?: boolean;adviceFilter?: (advices: Advice, index: number) => boolean;@@ -113,7 +112,6 @@ const props = withDefaults(databaseMetadata: undefined,buttonProps: undefined,buttonStyle: undefined,- changeType: undefined,showCodeLocation: undefined,ignoreIssueCreationRestriction: false,adviceFilter: undefined,@@ -157,7 +155,7 @@ const statementErrors = asyncComputed(async () => {}, []);const runCheckInternal = async (statement: string) => {- const { database, enableGhost } = props;+ const { database } = props;const request = create(CheckReleaseRequestSchema, {parent: database.project,release: {@@ -166,8 +164,8 @@ const runCheckInternal = async (statement: string) => {{// Use "0" for dummy version.version: "0",+ // Ghost directive (-- ghost = {...}) is embedded in the statement if enabledstatement: new TextEncoder().encode(statement),- enableGhost: enableGhost ?? false,},],},diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex 6a3f24f943..b92151f08e 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -2759,10 +2759,6 @@"vcs-source": "VCS Source","view-all-files": "View all files","and-n-more-files": "and {n} more files",- "change-type": {- "ddl": "DDL",- "ddl-ghost": "DDL Ghost"- },"file-type": {"versioned": "Versioned","declarative": "Declarative",diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex 0e0acc3c90..d65d9c9ae1 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -2759,10 +2759,6 @@"vcs-source": "Fuente VCS","view-all-files": "Ver todos los archivos","and-n-more-files": "y {n} archivos más",- "change-type": {- "ddl": "DDL",- "ddl-ghost": "Fantasma DDL"- },"file-type": {"versioned": "Versión","declarative": "Declarativo",diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.jsonindex b8fb7b4d56..60a718a997 100644--- a/frontend/src/locales/ja-JP.json+++ b/frontend/src/locales/ja-JP.json@@ -2759,10 +2759,6 @@"vcs-source": "VCSソース","view-all-files": "すべてのファイルを表示","and-n-more-files": "および{n}個のファイル",- "change-type": {- "ddl": "DDL",- "ddl-ghost": "DDLゴースト"- },"file-type": {"versioned": "バージョン","declarative": "宣言",diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.jsonindex 59b035f0d8..a4ae0b9572 100644--- a/frontend/src/locales/vi-VN.json+++ b/frontend/src/locales/vi-VN.json@@ -2759,10 +2759,6 @@"vcs-source": "Nguồn VCS","view-all-files": "Xem tất cả các tập tin","and-n-more-files": "và {n} tập tin khác",- "change-type": {- "ddl": "DDL",- "ddl-ghost": "DDL Ma"- },"file-type": {"versioned": "Phiên bản","declarative": "Khai báo",diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex 7cccd099c8..f26bdcfd2e 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -2759,10 +2759,6 @@"vcs-source": "VCS 源","view-all-files": "查看全部文件","and-n-more-files": "还有 {count} 个文件",- "change-type": {- "ddl": "DDL",- "ddl-ghost": "DDL Ghost"- },"file-type": {"versioned": "版本化","declarative": "声明式",diff --git a/frontend/src/types/proto-es/v1/plan_service_pb.d.ts b/frontend/src/types/proto-es/v1/plan_service_pb.d.tsindex 20b8e3959b..007e6eb665 100644--- a/frontend/src/types/proto-es/v1/plan_service_pb.d.ts+++ b/frontend/src/types/proto-es/v1/plan_service_pb.d.ts@@ -419,24 +419,12 @@ export declare type Plan_ChangeDatabaseConfig = Message<"bytebase.v1.Plan.Change*/release: string;- /**- * @generated from field: map<string, string> ghost_flags = 5;- */- ghostFlags: { [key: string]: string };-/*** If set, a backup of the modified data will be created automatically before any changes are applied.** @generated from field: bool enable_prior_backup = 6;*/enablePriorBackup: boolean;-- /**- * Whether to use gh-ost for online schema migration.- *- * @generated from field: bool enable_ghost = 7;- */- enableGhost: boolean;};/**diff --git a/frontend/src/types/proto-es/v1/plan_service_pb.js b/frontend/src/types/proto-es/v1/plan_service_pb.jsindex f630cb904d..96e304f1e9 100644--- a/frontend/src/types/proto-es/v1/plan_service_pb.js+++ b/frontend/src/types/proto-es/v1/plan_service_pb.js@@ -17,7 +17,7 @@ import { file_v1_sql_service } from "./sql_service_pb";* Describes the file v1/plan_service.proto.*/export const file_v1_plan_service = /*@__PURE__*/- fileDesc("ChV2MS9wbGFuX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIjkKDkdldFBsYW5SZXF1ZXN0EicKBG5hbWUYASABKAlCGeBBAvpBEwoRYnl0ZWJhc2UuY29tL1BsYW4idwoQTGlzdFBsYW5zUmVxdWVzdBIsCgZwYXJlbnQYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1Byb2plY3QSEQoJcGFnZV9zaXplGAIgASgFEhIKCnBhZ2VfdG9rZW4YAyABKAkSDgoGZmlsdGVyGAQgASgJIk4KEUxpc3RQbGFuc1Jlc3BvbnNlEiAKBXBsYW5zGAEgAygLMhEuYnl0ZWJhc2UudjEuUGxhbhIXCg9uZXh0X3BhZ2VfdG9rZW4YAiABKAkiZwoRQ3JlYXRlUGxhblJlcXVlc3QSLAoGcGFyZW50GAEgASgJQhzgQQL6QRYKFGJ5dGViYXNlLmNvbS9Qcm9qZWN0EiQKBHBsYW4YAiABKAsyES5ieXRlYmFzZS52MS5QbGFuQgPgQQIihgEKEVVwZGF0ZVBsYW5SZXF1ZXN0EiQKBHBsYW4YASABKAsyES5ieXRlYmFzZS52MS5QbGFuQgPgQQISNAoLdXBkYXRlX21hc2sYAiABKAsyGi5nb29nbGUucHJvdG9idWYuRmllbGRNYXNrQgPgQQISFQoNYWxsb3dfbWlzc2luZxgDIAEoCCL7CgoEUGxhbhIMCgRuYW1lGAEgASgJEiEKBXN0YXRlGAIgASgOMhIuYnl0ZWJhc2UudjEuU3RhdGUSEgoFaXNzdWUYAyABKAlCA+BBAxIXCgV0aXRsZRgFIAEoCUII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qZWN0cy8qL3BsYW5zLyp9EqgBCg9HZXRQbGFuQ2hlY2tSdW4SIy5ieXRlYmFzZS52MS5HZXRQbGFuQ2hlY2tSdW5SZXF1ZXN0GhkuYnl0ZWJhc2UudjEuUGxhbkNoZWNrUnVuIlXaQQRuYW1liuowFGJiLnBsYW5DaGVja1J1bnMuZ2V0kOowAYLT5JMCLBIqL3YxL3tuYW1lPXByb2plY3RzLyovcGxhbnMvKi9wbGFuQ2hlY2tSdW59ErEBCg1SdW5QbGFuQ2hlY2tzEiEuYnl0ZWJhc2UudjEuUnVuUGxhbkNoZWNrc1JlcXVlc3QaIi5ieXRlYmFzZS52MS5SdW5QbGFuQ2hlY2tzUmVzcG9uc2UiWdpBBG5hbWWK6jAUYmIucGxhbkNoZWNrUnVucy5ydW6Q6jABgtPkkwIwOgEqIisvdjEve25hbWU9cHJvamVjdHMvKi9wbGFucy8qfTpydW5QbGFuQ2hlY2tzEsYBChJDYW5jZWxQbGFuQ2hlY2tSdW4SJi5ieXRlYmFzZS52MS5DYW5jZWxQbGFuQ2hlY2tSdW5SZXF1ZXN0GicuYnl0ZWJhc2UudjEuQ2FuY2VsUGxhbkNoZWNrUnVuUmVzcG9uc2UiX9pBBG5hbWWK6jAUYmIucGxhbkNoZWNrUnVucy5ydW6Q6jABgtPkkwI2OgEqIjEvdjEve25hbWU9cHJvamVjdHMvKi9wbGFucy8qL3BsYW5DaGVja1J1bn06Y2FuY2VsQqYBCg9jb20uYnl0ZWJhc2UudjFCEFBsYW5TZXJ2aWNlUHJvdG9QAVo0Z2l0aHViLmNvbS9ieXRlYmFzZS9ieXRlYmFzZS9iYWNrZW5kL2dlbmVyYXRlZC1nby92MaICA0JYWKoCC0J5dGViYXNlLlYxygILQnl0ZWJhc2VcVjHiAhdCeXRlYmFzZVxWMVxHUEJNZXRhZGF0YeoCDEJ5dGViYXNlOjpWMWIGcHJvdG8z", [file_buf_validate_validate, file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_sql_service]);+ fileDesc("ChV2MS9wbGFuX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIjkKDkdldFBsYW5SZXF1ZXN0EicKBG5hbWUYASABKAlCGeBBAvpBEwoRYnl0ZWJhc2UuY29tL1BsYW4idwoQTGlzdFBsYW5zUmVxdWVzdBIsCgZwYXJlbnQYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1Byb2plY3QSEQoJcGFnZV9zaXplGAIgASgFEhIKCnBhZ2VfdG9rZW4YAyABKAkSDgoGZmlsdGVyGAQgASgJIk4KEUxpc3RQbGFuc1Jlc3BvbnNlEiAKBXBsYW5zGAEgAygLMhEuYnl0ZWJhc2UudjEuUGxhbhIXCg9uZXh0X3BhZ2VfdG9rZW4YAiABKAkiZwoRQ3JlYXRlUGxhblJlcXVlc3QSLAoGcGFyZW50GAEgASgJQhzgQQL6QRYKFGJ5dGViYXNlLmNvbS9Qcm9qZWN0EiQKBHBsYW4YAiABKAsyES5ieXRlYmFzZS52MS5QbGFuQgPgQQIihgEKEVVwZGF0ZVBsYW5SZXF1ZXN0EiQKBHBsYW4YASABKAsyES5ieXRlYmFzZS52MS5QbGFuQgPgQQISNAoLdXBkYXRlX21hc2sYAiABKAsyGi5nb29nbGUucHJvdG9idWYuRmllbGRNYXNrQgPgQQISFQoNYWxsb3dfbWlzc2luZxgDIAEoCCLkCQoEUGxhbhIMCgRuYW1lGAEgASgJEiEKBXN0YXRlGAIgASgOMhIuYnl0ZWJhc2UudjEuU3RhdGUSEgoFaXNzdWUYAyABKAlCA+BBAxIXCgV0aXRsZRgFIAEoCUIIukgFcgMYyAESHQoLZGVzY3JpcHRpb24YBiABKAlCCLpIBXIDGJBOEiUKBXNwZWNzGAcgAygLMhYuYnl0ZWJhc2UudjEuUGxhbi5TcGVjEhQKB2NyZWF0b3IYCCABKAlCA+BBAxI0CgtjcmVhdGVfdGltZRg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DaGVja3NSZXNwb25zZSJZ2kEEbmFtZYrqMBRiYi5wbGFuQ2hlY2tSdW5zLnJ1bpDqMAGC0+STAjA6ASoiKy92MS97bmFtZT1wcm9qZWN0cy8qL3BsYW5zLyp9OnJ1blBsYW5DaGVja3MSxgEKEkNhbmNlbFBsYW5DaGVja1J1bhImLmJ5dGViYXNlLnYxLkNhbmNlbFBsYW5DaGVja1J1blJlcXVlc3QaJy5ieXRlYmFzZS52MS5DYW5jZWxQbGFuQ2hlY2tSdW5SZXNwb25zZSJf2kEEbmFtZYrqMBRiYi5wbGFuQ2hlY2tSdW5zLnJ1bpDqMAGC0+STAjY6ASoiMS92MS97bmFtZT1wcm9qZWN0cy8qL3BsYW5zLyovcGxhbkNoZWNrUnVufTpjYW5jZWxCpgEKD2NvbS5ieXRlYmFzZS52MUIQUGxhblNlcnZpY2VQcm90b1ABWjRnaXRodWIuY29tL2J5dGViYXNlL2J5dGViYXNlL2JhY2tlbmQvZ2VuZXJhdGVkLWdvL3YxogIDQlhYqgILQnl0ZWJhc2UuVjHKAgtCeXRlYmFzZVxWMeICF0J5dGViYXNlXFYxXEdQQk1ldGFkYXRh6gIMQnl0ZWJhc2U6OlYxYgZwcm90bzM", [file_buf_validate_validate, file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_sql_service]);/*** Describes the message bytebase.v1.GetPlanRequest.diff --git a/frontend/src/types/proto-es/v1/release_service_pb.d.ts b/frontend/src/types/proto-es/v1/release_service_pb.d.tsindex e3cf5c7453..6f40a5934e 100644--- a/frontend/src/types/proto-es/v1/release_service_pb.d.ts+++ b/frontend/src/types/proto-es/v1/release_service_pb.d.ts@@ -472,13 +472,6 @@ export declare type Release_File = Message<"bytebase.v1.Release.File"> & {*/version: string;- /**- * Whether to use gh-ost for online schema migration.- *- * @generated from field: bool enable_ghost = 9;- */- enableGhost: boolean;-/*** For inputs, we must either use `sheet` or `statement`.* For outputs, we always use `sheet`. `statement` is the preview of the sheet content.diff --git a/frontend/src/types/proto-es/v1/release_service_pb.js b/frontend/src/types/proto-es/v1/release_service_pb.jsindex 64a05e62cd..98017706b4 100644--- a/frontend/src/types/proto-es/v1/release_service_pb.js+++ b/frontend/src/types/proto-es/v1/release_service_pb.js@@ -16,7 +16,7 @@ import { file_v1_sql_service } from "./sql_service_pb";* Describes the file v1/release_service.proto.*/export const file_v1_release_service = /*@__PURE__*/- fileDesc("Chh2MS9yZWxlYXNlX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIj8KEUdldFJlbGVhc2VSZXF1ZXN0EioKBG5hbWUYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1JlbGVhc2UikAEKE0xpc3RSZWxlYXNlc1JlcXVlc3QSLAoGcGFyZW50GAEgASgJQhzgQQL6QRYKFGJ5dGViYXNlLmNvbS9Qcm9qZWN0EhEKCXBhZ2Vfc2l6ZRgCIAEoBRISCgpwYWdlX3Rva2VuGAMgASgJEhQKDHNob3dfZGVsZXRlZBgEIAEoCBIOCgZmaWx0ZXIYBSABKAkiVwoUTGlzdFJlbGVhc2VzUmVzcG9uc2USJgoIcmVsZWFzZXMYASADKAsyFC5ieXRlYmFzZS52MS5SZWxlYXNlEhcKD25leHRfcGFnZV90b2tlbhgCIAEoCSKqAQoUQ3JlYXRlUmVsZWFzZVJlcXVlc3QSLAoGcGFyZW50GAEgASgJQhzgQQL6QRYKFGJ5dGViYXNlLmNvbS9Qcm9qZWN0EioKB3JlbGVhc2UYAiABKAsyFC5ieXRlYmFzZS52MS5SZWxlYXNlQgPgQQISGwoTcmVsZWFzZV9pZF90ZW1wbGF0ZRgDIAEoCRIbChNyZWxlYXNlX2lkX3RpbWV6b25lGAQgASgJInMKFFVwZGF0ZVJlbGVhc2VSZXF1ZXN0EioKB3JlbGVhc2UYASABKAsyFC5ieXRlYmFzZS52MS5SZWxlYXNlQgPgQQISLwoLdXBkYXRlX21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ZGVsZXRlEp8BCgxDaGVja1JlbGVhc2USIC5ieXRlYmFzZS52MS5DaGVja1JlbGVhc2VSZXF1ZXN0GiEuYnl0ZWJhc2UudjEuQ2hlY2tSZWxlYXNlUmVzcG9uc2UiSorqMBFiYi5yZWxlYXNlcy5jaGVja5DqMAGC0+STAis6ASoiJi92MS97cGFyZW50PXByb2plY3RzLyp9L3JlbGVhc2VzOmNoZWNrEsgBChVMaXN0UmVsZWFzZUNhdGVnb3JpZXMSKS5ieXRlYmFzZS52MS5MaXN0UmVsZWFzZUNhdGVnb3JpZXNSZXF1ZXN0GiouYnl0ZWJhc2UudjEuTGlzdFJlbGVhc2VDYXRlZ29yaWVzUmVzcG9uc2UiWNpBBnBhcmVudIrqMBBiYi5yZWxlYXNlcy5saXN0kOowAYLT5JMCMRIvL3YxL3twYXJlbnQ9cHJvamVjdHMvKn0vcmVsZWFzZXM6bGlzdENhdGVnb3JpZXNCqQEKD2NvbS5ieXRlYmFzZS52MUITUmVsZWFzZVNlcnZpY2VQcm90b1ABWjRnaXRodWIuY29tL2J5dGViYXNlL2J5dGViYXNlL2JhY2tlbmQvZ2VuZXJhdGVkLWdvL3YxogIDQlhYqgILQnl0ZWJhc2UuVjHKAgtCeXRlYmFzZVxWMeICF0J5dGViYXNlXFYxXEdQQk1ldGFkYXRh6gIMQnl0ZWJhc2U6OlYxYgZwcm90bzM", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_sql_service]);+ fileDesc("Chh2MS9yZWxlYXNlX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIj8KEUdldFJlbGVhc2VSZXF1ZXN0EioKBG5hbWUYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1JlbGVhc2UikAEKE0xpc3RSZWxlYXNlc1JlcXVlc3QSLAoGcGFyZW50GAEgASgJQhzgQQL6QRYKFGJ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tLmJ5dGViYXNlLnYxQhNSZWxlYXNlU2VydmljZVByb3RvUAFaNGdpdGh1Yi5jb20vYnl0ZWJhc2UvYnl0ZWJhc2UvYmFja2VuZC9nZW5lcmF0ZWQtZ28vdjGiAgNCWFiqAgtCeXRlYmFzZS5WMcoCC0J5dGViYXNlXFYx4gIXQnl0ZWJhc2VcVjFcR1BCTWV0YWRhdGHqAgxCeXRlYmFzZTo6VjFiBnByb3RvMw", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_sql_service]);/*** Describes the message bytebase.v1.GetReleaseRequest.diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yamlindex ce37be5aff..7d8173f100 100644--- a/proto/gen/grpc-doc/openapi.yaml+++ b/proto/gen/grpc-doc/openapi.yaml@@ -17394,33 +17394,12 @@ components:description: |-The resource name of the release.Format: projects/{project}/releases/{release}- ghostFlags:- type: object- title: ghost_flags- additionalProperties:- type: string- title: valueenablePriorBackup:type: booleantitle: enable_prior_backupdescription: If set, a backup of the modified data will be created automatically before any changes are applied.- enableGhost:- type: boolean- title: enable_ghost- description: Whether to use gh-ost for online schema migration.title: ChangeDatabaseConfigadditionalProperties: false- bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry:- type: object- properties:- key:- type: string- title: key- value:- type: string- title: value- title: GhostFlagsEntry- additionalProperties: falsebytebase.v1.Plan.CreateDatabaseConfig:type: objectproperties:@@ -18610,10 +18589,6 @@ components:type: stringtitle: versiondescription: The version identifier for the file.- enableGhost:- type: boolean- title: enable_ghost- description: Whether to use gh-ost for online schema migration.sheet:type: stringtitle: sheetdiff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex 3a015be4d2..3f2f1b2aa6 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -158,7 +158,6 @@- [store/plan.proto](#store_plan-proto)- [PlanConfig](#bytebase-store-PlanConfig)- [PlanConfig.ChangeDatabaseConfig](#bytebase-store-PlanConfig-ChangeDatabaseConfig)- - [PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry](#bytebase-store-PlanConfig-ChangeDatabaseConfig-GhostFlagsEntry)- [PlanConfig.CreateDatabaseConfig](#bytebase-store-PlanConfig-CreateDatabaseConfig)- [PlanConfig.ExportDataConfig](#bytebase-store-PlanConfig-ExportDataConfig)- [PlanConfig.Spec](#bytebase-store-PlanConfig-Spec)@@ -277,7 +276,6 @@- [store/task.proto](#store_task-proto)- [Task](#bytebase-store-Task)- - [Task.FlagsEntry](#bytebase-store-Task-FlagsEntry)- [Task.Type](#bytebase-store-Task-Type)@@ -2826,25 +2824,7 @@ Plan spec update event (tracks sheet changes to plan specs)| 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_sha256 | [string](#string) | | The SHA256 hash of the sheet content (hex-encoded). || release | [string](#string) | | The resource name of the release. Format: projects/{project}/releases/{release} |-| 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. |-| enable_ghost | [bool](#bool) | | Whether to use gh-ost for online schema migration. |-------<a name="bytebase-store-PlanConfig-ChangeDatabaseConfig-GhostFlagsEntry"></a>--### PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry----| Field | Type | Label | Description |-| ----- | ---- | ----- | ----------- |-| key | [string](#string) | | |-| value | [string](#string) | | |@@ -3530,7 +3510,6 @@ Activity type enumeration.| path | [string](#string) | | The path of the file, e.g., `2.2/V0001_create_table.sql`. || sheet_sha256 | [string](#string) | | The SHA256 hash of the sheet content (hex-encoded). || version | [string](#string) | | |-| enable_ghost | [bool](#bool) | | Whether to use gh-ost for online schema migration. |@@ -4619,24 +4598,6 @@ Task is the metadata for database operation tasks.| sheet_sha256 | [string](#string) | | The SHA256 hash of a single sheet content (hex-encoded). Used for non-release tasks. || release | [string](#string) | | The release resource name: projects/{project}/releases/{release}. Used for GitOps release-based tasks that execute multiple files. || enable_prior_backup | [bool](#bool) | | Whether to create an automatic backup before applying changes. |-| flags | [Task.FlagsEntry](#bytebase-store-Task-FlagsEntry) | repeated | Configuration flags for gh-ost migration tool. |-| enable_ghost | [bool](#bool) | | Whether to use gh-ost for online schema migration. |-------<a name="bytebase-store-Task-FlagsEntry"></a>--### Task.FlagsEntry----| Field | Type | Label | Description |-| ----- | ---- | ----- | ----------- |-| key | [string](#string) | | |-| value | [string](#string) | | |diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.htmlindex b9bae80a58..dd94bf7802 100644--- a/proto/gen/grpc-doc/store/index.html+++ b/proto/gen/grpc-doc/store/index.html@@ -797,10 +797,6 @@<a href="#bytebase.store.PlanConfig.ChangeDatabaseConfig"><span class="badge">M</span>PlanConfig.ChangeDatabaseConfig</a></li>- <li>- <a href="#bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry"><span class="badge">M</span>PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry</a>- </li>-<li><a href="#bytebase.store.PlanConfig.CreateDatabaseConfig"><span class="badge">M</span>PlanConfig.CreateDatabaseConfig</a></li>@@ -1285,10 +1281,6 @@<a href="#bytebase.store.Task"><span class="badge">M</span>Task</a></li>- <li>- <a href="#bytebase.store.Task.FlagsEntry"><span class="badge">M</span>Task.FlagsEntry</a>- </li>-<li><a href="#bytebase.store.Task.Type"><span class="badge">E</span>Task.Type</a>@@ -8359,13 +8351,6 @@ Single database group format: [projects/{project}/databaseGroups/{databaseGroup}Format: projects/{project}/releases/{release} </p></td></tr>- <tr>- <td>ghost_flags</td>- <td><a href="#bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry">PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry</a></td>- <td>repeated</td>- <td><p> </p></td>- </tr>-<tr><td>enable_prior_backup</td><td><a href="#bool">bool</a></td>@@ -8373,44 +8358,6 @@ Format: projects/{project}/releases/{release} </p></td><td><p>If set, a backup of the modified data will be created automatically before any changes are applied. </p></td></tr>- <tr>- <td>enable_ghost</td>- <td><a href="#bool">bool</a></td>- <td></td>- <td><p>Whether to use gh-ost for online schema migration. </p></td>- </tr>-- </tbody>- </table>------ <h3 id="bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry">PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry</h3>- <p></p>--- <table class="field-table">- <thead>- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>- </thead>- <tbody>-- <tr>- <td>key</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p> </p></td>- </tr>-- <tr>- <td>value</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p> </p></td>- </tr>-</tbody></table>@@ -9889,13 +9836,6 @@ IM integration setting should be set for this function to work. </p></td><td><p> </p></td></tr>- <tr>- <td>enable_ghost</td>- <td><a href="#bool">bool</a></td>- <td></td>- <td><p>Whether to use gh-ost for online schema migration. </p></td>- </tr>-</tbody></table>@@ -12704,51 +12644,6 @@ Used for GitOps release-based tasks that execute multiple files. </p></td><td><p>Whether to create an automatic backup before applying changes. </p></td></tr>- <tr>- <td>flags</td>- <td><a href="#bytebase.store.Task.FlagsEntry">Task.FlagsEntry</a></td>- <td>repeated</td>- <td><p>Configuration flags for gh-ost migration tool. </p></td>- </tr>-- <tr>- <td>enable_ghost</td>- <td><a href="#bool">bool</a></td>- <td></td>- <td><p>Whether to use gh-ost for online schema migration. </p></td>- </tr>-- </tbody>- </table>------ <h3 id="bytebase.store.Task.FlagsEntry">Task.FlagsEntry</h3>- <p></p>--- <table class="field-table">- <thead>- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>- </thead>- <tbody>-- <tr>- <td>key</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p> </p></td>- </tr>-- <tr>- <td>value</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p> </p></td>- </tr>-</tbody></table>diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex 77111aa152..07fe693fdf 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -453,7 +453,6 @@- [ListPlansResponse](#bytebase-v1-ListPlansResponse)- [Plan](#bytebase-v1-Plan)- [Plan.ChangeDatabaseConfig](#bytebase-v1-Plan-ChangeDatabaseConfig)- - [Plan.ChangeDatabaseConfig.GhostFlagsEntry](#bytebase-v1-Plan-ChangeDatabaseConfig-GhostFlagsEntry)- [Plan.CreateDatabaseConfig](#bytebase-v1-Plan-CreateDatabaseConfig)- [Plan.ExportDataConfig](#bytebase-v1-Plan-ExportDataConfig)- [Plan.PlanCheckRunStatusCountEntry](#bytebase-v1-Plan-PlanCheckRunStatusCountEntry)@@ -7568,25 +7567,7 @@ For example: creator == "users/[email protected]" && create_time &| 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} |-| ghost_flags | [Plan.ChangeDatabaseConfig.GhostFlagsEntry](#bytebase-v1-Plan-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. |-| enable_ghost | [bool](#bool) | | Whether to use gh-ost for online schema migration. |-------<a name="bytebase-v1-Plan-ChangeDatabaseConfig-GhostFlagsEntry"></a>--### Plan.ChangeDatabaseConfig.GhostFlagsEntry----| Field | Type | Label | Description |-| ----- | ---- | ----- | ----------- |-| key | [string](#string) | | |-| value | [string](#string) | | |@@ -8505,7 +8486,6 @@ A SQL file in a release.| ----- | ---- | ----- | ----------- || path | [string](#string) | | The path of the file. e.g., `2.2/V0001_create_table.sql`. || version | [string](#string) | | The version identifier for the file. |-| enable_ghost | [bool](#bool) | | Whether to use gh-ost for online schema migration. || sheet | [string](#string) | | For inputs, we must either use `sheet` or `statement`. For outputs, we always use `sheet`. `statement` is the preview of the sheet content.The sheet that holds the content. Format: projects/{project}/sheets/{sheet} |diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.htmlindex 67c6b99e4a..b4028265b7 100644--- a/proto/gen/grpc-doc/v1/index.html+++ b/proto/gen/grpc-doc/v1/index.html@@ -1907,10 +1907,6 @@<a href="#bytebase.v1.Plan.ChangeDatabaseConfig"><span class="badge">M</span>Plan.ChangeDatabaseConfig</a></li>- <li>- <a href="#bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry"><span class="badge">M</span>Plan.ChangeDatabaseConfig.GhostFlagsEntry</a>- </li>-<li><a href="#bytebase.v1.Plan.CreateDatabaseConfig"><span class="badge">M</span>Plan.CreateDatabaseConfig</a></li>@@ -21465,13 +21461,6 @@ Format: projects/{project}/sheets/{sheet} </p></td>Format: projects/{project}/releases/{release} </p></td></tr>- <tr>- <td>ghost_flags</td>- <td><a href="#bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry">Plan.ChangeDatabaseConfig.GhostFlagsEntry</a></td>- <td>repeated</td>- <td><p> </p></td>- </tr>-<tr><td>enable_prior_backup</td><td><a href="#bool">bool</a></td>@@ -21479,44 +21468,6 @@ Format: projects/{project}/releases/{release} </p></td><td><p>If set, a backup of the modified data will be created automatically before any changes are applied. </p></td></tr>- <tr>- <td>enable_ghost</td>- <td><a href="#bool">bool</a></td>- <td></td>- <td><p>Whether to use gh-ost for online schema migration. </p></td>- </tr>-- </tbody>- </table>------ <h3 id="bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry">Plan.ChangeDatabaseConfig.GhostFlagsEntry</h3>- <p></p>--- <table class="field-table">- <thead>- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>- </thead>- <tbody>-- <tr>- <td>key</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p> </p></td>- </tr>-- <tr>- <td>value</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p> </p></td>- </tr>-</tbody></table>@@ -24040,13 +23991,6 @@ Set by Bytebase action during release creation. </p></td><td><p>The version identifier for the file. </p></td></tr>- <tr>- <td>enable_ghost</td>- <td><a href="#bool">bool</a></td>- <td></td>- <td><p>Whether to use gh-ost for online schema migration. </p></td>- </tr>-<tr><td>sheet</td><td><a href="#string">string</a></td>diff --git a/proto/store/store/plan.proto b/proto/store/store/plan.protoindex 793c8cafb7..8bc6bec53c 100644--- a/proto/store/store/plan.proto+++ b/proto/store/store/plan.proto@@ -57,13 +57,8 @@ message PlanConfig {// Format: projects/{project}/releases/{release}string release = 9;- map<string, string> ghost_flags = 7;-// If set, a backup of the modified data will be created automatically before any changes are applied.bool enable_prior_backup = 8;-- // Whether to use gh-ost for online schema migration.- bool enable_ghost = 12;}message ExportDataConfig {diff --git a/proto/store/store/release.proto b/proto/store/store/release.protoindex 0a3a16a348..c30b32fddc 100644--- a/proto/store/store/release.proto+++ b/proto/store/store/release.proto@@ -19,8 +19,6 @@ message ReleasePayload {// The SHA256 hash of the sheet content (hex-encoded).string sheet_sha256 = 4;string version = 6;- // Whether to use gh-ost for online schema migration.- bool enable_ghost = 7;}message VCSSource {diff --git a/proto/store/store/task.proto b/proto/store/store/task.protoindex 967d0f8c98..c0f1cb3131 100644--- a/proto/store/store/task.proto+++ b/proto/store/store/task.proto@@ -38,9 +38,4 @@ message Task {// Whether to create an automatic backup before applying changes.bool enable_prior_backup = 11;- // Configuration flags for gh-ost migration tool.- map<string, string> flags = 12;-- // Whether to use gh-ost for online schema migration.- bool enable_ghost = 16;}diff --git a/proto/v1/v1/plan_service.proto b/proto/v1/v1/plan_service.protoindex c9752f211e..55fe1556c0 100644--- a/proto/v1/v1/plan_service.proto+++ b/proto/v1/v1/plan_service.proto@@ -276,13 +276,8 @@ message Plan {// Format: projects/{project}/releases/{release}string release = 3 [(google.api.resource_reference) = {type: "bytebase.com/Release"}];- map<string, string> ghost_flags = 5;-// If set, a backup of the modified data will be created automatically before any changes are applied.bool enable_prior_backup = 6;-- // Whether to use gh-ost for online schema migration.- bool enable_ghost = 7;}message ExportDataConfig {diff --git a/proto/v1/v1/release_service.proto b/proto/v1/v1/release_service.protoindex 91b451f32c..886e037a3d 100644--- a/proto/v1/v1/release_service.proto+++ b/proto/v1/v1/release_service.proto@@ -310,8 +310,6 @@ message Release {// The version identifier for the file.string version = 6;- // Whether to use gh-ost for online schema migration.- bool enable_ghost = 9;// For inputs, we must either use `sheet` or `statement`.// For outputs, we always use `sheet`. `statement` is the preview of the sheet content.