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: clean backup code (#11332)
ecmadao83df3b4b1b5b
diff --git a/backend/common/resource_name.go b/backend/common/resource_name.goindex 8e03730a98..3241f9e8a0 100644--- a/backend/common/resource_name.go+++ b/backend/common/resource_name.go@@ -20,7 +20,6 @@ const (UserNamePrefix = "users/"IdentityProviderNamePrefix = "idps/"SettingNamePrefix = "settings/"- BackupPrefix = "backups/"VCSProviderPrefix = "vcsProviders/"RiskPrefix = "risks/"IssuePrefix = "issues/"@@ -47,7 +46,6 @@ const (DeploymentConfigPrefix = "deploymentConfigs/"ChangelistsPrefix = "changelists/"- BackupSettingSuffix = "/backupSetting"SchemaSuffix = "/schema"MetadataSuffix = "/metadata"GitOpsInfoSuffix = "/gitOpsInfo"@@ -208,15 +206,6 @@ func GetInstanceDatabaseIDSecretName(name string) (string, string, string, errorreturn tokens[0], tokens[1], tokens[2], nil}-// GetInstanceDatabaseIDBackupName returns the instance ID, database ID, and backup name from a resource name.-func GetInstanceDatabaseIDBackupName(name string) (string, string, string, error) {- tokens, err := GetNameParentTokens(name, InstanceNamePrefix, DatabaseIDPrefix, BackupPrefix)- if err != nil {- return "", "", "", err- }- return tokens[0], tokens[1], tokens[2], nil-}-// GetUserID returns the user ID from a resource name.func GetUserID(name string) (int, error) {return GetUIDFromName(name, UserNamePrefix)diff --git a/backend/component/iam/acl.yaml b/backend/component/iam/acl.yamlindex e0eaf1faa8..c4bd0ac08b 100644--- a/backend/component/iam/acl.yaml+++ b/backend/component/iam/acl.yaml@@ -1,8 +1,6 @@roles:- name: roles/workspaceAdminpermissions:- - bb.backups.create- - bb.backups.list- bb.branches.create- bb.branches.delete- bb.branches.get@@ -21,13 +19,11 @@ roles:- bb.databases.adviseIndex- bb.databases.export- bb.databases.get- - bb.databases.getBackupSetting- bb.databases.getSchema- bb.databases.list- bb.databases.query- bb.databases.sync- bb.databases.update- - bb.databases.updateBackupSetting- bb.environments.create- bb.environments.delete- bb.environments.get@@ -97,8 +93,6 @@ roles:- bb.taskRuns.list- name: roles/workspaceDBApermissions:- - bb.backups.create- - bb.backups.list- bb.branches.create- bb.branches.delete- bb.branches.get@@ -117,13 +111,11 @@ roles:- bb.databases.adviseIndex- bb.databases.export- bb.databases.get- - bb.databases.getBackupSetting- bb.databases.getSchema- bb.databases.list- bb.databases.query- bb.databases.sync- bb.databases.update- - bb.databases.updateBackupSetting- bb.environments.create- bb.environments.delete- bb.environments.get@@ -205,8 +197,6 @@ roles:- bb.settings.list- name: roles/projectOwnerpermissions:- - bb.backups.create- - bb.backups.list- bb.branches.create- bb.branches.delete- bb.branches.get@@ -225,13 +215,11 @@ roles:- bb.databases.adviseIndex- bb.databases.export- bb.databases.get- - bb.databases.getBackupSetting- bb.databases.getSchema- bb.databases.list- bb.databases.query- bb.databases.sync- bb.databases.update- - bb.databases.updateBackupSetting- bb.issueComments.create- bb.issueComments.update- bb.issues.creatediff --git a/backend/component/iam/permission.go b/backend/component/iam/permission.goindex 5ea9a36e17..9ca6e24a43 100644--- a/backend/component/iam/permission.go+++ b/backend/component/iam/permission.go@@ -52,54 +52,50 @@ const (PermissionSettingsSet Permission = "bb.settings.set"// Project-level permissions.- PermissionBackupsCreate Permission = "bb.backups.create"- PermissionBackupsList Permission = "bb.backups.list"- PermissionBranchesCreate Permission = "bb.branches.create"- PermissionBranchesDelete Permission = "bb.branches.delete"- PermissionBranchesGet Permission = "bb.branches.get"- PermissionBranchesList Permission = "bb.branches.list"- PermissionBranchesUpdate Permission = "bb.branches.update"- PermissionChangeHistoriesGet Permission = "bb.changeHistories.get"- PermissionChangeHistoriesList Permission = "bb.changeHistories.list"- PermissionChangelistsCreate Permission = "bb.changelists.create"- PermissionChangelistsDelete Permission = "bb.changelists.delete"- PermissionChangelistsGet Permission = "bb.changelists.get"- PermissionChangelistsList Permission = "bb.changelists.list"- PermissionChangelistsUpdate Permission = "bb.changelists.update"- PermissionDatabaseSecretsDelete Permission = "bb.databaseSecrets.delete"- PermissionDatabaseSecretsList Permission = "bb.databaseSecrets.list"- PermissionDatabaseSecretsUpdate Permission = "bb.databaseSecrets.update"- PermissionDatabasesAdviseIndex Permission = "bb.databases.adviseIndex"- PermissionDatabasesExport Permission = "bb.databases.export"- PermissionDatabasesGet Permission = "bb.databases.get"- PermissionDatabasesGetBackupSetting Permission = "bb.databases.getBackupSetting"- PermissionDatabasesGetSchema Permission = "bb.databases.getSchema"- PermissionDatabasesList Permission = "bb.databases.list"- PermissionDatabasesQuery Permission = "bb.databases.query"- PermissionDatabasesSync Permission = "bb.databases.sync"- PermissionDatabasesUpdate Permission = "bb.databases.update"- PermissionDatabasesUpdateBackupSetting Permission = "bb.databases.updateBackupSetting"- PermissionIssueCommentsCreate Permission = "bb.issueComments.create"- PermissionIssueCommentsUpdate Permission = "bb.issueComments.update"- PermissionIssuesCreate Permission = "bb.issues.create"- PermissionIssuesGet Permission = "bb.issues.get"- PermissionIssuesList Permission = "bb.issues.list"- PermissionIssuesUpdate Permission = "bb.issues.update"- PermissionPlanCheckRunsList Permission = "bb.planCheckRuns.list"- PermissionPlanCheckRunsRun Permission = "bb.planCheckRuns.run"- PermissionPlansCreate Permission = "bb.plans.create"- PermissionPlansGet Permission = "bb.plans.get"- PermissionPlansList Permission = "bb.plans.list"- PermissionPlansUpdate Permission = "bb.plans.update"- PermissionProjectsGet Permission = "bb.projects.get"- PermissionProjectsGetIAMPolicy Permission = "bb.projects.getIamPolicy"- PermissionProjectsSetIAMPolicy Permission = "bb.projects.setIamPolicy"- PermissionProjectsUpdate Permission = "bb.projects.update"- PermissionRolloutsCreate Permission = "bb.rollouts.create"- PermissionRolloutsGet Permission = "bb.rollouts.get"- PermissionRolloutsPreview Permission = "bb.rollouts.preview"- PermissionSlowQueriesList Permission = "bb.slowQueries.list"- PermissionTaskRunsList Permission = "bb.taskRuns.list"+ PermissionBranchesCreate Permission = "bb.branches.create"+ PermissionBranchesDelete Permission = "bb.branches.delete"+ PermissionBranchesGet Permission = "bb.branches.get"+ PermissionBranchesList Permission = "bb.branches.list"+ PermissionBranchesUpdate Permission = "bb.branches.update"+ PermissionChangeHistoriesGet Permission = "bb.changeHistories.get"+ PermissionChangeHistoriesList Permission = "bb.changeHistories.list"+ PermissionChangelistsCreate Permission = "bb.changelists.create"+ PermissionChangelistsDelete Permission = "bb.changelists.delete"+ PermissionChangelistsGet Permission = "bb.changelists.get"+ PermissionChangelistsList Permission = "bb.changelists.list"+ PermissionChangelistsUpdate Permission = "bb.changelists.update"+ PermissionDatabaseSecretsDelete Permission = "bb.databaseSecrets.delete"+ PermissionDatabaseSecretsList Permission = "bb.databaseSecrets.list"+ PermissionDatabaseSecretsUpdate Permission = "bb.databaseSecrets.update"+ PermissionDatabasesAdviseIndex Permission = "bb.databases.adviseIndex"+ PermissionDatabasesExport Permission = "bb.databases.export"+ PermissionDatabasesGet Permission = "bb.databases.get"+ PermissionDatabasesGetSchema Permission = "bb.databases.getSchema"+ PermissionDatabasesList Permission = "bb.databases.list"+ PermissionDatabasesQuery Permission = "bb.databases.query"+ PermissionDatabasesSync Permission = "bb.databases.sync"+ PermissionDatabasesUpdate Permission = "bb.databases.update"+ PermissionIssueCommentsCreate Permission = "bb.issueComments.create"+ PermissionIssueCommentsUpdate Permission = "bb.issueComments.update"+ PermissionIssuesCreate Permission = "bb.issues.create"+ PermissionIssuesGet Permission = "bb.issues.get"+ PermissionIssuesList Permission = "bb.issues.list"+ PermissionIssuesUpdate Permission = "bb.issues.update"+ PermissionPlanCheckRunsList Permission = "bb.planCheckRuns.list"+ PermissionPlanCheckRunsRun Permission = "bb.planCheckRuns.run"+ PermissionPlansCreate Permission = "bb.plans.create"+ PermissionPlansGet Permission = "bb.plans.get"+ PermissionPlansList Permission = "bb.plans.list"+ PermissionPlansUpdate Permission = "bb.plans.update"+ PermissionProjectsGet Permission = "bb.projects.get"+ PermissionProjectsGetIAMPolicy Permission = "bb.projects.getIamPolicy"+ PermissionProjectsSetIAMPolicy Permission = "bb.projects.setIamPolicy"+ PermissionProjectsUpdate Permission = "bb.projects.update"+ PermissionRolloutsCreate Permission = "bb.rollouts.create"+ PermissionRolloutsGet Permission = "bb.rollouts.get"+ PermissionRolloutsPreview Permission = "bb.rollouts.preview"+ PermissionSlowQueriesList Permission = "bb.slowQueries.list"+ PermissionTaskRunsList Permission = "bb.taskRuns.list")func (p Permission) String() string {@@ -110,8 +106,6 @@ func PermissionExist(p Permission) bool {//exhaustive:enforceswitch p {case- PermissionBackupsCreate,- PermissionBackupsList,PermissionBranchesCreate,PermissionBranchesDelete,PermissionBranchesGet,@@ -130,13 +124,11 @@ func PermissionExist(p Permission) bool {PermissionDatabasesAdviseIndex,PermissionDatabasesExport,PermissionDatabasesGet,- PermissionDatabasesGetBackupSetting,PermissionDatabasesGetSchema,PermissionDatabasesList,PermissionDatabasesQuery,PermissionDatabasesSync,PermissionDatabasesUpdate,- PermissionDatabasesUpdateBackupSetting,PermissionEnvironmentsCreate,PermissionEnvironmentsDelete,PermissionEnvironmentsGet,@@ -281,8 +273,6 @@ func GetPermissionLevel(permission Permission) PermissionLevel {PermissionSettingsSet:return PermissionLevelWorkspacecase- PermissionBackupsCreate,- PermissionBackupsList,PermissionBranchesCreate,PermissionBranchesDelete,PermissionBranchesGet,@@ -301,13 +291,11 @@ func GetPermissionLevel(permission Permission) PermissionLevel {PermissionDatabasesAdviseIndex,PermissionDatabasesExport,PermissionDatabasesGet,- PermissionDatabasesGetBackupSetting,PermissionDatabasesGetSchema,PermissionDatabasesList,PermissionDatabasesQuery,PermissionDatabasesSync,PermissionDatabasesUpdate,- PermissionDatabasesUpdateBackupSetting,PermissionIssueCommentsCreate,PermissionIssueCommentsUpdate,PermissionIssuesCreate,diff --git a/backend/component/iam/permission.yaml b/backend/component/iam/permission.yamlindex 99267a0ab7..455c710a03 100644--- a/backend/component/iam/permission.yaml+++ b/backend/component/iam/permission.yaml@@ -1,7 +1,5 @@permissions:projectPermissions:- - bb.backups.create- - bb.backups.list- bb.branches.create- bb.branches.delete- bb.branches.get@@ -20,13 +18,11 @@ permissions:- bb.databases.adviseIndex- bb.databases.export- bb.databases.get- - bb.databases.getBackupSetting- bb.databases.getSchema- bb.databases.list- bb.databases.query- bb.databases.sync- bb.databases.update- - bb.databases.updateBackupSetting- bb.issueComments.create- bb.issueComments.update- bb.issues.creatediff --git a/backend/component/state/state.go b/backend/component/state/state.goindex e9625abb02..0da605c38c 100644--- a/backend/component/state/state.go+++ b/backend/component/state/state.go@@ -43,8 +43,6 @@ type State struct {// RunningTaskRunsCancelFunc is the cancelFunc of running taskruns.RunningTaskRunsCancelFunc sync.Map // map[taskRunID]context.CancelFunc- // RunningBackupDatabases is the set of databases running backups.- RunningBackupDatabases sync.Map // map[databaseID]bool// RunningPlanChecks is the set of running plan checks.RunningPlanChecks sync.Map// InstanceOutstandingConnections is the maximum number of connections per instance.diff --git a/backend/enterprise/api/plan.yaml b/backend/enterprise/api/plan.yamlindex 709adc0448..adf42eb70a 100644--- a/backend/enterprise/api/plan.yaml+++ b/backend/enterprise/api/plan.yaml@@ -10,7 +10,6 @@ categoryList:- terraform-provider- schedule-change- rollout-policy- - disaster-recovery- sync-schema- custom-approval- database-group@@ -36,7 +35,6 @@ categoryList:- rbac- slow-query- archiving- - backup-policy- sso- 2fa- ssh-tunnel@@ -79,9 +77,6 @@ planList:- type: state-based-change- type: migration-based-change- type: sql-check- - type: disaster-recovery- content: disaster-recovery-basic- tooltip: disaster-recovery-basic-tooltip- type: batch-changecontent: batch-change-basictooltip: batch-change-basic-tooltip@@ -128,7 +123,6 @@ planList:- rbac- batch-change-multi-environment- sql-editor- - database-backup-restore- webhook-integration- type: 1title: team@@ -153,9 +147,6 @@ planList:- type: state-based-change- type: migration-based-change- type: sql-check- - type: disaster-recovery- content: disaster-recovery-advanced- tooltip: disaster-recovery-advanced-tooltip- type: batch-changecontent: batch-change-basictooltip: batch-change-basic-tooltip@@ -193,7 +184,6 @@ planList:content: anomaly-detection-basictooltip: anomaly-detection-basic-tooltip- type: rbac- - type: backup-policy# Bespoke- type: supportcontent: support-email@@ -201,7 +191,6 @@ planList:- email-support- everything-in-free-plan- sql-check-anomaly-detection- - backup-policy- online-schema-migration- type: 2title: enterprise@@ -226,9 +215,6 @@ planList:- type: state-based-change- type: migration-based-change- type: sql-check- - type: disaster-recovery- content: disaster-recovery-advanced- tooltip: disaster-recovery-advanced-tooltip- type: batch-changecontent: batch-change-advancedtooltip: batch-change-advanced-tooltip@@ -269,7 +255,6 @@ planList:content: anomaly-detection-advancedtooltip: anomaly-detection-advanced-tooltip- type: rbac- - type: backup-policy- type: sso- type: 2fa- type: ssh-tunneldiff --git a/backend/legacyapi/backup.go b/backend/legacyapi/backup.goindex e6940c1cb3..b225fb3f71 100644--- a/backend/legacyapi/backup.go+++ b/backend/legacyapi/backup.go@@ -1,34 +1,5 @@package api-const (- // BackupRetentionPeriodUnset is the unset value of a backup retention period.- BackupRetentionPeriodUnset = 0-)--// BackupStatus is the status of a backup.-type BackupStatus string--const (- // BackupStatusPendingCreate is the status for PENDING_CREATE.- BackupStatusPendingCreate BackupStatus = "PENDING_CREATE"- // BackupStatusDone is the status for DONE.- BackupStatusDone BackupStatus = "DONE"- // BackupStatusFailed is the status for FAILED.- BackupStatusFailed BackupStatus = "FAILED"-)--// BackupType is the type of a backup.-type BackupType string--const (- // BackupTypeAutomatic is the type for automatic backup.- BackupTypeAutomatic BackupType = "AUTOMATIC"- // BackupTypePITR is the type of backup taken at PITR cutover stage.- BackupTypePITR BackupType = "PITR"- // BackupTypeManual is the type for manual backup.- BackupTypeManual BackupType = "MANUAL"-)-// BackupStorageBackend is the storage backend of a backup.type BackupStorageBackend stringdiff --git a/backend/legacyapi/policy.go b/backend/legacyapi/policy.goindex 5e2cd7728f..fd33cecab9 100644--- a/backend/legacyapi/policy.go+++ b/backend/legacyapi/policy.go@@ -15,9 +15,6 @@ type PipelineApprovalValue string// AssigneeGroupValue is the value for assignee group policy.type AssigneeGroupValue string-// BackupPlanPolicySchedule is value for backup plan policy.-type BackupPlanPolicySchedule string-// EnvironmentTierValue is the value for environment tier policy.type EnvironmentTierValue string@@ -57,13 +54,6 @@ const (// AssigneeGroupValueProjectOwner means the assignee can be selected from the project owners.AssigneeGroupValueProjectOwner AssigneeGroupValue = "PROJECT_OWNER"- // BackupPlanPolicyScheduleUnset is NEVER backup plan policy value.- BackupPlanPolicyScheduleUnset BackupPlanPolicySchedule = "UNSET"- // BackupPlanPolicyScheduleDaily is DAILY backup plan policy value.- BackupPlanPolicyScheduleDaily BackupPlanPolicySchedule = "DAILY"- // BackupPlanPolicyScheduleWeekly is WEEKLY backup plan policy value.- BackupPlanPolicyScheduleWeekly BackupPlanPolicySchedule = "WEEKLY"-// EnvironmentTierValueProtected is PROTECTED environment tier value.EnvironmentTierValueProtected EnvironmentTierValue = "PROTECTED"// EnvironmentTierValueUnprotected is UNPROTECTED environment tier value.@@ -98,30 +88,6 @@ var (})-// BackupPlanPolicy is the policy configuration for backup plan.-type BackupPlanPolicy struct {- Schedule BackupPlanPolicySchedule `json:"schedule"`- // RetentionPeriodTs is the minimum allowed period that backup data is kept for databases in an environment.- RetentionPeriodTs int `json:"retentionPeriodTs"`-}--func (bp *BackupPlanPolicy) String() (string, error) {- s, err := json.Marshal(bp)- if err != nil {- return "", err- }- return string(s), nil-}--// UnmarshalBackupPlanPolicy will unmarshal payload to backup plan policy.-func UnmarshalBackupPlanPolicy(payload string) (*BackupPlanPolicy, error) {- var bp BackupPlanPolicy- if err := json.Unmarshal([]byte(payload), &bp); err != nil {- return nil, errors.Wrapf(err, "failed to unmarshal backup plan policy %q", payload)- }- return &bp, nil-}-// EnvironmentTierPolicy is the tier of an environment.type EnvironmentTierPolicy struct {EnvironmentTier EnvironmentTierValue `json:"environmentTier"`diff --git a/backend/metric/collector/database_count.go b/backend/metric/collector/database_count.godeleted file mode 100644index 237354566a..0000000000--- a/backend/metric/collector/database_count.go+++ /dev/null@@ -1,54 +0,0 @@-package collector--import (- "context"- "strconv"-- metricapi "github.com/bytebase/bytebase/backend/metric"- "github.com/bytebase/bytebase/backend/plugin/metric"- "github.com/bytebase/bytebase/backend/store"-)--var _ metric.Collector = (*databaseCountCollector)(nil)--// databaseCountCollector is the metric data collector for database.-type databaseCountCollector struct {- store *store.Store-}--// NewDatabaseCountCollector creates a new instance of databaseCountCollector.-func NewDatabaseCountCollector(store *store.Store) metric.Collector {- return &databaseCountCollector{- store: store,- }-}--// Collect will collect the metric for database.-func (c *databaseCountCollector) Collect(ctx context.Context) ([]*metric.Metric, error) {- var res []*metric.Metric-- databaseCountMetricList, err := c.store.CountDatabaseGroupByBackupScheduleAndEnabled(ctx)- if err != nil {- return nil, err- }-- for _, databaseCountMetric := range databaseCountMetricList {- labels := map[string]any{- "backup_schedule": "null",- "backup_enabled": "null",- }- if v := databaseCountMetric.BackupPlanPolicySchedule; v != nil {- labels["backup_schedule"] = string(*v)- }- if v := databaseCountMetric.BackupSettingEnabled; v != nil {- labels["backup_enabled"] = strconv.FormatBool(*v)- }- res = append(res, &metric.Metric{- Name: metricapi.DatabaseCountMetricName,- Value: databaseCountMetric.Count,- Labels: labels,- })- }-- return res, nil-}diff --git a/backend/metric/metric.go b/backend/metric/metric.goindex 121c2d6c7c..53f733d7f3 100644--- a/backend/metric/metric.go+++ b/backend/metric/metric.go@@ -87,13 +87,6 @@ type TaskCountMetric struct {Count int}-// DatabaseCountMetric is the API message for database count metric.-type DatabaseCountMetric struct {- BackupPlanPolicySchedule *api.BackupPlanPolicySchedule- BackupSettingEnabled *bool // nil if BackupPlanPolicyScheduleUnset- Count int-}-// SheetCountMetric is the API message for sheet count metric.type SheetCountMetric struct {RowStatus api.RowStatusdiff --git a/backend/plugin/db/mysql/restore.go b/backend/plugin/db/mysql/restore.goindex 3c7bdbffef..b576f87e80 100644--- a/backend/plugin/db/mysql/restore.go+++ b/backend/plugin/db/mysql/restore.go@@ -15,7 +15,6 @@ import ("fmt""io""log/slog"- "math""os""os/exec""path"@@ -33,10 +32,7 @@ import ("github.com/bytebase/bytebase/backend/plugin/db/util"bbs3 "github.com/bytebase/bytebase/backend/plugin/storage/s3""github.com/bytebase/bytebase/backend/resources/mysqlutil"- "github.com/bytebase/bytebase/backend/store"storepb "github.com/bytebase/bytebase/proto/generated-go/store"-- "github.com/blang/semver/v4")const (@@ -87,20 +83,6 @@ func newBinlogFile(name string, size int64) (BinlogFile, error) {return BinlogFile{Name: name, Size: size, Seq: seq}, nil}-type binlogCoordinate struct {- Name string- Seq int64- Pos int64-}--func newBinlogCoordinate(binlogFileName string, pos int64) (binlogCoordinate, error) {- _, seq, err := ParseBinlogName(binlogFileName)- if err != nil {- return binlogCoordinate{}, err- }- return binlogCoordinate{Name: binlogFileName, Seq: seq, Pos: pos}, nil-}-type binlogFileMeta struct {FirstEventTs int64 `json:"first_event_ts"`@@ -346,88 +328,6 @@ func sortBinlogFiles(binlogFiles []BinlogFile) []BinlogFile {return sorted}-// GetLatestBackupBeforeOrEqualTs finds the latest logical backup and corresponding binlog info whose time is before or equal to `targetTs`.-// The backupList should only contain DONE backups.-func (driver *Driver) GetLatestBackupBeforeOrEqualTs(ctx context.Context, backupList []*store.BackupMessage, targetTs int64, client *bbs3.Client) (*store.BackupMessage, *api.BinlogInfo, error) {- if len(backupList) == 0 {- return nil, nil, errors.Errorf("no valid backup")- }-- targetBinlogCoordinate, err := driver.getBinlogCoordinateByTs(ctx, targetTs, client)- if err != nil {- slog.Error("Failed to get binlog coordinate by targetTs", slog.Int64("targetTs", targetTs), log.BBError(err))- return nil, nil, errors.Wrapf(err, "failed to get binlog coordinate by targetTs %d", targetTs)- }- slog.Debug("Got binlog coordinate by targetTs", slog.Int64("targetTs", targetTs), slog.Any("binlogCoordinate", *targetBinlogCoordinate))-- var validBackupList []*store.BackupMessage- for _, b := range backupList {- if b.Payload.BinlogInfo.IsEmpty() {- slog.Debug("Skip parsing binlog event timestamp of the backup where BinlogInfo is empty", slog.Int("backupId", b.UID), slog.String("backupName", b.Name))- continue- }- validBackupList = append(validBackupList, b)- }-- backup, err := getLatestBackupBeforeOrEqualBinlogCoord(validBackupList, *targetBinlogCoordinate)- if err != nil {- return nil, nil, errors.Wrapf(err, "failed to get the latest backup before or equal to binlog coordinate %+v", *targetBinlogCoordinate)- }- targetBinlogInfo := &api.BinlogInfo{- FileName: targetBinlogCoordinate.Name,- Position: targetBinlogCoordinate.Pos,- }-- return backup, targetBinlogInfo, nil-}--func getLatestBackupBeforeOrEqualBinlogCoord(backupList []*store.BackupMessage, targetBinlogCoordinate binlogCoordinate) (*store.BackupMessage, error) {- type backupBinlogCoordinate struct {- binlogCoordinate- backup *store.BackupMessage- }- var backupCoordinateListSorted []backupBinlogCoordinate- for _, b := range backupList {- c, err := newBinlogCoordinate(b.Payload.BinlogInfo.FileName, b.Payload.BinlogInfo.Position)- if err != nil {- return nil, err- }- backupCoordinateListSorted = append(backupCoordinateListSorted, backupBinlogCoordinate{binlogCoordinate: c, backup: b})- }-- // Sort in order that latest binlog coordinate comes first.- sort.Slice(backupCoordinateListSorted, func(i, j int) bool {- return backupCoordinateListSorted[i].Seq > backupCoordinateListSorted[j].Seq ||- (backupCoordinateListSorted[i].Seq == backupCoordinateListSorted[j].Seq && backupCoordinateListSorted[i].Pos > backupCoordinateListSorted[j].Pos)- })-- var backup *store.BackupMessage- for _, bc := range backupCoordinateListSorted {- if bc.Seq < targetBinlogCoordinate.Seq || (bc.Seq == targetBinlogCoordinate.Seq && bc.Pos <= targetBinlogCoordinate.Pos) {- if bc.backup.Status == api.BackupStatusDone {- backup = bc.backup- break- }- if bc.backup.Status == api.BackupStatusFailed && bc.backup.BackupType == api.BackupTypePITR {- return nil, errors.Errorf("the backup %q taken after a former PITR cutover is failed, so we cannot recover to a point in time before this backup", bc.backup.Name)- }- if bc.backup.Status == api.BackupStatusPendingCreate && bc.backup.BackupType == api.BackupTypePITR {- return nil, errors.Errorf("the backup %q taken after a former PITR cutover is still in progress, please try again later", bc.backup.Name)- }- }- }-- if backup == nil {- oldestBackupBinlogCoordinate := backupCoordinateListSorted[len(backupCoordinateListSorted)-1]- slog.Error("The target binlog coordinate is earlier than the oldest backup's binlog coordinate",- slog.Any("targetBinlogCoordinate", targetBinlogCoordinate),- slog.Any("oldestBackupBinlogCoordinate", oldestBackupBinlogCoordinate))- return nil, errors.Errorf("the target binlog coordinate %v is earlier than the oldest backup's binlog coordinate %v", targetBinlogCoordinate, oldestBackupBinlogCoordinate)- }-- return backup, nil-}-// SwapPITRDatabase renames the pitr database to the target, and the original to the old database// It returns the pitr and old database names after swap.// It performs the step 2 of the restore process.@@ -890,65 +790,6 @@ func (driver *Driver) GetSortedBinlogFilesOnServer(ctx context.Context) ([]Binloreturn sortBinlogFiles(binlogFiles), nil}-// getBinlogCoordinateByTs converts a timestamp to binlog coordinate using local binlog files.-func (driver *Driver) getBinlogCoordinateByTs(ctx context.Context, targetTs int64, client *bbs3.Client) (*binlogCoordinate, error) {- metaList, err := getSortedLocalBinlogFilesMeta(driver.binlogDir)- if err != nil {- return nil, errors.Wrap(err, "failed to read local binlog metadata files")- }- if len(metaList) == 0 {- return nil, errors.Errorf("no local binlog metadata files found")- }- if !binlogMetaAreContinuous(metaList) {- return nil, errors.Errorf("local binlog metadata files are not continuous")- }-- var targetMeta *binlogFileMeta- for i, meta := range metaList {- if meta.FirstEventTs >= targetTs {- if i == 0 {- return nil, errors.Errorf("the targetTs %d is before the first event ts %d of the oldest binlog file %q", targetTs, meta.FirstEventTs, metaList[0].binlogName)- }- // The previous local binlog file contains targetTs.- targetMeta = &metaList[i-1]- break- }- }- // All of the local binlog files' first event start ts <= targetTs, so we choose the last binlog file as probably "containing" targetTs.- // This may not be true, because possibly targetTs > last eventTs of the last binlog file.- // In this case, we should return an error.- var isLastBinlogFile bool- if targetMeta == nil {- isLastBinlogFile = true- targetMeta = &metaList[len(metaList)-1]- }- slog.Debug("Found potential binlog file containing targetTs", slog.String("binlogFile", targetMeta.binlogName), slog.Int64("targetTs", targetTs), slog.Bool("isLastBinlogFile", isLastBinlogFile))-- if client != nil {- // Use filepath.Join to compose an OS-specific local file system path.- filePathLocal := filepath.Join(driver.binlogDir, targetMeta.binlogName)- // Use path.Join to compose a path on cloud which always uses / as the separator.- filePathOnCloud := path.Join(common.GetBinlogRelativeDir(driver.binlogDir), targetMeta.binlogName)- if err := client.DownloadFileFromCloud(ctx, filePathLocal, filePathOnCloud); err != nil {- return nil, errors.Wrapf(err, "failed to download binlog file %s from the cloud storage", targetMeta.binlogName)- }- }- eventPos, err := driver.getBinlogEventPositionAtOrAfterTs(ctx, targetMeta.binlogName, targetTs)- if err != nil {- if common.ErrorCode(err) == common.NotFound {- // All the binlog events in this binlog file have ts < targetTs.- // If this is the last binlog file, the user wants to recover to a time in the future and we should return an error.- // Otherwise, we should return the end position of the current binlog file.- if isLastBinlogFile {- return nil, errors.Errorf("the targetTs %d is after the last event ts of the latest binlog file %q", targetTs, targetMeta.binlogName)- }- return &binlogCoordinate{Name: targetMeta.binlogName, Seq: targetMeta.seq, Pos: math.MaxInt64}, nil- }- return nil, errors.Wrapf(err, "failed to find the binlog event after targetTs %d", targetTs)- }- return &binlogCoordinate{Name: targetMeta.binlogName, Seq: targetMeta.seq, Pos: eventPos}, nil-}-func parseBinlogEventTsInLine(line string) (eventTs int64, found bool, err error) {// The target line starts with string like "#220421 14:49:26 server id 1"if !strings.Contains(line, "server id") {@@ -1031,60 +872,6 @@ func (driver *Driver) parseLocalBinlogFirstEventTs(ctx context.Context, fileNamereturn eventTs, nil}-// Use command like mysqlbinlog --start-datetime=targetTs binlog.000001 to parse the first binlog event position with timestamp equal or after targetTs.-// TODO(dragonly): Add integration test.-func (driver *Driver) getBinlogEventPositionAtOrAfterTs(ctx context.Context, binlogFileName string, targetTs int64) (int64, error) {- args := []string{- // Local binlog file path.- path.Join(driver.binlogDir, binlogFileName),- // Verify checksum binlog events.- "--verify-binlog-checksum",- // Tell mysqlbinlog to suppress the BINLOG statements for row events, which reduces the unneeded output.- "--base64-output=DECODE-ROWS",- // Instruct mysqlbinlog to start output only after encountering the first binlog event with timestamp equal or after targetTs.- "--start-datetime", formatDateTime(targetTs),- }- cmd := exec.CommandContext(ctx, mysqlutil.GetPath(mysqlutil.MySQLBinlog, driver.dbBinDir), args...)- cmd.Stderr = os.Stderr- pr, err := cmd.StdoutPipe()- if err != nil {- return 0, err- }- s := bufio.NewScanner(pr)- if err := cmd.Start(); err != nil {- return 0, err- }- defer func() {- _ = pr.Close()- _ = cmd.Process.Kill()- }()-- var pos int64- for s.Scan() {- line := s.Text()- posParsed, found, err := parseBinlogEventPosInLine(line)- if err != nil {- return 0, errors.Wrap(err, "failed to parse binlog event start position from mysqlbinlog output")- }- if !found {- continue- }- if posParsed == 4 {- // When invoking mysqlbinlog with --start-datetime, the first valid event will always be FORMAT_DESCRIPTION_EVENT which should be skipped.- continue- }- pos = posParsed- break- }-- if pos == 0 {- // TODO(dragonly): Check for mysqlbinlog process exit error to give more specific error messages, e.g., file not exist.- return 0, common.Errorf(common.NotFound, "failed to find event position at or after targetTs %d", targetTs)- }-- return pos, nil-}-// ParseBinlogName parses the numeric extension and the binary log base name by using split the dot.// Examples:// - ("binlog.000001") => ("binlog", 1)@@ -1111,57 +898,6 @@ func GenBinlogFileNames(base string, seqStart, seqEnd int64) []string {return ret}-// checks the MySQL version is >=8.0.-func checkVersionForPITR(version string) error {- v, err := semver.Parse(version)- if err != nil {- return err- }- v8 := semver.MustParse("8.0.0")- if v.LT(v8) {- return errors.Errorf("version %s is not supported for PITR; the minimum supported version is 8.0", version)- }- return nil-}--// CheckServerVersionForPITR checks that the MySQL server version meets the requirements of PITR.-func (driver *Driver) CheckServerVersionForPITR(ctx context.Context) error {- value, err := driver.getServerVariable(ctx, "version")- if err != nil {- return err- }- return checkVersionForPITR(value)-}--// CheckEngineInnoDB checks that the tables in the database is all using InnoDB as the storage engine.-func (driver *Driver) CheckEngineInnoDB(ctx context.Context, database string) error {- db := driver.GetDB()- // ref: https://dev.mysql.com/doc/refman/8.0/en/information-schema-tables-table.html- query := fmt.Sprintf("SELECT table_name, engine FROM information_schema.tables WHERE table_schema='%s';", database)- rows, err := db.QueryContext(ctx, query)- if err != nil {- return err- }- defer rows.Close()- var tablesNotInnoDB []string- for rows.Next() {- var tableName, engine string- if err := rows.Scan(&tableName, &engine); err != nil {- return err- }- if strings.ToLower(engine) != "innodb" {- tablesNotInnoDB = append(tablesNotInnoDB, tableName)- }- }- if err := rows.Err(); err != nil {- return util.FormatErrorWithQuery(err, query)- }- if len(tablesNotInnoDB) != 0 {- return errors.Errorf("tables %v of database %s do not use the InnoDB engine, which is required for PITR", tablesNotInnoDB, database)- }- return nil-}-func (driver *Driver) getServerVariable(ctx context.Context, varName string) (string, error) {db := driver.GetDB()query := fmt.Sprintf("SHOW VARIABLES LIKE '%s'", varName)diff --git a/backend/plugin/db/mysql/restore_test.go b/backend/plugin/db/mysql/restore_test.goindex 74c16b9cc9..bcad37a550 100644--- a/backend/plugin/db/mysql/restore_test.go+++ b/backend/plugin/db/mysql/restore_test.go@@ -93,44 +93,6 @@ func TestGetPITROldDatabaseName(t *testing.T) {}}-func TestCheckVersionForPITR(t *testing.T) {- a := require.New(t)- tests := []struct {- version string- err bool- }{- {- version: "5.6.1",- err: true,- },- {- version: "5.7.0",- err: true,- },- {- version: "8.0.33",- err: false,- },- {- version: "8.0.33-debug",- err: false,- },- {- version: "invalid.semver",- err: true,- },- }-- for _, test := range tests {- err := checkVersionForPITR(test.version)- if test.err {- a.Error(err)- } else {- a.NoError(err)- }- }-}-func TestGetBinlogFileNameSeqNumber(t *testing.T) {a := require.New(t)tests := []struct {diff --git a/backend/server/init.go b/backend/server/init.goindex 3e49aae777..d00133deac 100644--- a/backend/server/init.go+++ b/backend/server/init.go@@ -215,7 +215,6 @@ func (s *Server) initMetricReporter() {metricReporter.Register(metric.ProjectCountMetricName, metriccollector.NewProjectCountCollector(s.store))metricReporter.Register(metric.PolicyCountMetricName, metriccollector.NewPolicyCountCollector(s.store))metricReporter.Register(metric.TaskCountMetricName, metriccollector.NewTaskCountCollector(s.store))- metricReporter.Register(metric.DatabaseCountMetricName, metriccollector.NewDatabaseCountCollector(s.store))metricReporter.Register(metric.SheetCountMetricName, metriccollector.NewSheetCountCollector(s.store))metricReporter.Register(metric.MemberCountMetricName, metriccollector.NewMemberCountCollector(s.store))s.metricReporter = metricReporterdiff --git a/backend/store/backup.go b/backend/store/backup.godeleted file mode 100644index 602630cbce..0000000000--- a/backend/store/backup.go+++ /dev/null@@ -1,685 +0,0 @@-package store--import (- "context"- "database/sql"- "encoding/json"- "fmt"- "log/slog"- "strings"-- "github.com/pkg/errors"-- "github.com/bytebase/bytebase/backend/common"- api "github.com/bytebase/bytebase/backend/legacyapi"- "github.com/bytebase/bytebase/backend/store/model"-)--// BackupSettingsMatchMessage is the message to find backup settings matching the conditions.-type BackupSettingsMatchMessage struct {- Hour int- DayOfWeek int-}--// FindBackupSettingsMatch finds a list of backup setting instances with match conditions.-func (s *Store) FindBackupSettingsMatch(ctx context.Context, match *BackupSettingsMatchMessage) ([]*BackupSettingMessage, error) {- backupSettingList, err := s.findBackupSettingsMatchImpl(ctx, match)- if err != nil {- return nil, errors.Wrapf(err, "failed to find matching backup setting list with BackupSettingsMatch[%+v]", match)- }-- return backupSettingList, nil-}--// findBackupSettingsMatchImpl retrieves a list of backup settings based on match condition.-func (s *Store) findBackupSettingsMatchImpl(ctx context.Context, match *BackupSettingsMatchMessage) ([]*BackupSettingMessage, error) {- tx, err := s.db.BeginTx(ctx, nil)- if err != nil {- return nil, err- }- defer tx.Rollback()-- rows, err := tx.QueryContext(ctx, `- SELECT- database_id,- enabled,- hour,- day_of_week,- retention_period_ts,- hook_url- FROM backup_setting- WHERE- enabled = true- AND (- (hour = $1 AND day_of_week = $2)- OR- (hour = $3 AND day_of_week = -1)- OR- (hour = -1 AND day_of_week = $4)- )- `,- match.Hour, match.DayOfWeek, match.Hour, match.DayOfWeek,- )- if err != nil {- return nil, err- }- defer rows.Close()-- // Iterate over result set and deserialize rows into backupSettingList.- var backupSettingList []*BackupSettingMessage- for rows.Next() {- var backupSetting BackupSettingMessage- if err := rows.Scan(- &backupSetting.DatabaseUID,- &backupSetting.Enabled,- &backupSetting.HourOfDay,- &backupSetting.DayOfWeek,- &backupSetting.RetentionPeriodTs,- &backupSetting.HookURL,- ); err != nil {- return nil, err- }-- backupSettingList = append(backupSettingList, &backupSetting)- }- if err := rows.Err(); err != nil {- return nil, err- }-- if err := tx.Commit(); err != nil {- return nil, err- }-- return backupSettingList, nil-}--// BackupSettingMessage is the message for backup setting.-type BackupSettingMessage struct {- // ID is the ID of the backup setting.- ID int- // DatabaseUID is the UID of the database.- DatabaseUID int- // UpdatedTs is the timestamp when the backup setting is updated.- UpdatedTs int64- // Enable is true if the backup setting is enabled.- Enabled bool- // HourOfDay is the hour field in cron string to trigger the backup.- HourOfDay int- // DayOfWeek is the day of week field in cron string to trigger the backup.- DayOfWeek int- // RetentionPeriodTs is the retention period in seconds.- RetentionPeriodTs int- // HookURL is the URL to send the backup status.- HookURL string-}--// FindBackupSettingMessage is the message for finding backup setting.-type FindBackupSettingMessage struct {- // DatabaseUID is the UID of database.- DatabaseUID *int- // InstanceUID is the UID of instance.- InstanceUID *int-}--// BackupMessage is the message for backup.-type BackupMessage struct {- // Name is the name of the backup.- Name string- // Status is the status of the backup.- Status api.BackupStatus- // BackupType is the type of the backup.- BackupType api.BackupType- // Comment is the comment of the backup.- Comment string- // Storage Backend is the storage backend of the backup.- StorageBackend api.BackupStorageBackend- // MigrationHistoryVersion is the migration history version of the database.- MigrationHistoryVersion model.Version- // Path is the path of the backup file.- Path string-- // Output only fields.- //- // ID is the UID of the backup.- UID int- // CreatedTs is the timestamp when the backup is created.- CreatedTs int64- // UpdatedTs is the timestamp when the backup is updated.- UpdatedTs int64- // RowStatus is the status of the row. ARCHIVED means the backup is deleted.- RowStatus api.RowStatus- // DatabaseUID is the UID of the database.- DatabaseUID int- // Payload is the payload of the backup.- Payload api.BackupPayload-}--// SLogBackupArray is a helper to format []*BackupMessage.-type SLogBackupArray []*BackupMessage--// LogValue implements the LogValuer interface.-func (backups SLogBackupArray) LogValue() slog.Value {- backupList := []string{}- for _, backup := range backups {- payload, err := json.Marshal(backup.Payload)- if err != nil {- backupList = append(backupList, err.Error())- continue- }- backupList = append(backupList, fmt.Sprintf("{name:%s, id:%d, payload:%s}", backup.Name, backup.UID, payload))- }- return slog.StringValue(strings.Join(backupList, ","))-}--// FindBackupMessage is the message for finding backup.-type FindBackupMessage struct {- // DatabaseUID is the UID of the database.- DatabaseUID *int- // Name is the name of the backup.- Name *string- // RowStatus is the status of the row.- RowStatus *api.RowStatus- // Status is the status of the backup.- Status *api.BackupStatus- // backupUID is the UID of the backup.- backupUID *int-}--// UpdateBackupMessage is the message for updating backup.-type UpdateBackupMessage struct {- // UID is the UID of the backup.- UID int-- // Standard fields- RowStatus *api.RowStatus- // Value is assigned from the jwt subject field passed by the client.- UpdaterID int-- // Domain specific fields- Status *string- Comment *string- Payload *string-}--// GetBackupSettingV2 retrieves the backup setting for the given database.-func (s *Store) GetBackupSettingV2(ctx context.Context, databaseUID int) (*BackupSettingMessage, error) {- tx, err := s.db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true})- if err != nil {- return nil, errors.Wrapf(err, "failed to begin transaction")- }- defer tx.Rollback()-- find := &FindBackupSettingMessage{- DatabaseUID: &databaseUID,- }-- backupSettings, err := s.listBackupSettingImplV2(ctx, tx, find)- if err != nil {- return nil, errors.Wrapf(err, "failed to find backup setting with %+v", find)- }-- if err := tx.Commit(); err != nil {- return nil, errors.Wrapf(err, "failed to commit transaction")- }-- if len(backupSettings) == 0 {- return nil, nil- }- if len(backupSettings) > 1 {- return nil, errors.Wrapf(err, "find %d backup settings with %+v", len(backupSettings), find)- }-- return backupSettings[0], nil-}--// UpsertBackupSettingV2 upserts the backup setting for the given database.-func (s *Store) UpsertBackupSettingV2(ctx context.Context, principalUID int, upsert *BackupSettingMessage) (*BackupSettingMessage, error) {- tx, err := s.db.BeginTx(ctx, nil)- if err != nil {- return nil, errors.Wrapf(err, "failed to begin transaction")- }- defer tx.Rollback()-- var backupSetting BackupSettingMessage- if err := tx.QueryRowContext(ctx, `- INSERT INTO backup_setting (- creator_id,- updater_id,- database_id,- enabled,- hour,- day_of_week,- retention_period_ts,- hook_url- ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8)- ON CONFLICT (database_id)- DO UPDATE SET- enabled = EXCLUDED.enabled,- hour = EXCLUDED.hour,- day_of_week = EXCLUDED.day_of_week,- retention_period_ts = EXCLUDED.retention_period_ts,- updater_id = EXCLUDED.updater_id,- hook_url = EXCLUDED.hook_url- RETURNING id, database_id, updated_ts, enabled, hour, day_of_week, retention_period_ts, hook_url- `,- principalUID,- principalUID,- upsert.DatabaseUID,- upsert.Enabled,- upsert.HourOfDay,- upsert.DayOfWeek,- upsert.RetentionPeriodTs,- upsert.HookURL,- ).Scan(- &backupSetting.ID,- &backupSetting.DatabaseUID,- &backupSetting.UpdatedTs,- &backupSetting.Enabled,- &backupSetting.HourOfDay,- &backupSetting.DayOfWeek,- &backupSetting.RetentionPeriodTs,- &backupSetting.HookURL,- ); err != nil {- return nil, err- }-- if err := tx.Commit(); err != nil {- return nil, errors.Wrapf(err, "failed to commit transaction")- }- return &backupSetting, nil-}--// UpdateBackupSettingsForEnvironmentV2 upserts an instance of backup setting.-func (s *Store) UpdateBackupSettingsForEnvironmentV2(ctx context.Context, environmentID string, enabled bool, updaterID int) error {- tx, err := s.db.BeginTx(ctx, nil)- if err != nil {- return err- }- defer tx.Rollback()-- stmt := `- UPDATE backup_setting- SET- updater_id = $1,- enabled = $2- WHERE id IN (- SELECT backup_setting.id- FROM backup_setting- INNER JOIN db ON backup_setting.database_id = db.id- INNER JOIN instance ON db.instance_id = instance.id- INNER JOIN environment ON instance.environment_id = environment.id- WHERE environment.resource_id = $3- );- `- if _, err := tx.ExecContext(ctx, stmt, updaterID, enabled, environmentID); err != nil {- return err- }- return tx.Commit()-}--// ListBackupSettingV2 finds the backup setting.-func (s *Store) ListBackupSettingV2(ctx context.Context, find *FindBackupSettingMessage) ([]*BackupSettingMessage, error) {- tx, err := s.db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true})- if err != nil {- return nil, errors.Wrapf(err, "failed to begin transaction")- }- defer tx.Rollback()-- backupSettings, err := s.listBackupSettingImplV2(ctx, tx, find)- if err != nil {- return nil, errors.Wrapf(err, "failed to find backup setting with %+v", find)- }-- if err := tx.Commit(); err != nil {- return nil, errors.Wrapf(err, "failed to commit transaction")- }-- return backupSettings, nil-}--// CreateBackupV2 creates a backup for the given database.-func (s *Store) CreateBackupV2(ctx context.Context, create *BackupMessage, databaseUID int, principalUID int) (*BackupMessage, error) {- storedVersion, err := create.MigrationHistoryVersion.Marshal()- if err != nil {- return nil, err- }- tx, err := s.db.BeginTx(ctx, nil)- if err != nil {- return nil, errors.Wrapf(err, "failed to begin transaction")- }- defer tx.Rollback()- query := `- INSERT INTO backup (- creator_id,- updater_id,- database_id,- name,- status,- type,- storage_backend,- migration_history_version,- path,- comment- )- VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)- RETURNING id, row_status, name, storage_backend, path, created_ts, updated_ts, status, type, comment, database_id- `- var backup BackupMessage- if err := tx.QueryRowContext(ctx, query,- principalUID,- principalUID,- databaseUID,- create.Name,- create.Status,- create.BackupType,- create.StorageBackend,- storedVersion,- create.Path,- create.Comment,- ).Scan(- &backup.UID,- &backup.RowStatus,- &backup.Name,- &backup.StorageBackend,- &backup.Path,- &backup.CreatedTs,- &backup.UpdatedTs,- &backup.Status,- &backup.BackupType,- &backup.Comment,- &backup.DatabaseUID,- ); err != nil {- if err == sql.ErrNoRows {- return nil, common.FormatDBErrorEmptyRowWithQuery(query)- }- return nil, err- }- if err := tx.Commit(); err != nil {- return nil, errors.Wrapf(err, "failed to commit transaction")- }- return &backup, nil-}--// GetBackupByUID gets the backup for the given database by backup UID.-func (s *Store) GetBackupByUID(ctx context.Context, backupUID int) (*BackupMessage, error) {- tx, err := s.db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true})- if err != nil {- return nil, errors.Wrap(err, "failed to begin transaction")- }- defer tx.Rollback()-- find := &FindBackupMessage{backupUID: &backupUID}- backupList, err := s.listBackupImplV2(ctx, tx, find)- if err != nil {- return nil, errors.Wrapf(err, "failed to find backup with %+v", find)- }-- if err := tx.Commit(); err != nil {- return nil, errors.Wrapf(err, "failed to commit transaction")- }-- if len(backupList) == 0 {- return nil, nil- }- if len(backupList) > 1 {- return nil, errors.Errorf("found %d backup with backup uid %d", len(backupList), backupUID)- }-- return backupList[0], nil-}--// GetBackupV2 gets the backup for the given database.-func (s *Store) GetBackupV2(ctx context.Context, find *FindBackupMessage) (*BackupMessage, error) {- tx, err := s.db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true})- if err != nil {- return nil, errors.Wrap(err, "failed to begin transaction")- }- defer tx.Rollback()-- backupList, err := s.listBackupImplV2(ctx, tx, find)- if err != nil {- return nil, errors.Wrapf(err, "failed to find backup with %+v", find)- }-- if err := tx.Commit(); err != nil {- return nil, errors.Wrapf(err, "failed to commit transaction")- }-- if len(backupList) == 0 {- return nil, nil- }- if len(backupList) > 1 {- return nil, errors.Errorf("found %d backup with backup find %+v", len(backupList), find)- }-- return backupList[0], nil-}--// ListBackupV2 lists the backups for the given database.-func (s *Store) ListBackupV2(ctx context.Context, find *FindBackupMessage) ([]*BackupMessage, error) {- tx, err := s.db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true})- if err != nil {- return nil, errors.Wrap(err, "failed to begin transaction")- }- defer tx.Rollback()-- backupList, err := s.listBackupImplV2(ctx, tx, find)- if err != nil {- return nil, errors.Wrapf(err, "failed to find backup with %+v", find)- }-- if err := tx.Commit(); err != nil {- return nil, errors.Wrapf(err, "failed to commit transaction")- }-- return backupList, nil-}--// UpdateBackupV2 patches an instance of Backup.-func (s *Store) UpdateBackupV2(ctx context.Context, patch *UpdateBackupMessage) (*BackupMessage, error) {- // Build UPDATE clause.- set, args := []string{"updater_id = $1"}, []any{patch.UpdaterID}- if v := patch.RowStatus; v != nil {- set, args = append(set, fmt.Sprintf("row_status = $%d", len(args)+1)), append(args, *v)- }- if v := patch.Status; v != nil {- set, args = append(set, fmt.Sprintf("status = $%d", len(args)+1)), append(args, *v)- }- if v := patch.Comment; v != nil {- set, args = append(set, fmt.Sprintf("comment = $%d", len(args)+1)), append(args, *v)- }- if v := patch.Payload; v != nil {- if *v == "" {- *v = "{}"- }- set, args = append(set, fmt.Sprintf("payload = $%d", len(args)+1)), append(args, *v)- }- args = append(args, patch.UID)-- tx, err := s.db.BeginTx(ctx, nil)- if err != nil {- return nil, errors.Wrap(err, "failed to begin transaction")- }-- var backup BackupMessage- var payload []byte- var storedVersion string- // Execute update query with RETURNING.- if err := tx.QueryRowContext(ctx, fmt.Sprintf(`- UPDATE backup- SET `+strings.Join(set, ", ")+`- WHERE id = $%d- RETURNING id, row_status, created_ts, updated_ts, database_id, name, status, type, storage_backend, migration_history_version, path, comment, payload- `, len(args)),- args...,- ).Scan(- &backup.UID,- &backup.RowStatus,- &backup.CreatedTs,- &backup.UpdatedTs,- &backup.DatabaseUID,- &backup.Name,- &backup.Status,- &backup.BackupType,- &backup.StorageBackend,- &storedVersion,- &backup.Path,- &backup.Comment,- &payload,- ); err != nil {- if err == sql.ErrNoRows {- return nil, &common.Error{Code: common.NotFound, Err: errors.Errorf("backup ID not found: %d", patch.UID)}- }- return nil, err- }-- if err := tx.Commit(); err != nil {- return nil, errors.Wrapf(err, "failed to commit transaction")- }- version, err := model.NewVersion(storedVersion)- if err != nil {- return nil, err- }- backup.MigrationHistoryVersion = version-- if err := json.Unmarshal(payload, &backup.Payload); err != nil {- return nil, err- }-- return &backup, nil-}--func (*Store) listBackupImplV2(ctx context.Context, tx *Tx, find *FindBackupMessage) ([]*BackupMessage, error) {- // Build where clause.- where, args := []string{"TRUE"}, []any{}- if v := find.DatabaseUID; v != nil {- where, args = append(where, fmt.Sprintf("database_id = $%d", len(args)+1)), append(args, *v)- }- if v := find.Name; v != nil {- where, args = append(where, fmt.Sprintf("name = $%d", len(args)+1)), append(args, *v)- }- if v := find.backupUID; v != nil {- where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *v)- }- if v := find.RowStatus; v != nil {- where, args = append(where, fmt.Sprintf("row_status = $%d", len(args)+1)), append(args, *v)- }- if v := find.Status; v != nil {- where, args = append(where, fmt.Sprintf("status = $%d", len(args)+1)), append(args, *v)- }-- rows, err := tx.QueryContext(ctx, fmt.Sprintf(`- SELECT- id,- row_status,- name,- storage_backend,- migration_history_version,- path,- created_ts,- updated_ts,- status,- type,- comment,- database_id,- payload- FROM backup WHERE %s;`, strings.Join(where, " AND ")), args...)- if err != nil {- return nil, err- }- defer rows.Close()-- var backupList []*BackupMessage- for rows.Next() {- var backup BackupMessage- var storedVersion, payload string- if err := rows.Scan(- &backup.UID,- &backup.RowStatus,- &backup.Name,- &backup.StorageBackend,- &storedVersion,- &backup.Path,- &backup.CreatedTs,- &backup.UpdatedTs,- &backup.Status,- &backup.BackupType,- &backup.Comment,- &backup.DatabaseUID,- &payload,- ); err != nil {- return nil, err- }- if err := json.Unmarshal([]byte(payload), &backup.Payload); err != nil {- return nil, err- }- version, err := model.NewVersion(storedVersion)- if err != nil {- return nil, err- }- backup.MigrationHistoryVersion = version-- backupList = append(backupList, &backup)- }- if err := rows.Err(); err != nil {- return nil, err- }-- return backupList, nil-}--func (*Store) listBackupSettingImplV2(ctx context.Context, tx *Tx, find *FindBackupSettingMessage) ([]*BackupSettingMessage, error) {- // Build WHERE and JOIN clause.- where, args := []string{"TRUE"}, []any{}- var join []string- if v := find.DatabaseUID; v != nil {- where, args = append(where, fmt.Sprintf("backup_setting.database_id = $%d", len(args)+1)), append(args, *v)- }- if v := find.InstanceUID; v != nil {- // Relation backup_setting doesn't have instance_id column, so we need to join the db table to get the instance_id.- join = append(join, "JOIN db ON db.id = backup_setting.database_id")- where, args = append(where, fmt.Sprintf("db.instance_id = $%d", len(args)+1)), append(args, *v)- }-- rows, err := tx.QueryContext(ctx, `- SELECT- backup_setting.id,- backup_setting.updated_ts,- backup_setting.database_id,- backup_setting.enabled,- backup_setting.hour,- backup_setting.day_of_week,- backup_setting.retention_period_ts,- backup_setting.hook_url- FROM backup_setting `+- strings.Join(join, " ")+- ` WHERE `+strings.Join(where, " AND "),- args...,- )- if err != nil {- return nil, err- }- defer rows.Close()-- var backupSettingList []*BackupSettingMessage- for rows.Next() {- var backupSetting BackupSettingMessage- if err := rows.Scan(- &backupSetting.ID,- &backupSetting.UpdatedTs,- &backupSetting.DatabaseUID,- &backupSetting.Enabled,- &backupSetting.HourOfDay,- &backupSetting.DayOfWeek,- &backupSetting.RetentionPeriodTs,- &backupSetting.HookURL,- ); err != nil {- return nil, err- }- backupSettingList = append(backupSettingList, &backupSetting)- }- if err := rows.Err(); err != nil {- return nil, err- }- return backupSettingList, nil-}diff --git a/backend/store/instance.go b/backend/store/instance.goindex 3501838d70..b059067ee9 100644--- a/backend/store/instance.go+++ b/backend/store/instance.go@@ -480,48 +480,6 @@ func (s *Store) listInstanceImplV2(ctx context.Context, tx *Tx, find *FindInstanreturn instanceMessages, nil}-// FindInstanceWithDatabaseBackupEnabled finds instances with at least one database who enables backup policy.-func (s *Store) FindInstanceWithDatabaseBackupEnabled(ctx context.Context) ([]*InstanceMessage, error) {- rows, err := s.db.db.QueryContext(ctx, `- SELECT DISTINCT- instance.id- FROM instance- JOIN db ON db.instance_id = instance.id- JOIN backup_setting AS bs ON db.id = bs.database_id- WHERE bs.enabled = true AND instance.row_status = $1- `, api.Normal)- if err != nil {- return nil, err- }- defer rows.Close()- var instanceUIDs []int- for rows.Next() {- var instanceUID int- if err := rows.Scan(- &instanceUID,- ); err != nil {- return nil, err- }- instanceUIDs = append(instanceUIDs, instanceUID)- }- if err := rows.Err(); err != nil {- return nil, err- }-- var instances []*InstanceMessage- for _, instanceUID := range instanceUIDs {- instance, err := s.GetInstanceV2(ctx, &FindInstanceMessage{UID: &instanceUID})- if err != nil {- return nil, errors.Wrapf(err, "failed to get instance %v", instanceUID)- }- if instance == nil {- continue- }- instances = append(instances, instance)- }- return instances, nil-}-var countActivateInstanceQuery = "SELECT COUNT(*) FROM instance WHERE activation = TRUE AND row_status = 'NORMAL'"// CheckActivationLimit checks if activation instance count reaches the limit.diff --git a/backend/store/stats.go b/backend/store/stats.goindex 170b20425c..6f88228679 100644--- a/backend/store/stats.go+++ b/backend/store/stats.go@@ -79,72 +79,6 @@ func (s *Store) CountActiveUsers(ctx context.Context) (int, error) {return count, nil}-// CountDatabaseGroupByBackupScheduleAndEnabled counts database, group by backup schedule and enabled.-func (s *Store) CountDatabaseGroupByBackupScheduleAndEnabled(ctx context.Context) ([]*metric.DatabaseCountMetric, error) {- tx, err := s.db.BeginTx(ctx, nil)- if err != nil {- return nil, err- }- defer tx.Rollback()-- rows, err := tx.QueryContext(ctx, `- WITH database_backup_policy AS (- SELECT db.id AS database_id, backup_policy.payload AS payload- FROM db, instance LEFT JOIN (- SELECT resource_id, payload- FROM policy- WHERE type = 'bb.policy.backup-plan'- ) AS backup_policy ON instance.environment_id = backup_policy.resource_id- WHERE db.instance_id = instance.id- ), database_backup_setting AS(- SELECT db.id AS database_id, backup_setting.enabled AS enabled- FROM db LEFT JOIN backup_setting ON db.id = backup_setting.database_id- )- SELECT database_backup_policy.payload, database_backup_setting.enabled, COUNT(*)- FROM database_backup_policy FULL JOIN database_backup_setting- ON database_backup_policy.database_id = database_backup_setting.database_id- GROUP BY database_backup_policy.payload, database_backup_setting.enabled- `)- if err != nil {- return nil, err- }- defer rows.Close()-- var databaseCountMetricList []*metric.DatabaseCountMetric- for rows.Next() {- var optionalPayload sql.NullString- var optionalEnabled sql.NullBool- var count int- if err := rows.Scan(&optionalPayload, &optionalEnabled, &count); err != nil {- return nil, err- }- var backupPlanPolicySchedule *api.BackupPlanPolicySchedule- if optionalPayload.Valid {- backupPlanPolicy, err := api.UnmarshalBackupPlanPolicy(optionalPayload.String)- if err != nil {- return nil, err- }- backupPlanPolicySchedule = &backupPlanPolicy.Schedule- }- var enabled *bool- if optionalEnabled.Valid {- enabled = &optionalEnabled.Bool- }- databaseCountMetricList = append(databaseCountMetricList, &metric.DatabaseCountMetric{- BackupPlanPolicySchedule: backupPlanPolicySchedule,- BackupSettingEnabled: enabled,- Count: count,- })- }- if err := rows.Err(); err != nil {- return nil, err- }- if err := tx.Commit(); err != nil {- return nil, err- }- return databaseCountMetricList, nil-}-// CountMemberGroupByRoleAndStatus counts the number of member and group by role and status.// Used by the metric collector.func (s *Store) CountMemberGroupByRoleAndStatus(ctx context.Context) ([]*metric.MemberCountMetric, error) {diff --git a/frontend/src/components/Database/context.ts b/frontend/src/components/Database/context.tsindex 9a0947be57..986e1060d4 100644--- a/frontend/src/components/Database/context.ts+++ b/frontend/src/components/Database/context.ts@@ -12,7 +12,6 @@ import {instanceV1HasAlterSchema,instanceV1SupportSlowQuery,isArchivedDatabaseV1,- instanceV1HasBackupRestore,hasPermissionToCreateChangeDatabaseIssue,} from "@/utils";@@ -22,8 +21,6 @@ export type DatabaseDetailContext = {allowUpdateDatabase: Ref<boolean>;allowSyncDatabase: Ref<boolean>;allowTransferDatabase: Ref<boolean>;- allowListBackup: Ref<boolean>;- allowCreateBackup: Ref<boolean>;allowGetSchema: Ref<boolean>;allowChangeData: Ref<boolean>;allowAlterSchema: Ref<boolean>;@@ -80,13 +77,6 @@ export const provideDatabaseDetailContext = (return allowUpdateDatabase.value;});- const allowListBackup = computed(() => checkPermission("bb.backups.list"));- const allowCreateBackup = computed(- () =>- checkPermission("bb.backups.create") &&- instanceV1HasBackupRestore(database.value.instanceEntity)- );-const allowGetSchema = computed(() =>checkPermission("bb.databases.getSchema"));@@ -130,8 +120,6 @@ export const provideDatabaseDetailContext = (allowUpdateDatabase,allowSyncDatabase,allowTransferDatabase,- allowListBackup,- allowCreateBackup,allowGetSchema,allowChangeData,allowAlterSchema,diff --git a/frontend/src/components/DatabaseBackupCreateForm.vue b/frontend/src/components/DatabaseBackupCreateForm.vuedeleted file mode 100644index 68d8e52e95..0000000000--- a/frontend/src/components/DatabaseBackupCreateForm.vue+++ /dev/null@@ -1,76 +0,0 @@-<template>- <div- class="space-y-6 divide-y divide-block-border"- @submit.prevent="$emit('create', state.backupName)"- >- <div class="space-y-4">- <div class="grid grid-cols-3 gap-y-6 gap-x-4">- <div class="col-span-3">- <label for="name" class="textlabel">- {{ $t("database.backup-name") }} <span class="text-red-600">*</span>- </label>- <BBTextField- v-model:value="state.backupName"- required- class="mt-1 w-full"- />- </div>- </div>- </div>- <!-- Create button group -->- <div class="pt-4 flex justify-end space-x-3">- <NButton @click.prevent="$emit('cancel')">- {{ $t("common.cancel") }}- </NButton>- <NButton- type="primary"- :disabled="!allowCreate"- @click="$emit('create', state.backupName)"- >- {{ $t("database.create-backup") }}- </NButton>- </div>- </div>-</template>--<script lang="ts" setup>-import dayjs from "dayjs";-import utc from "dayjs/plugin/utc";-import { isEmpty } from "lodash-es";-import slug from "slug";-import type { PropType } from "vue";-import { computed, reactive } from "vue";-import type { ComposedDatabase } from "../types";--dayjs.extend(utc);--interface LocalState {- backupName: string;-}--const props = defineProps({- database: {- required: true,- type: Object as PropType<ComposedDatabase>,- },-});--defineEmits(["create", "cancel"]);--const buildBackupName = (database: ComposedDatabase) => {- // The default format is consistent with the default automatic backup name format used in the server.- return [- slug(props.database.projectEntity.title),- slug(props.database.effectiveEnvironmentEntity.title),- dayjs.utc().local().format("YYYYMMDDTHHmmss"),- ].join("-");-};--const state = reactive<LocalState>({- backupName: buildBackupName(props.database),-});--const allowCreate = computed(() => {- return !isEmpty(state.backupName);-});-</script>diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex aaeb48448f..52e2787c06 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -110,7 +110,6 @@"schema": "Schema","anomalies": "Anomalies","do-not-show-again": "Do not show again",- "backups": "Backups","detail": "Detail","type": "Type","language": "Language",@@ -195,7 +194,6 @@"enable": "Enable","disable": "Disable","view-doc": "View doc",- "backup-and-restore": "Backup and restore","write-only": "write only","pitr": "PITR","fix": "Fix",@@ -272,7 +270,6 @@"missing-permission": "Missing required permissions","continue-anyway": "Continue anyway","permissions": "Permissions",- "backup": "Backup","cutover": "Cutover","baseline": "Baseline","project-member": "Project member",@@ -1423,10 +1420,6 @@"create": "Create Environment","restore": "Restore this environment","successfully-updated-environment": "Successfully updated environment '{name}'.",- "disable-auto-backup": {- "self": "Disable database automatic backup",- "content": "Disabling automatic backup policy is not applied retroactively.\nAre you sure about applying to all databases in this environment?"- },"production-environment": "Production environment","access-control": {"title": "Access control",@@ -1507,16 +1500,6 @@"manual-by-workspace-admin": "Workspace admin","manual-by-custom-project-roles": "Custom project roles"},- "backup": {- "name": "Database backup schedule policy",- "tip": "The policy is not applied retroactively.",- "not-enforced": "Not enforced",- "not-enforced-info": "No backup schedule is enforced.",- "daily": "Daily backup",- "daily-info": "Enforce every database to backup daily.",- "weekly": "Weekly backup",- "weekly-info": "Enforce every database to backup weekly."- },"environment-tier": {"name": "Environment tier","description": "The environment will appear differently from other environments.",@@ -1565,7 +1548,6 @@"sync-status": "Sync status","last-successful-sync": "Last successful sync","filter-database": "Filter database",- "database-backup": "database backup","transfer-project": "Transfer Project","unassign": "Unassign","unassign-alert-title": "Unassign databases",@@ -1591,47 +1573,10 @@"batch-action-disabled-for-unassigned": "Can not {action} for unassigned database","successfully-transferred-databases": "Successfully transferred databases","successfully-transferred-updateddatabase-name-to-project-updateddatabase-project-name": "Successfully transferred '{0}' to project '{1}'.",- "backup-name": "Backup name",- "create-backup": "Create backup",- "automatic-x-backup": "Automatic {freq} backup",- "automatic-backup": "Automatic backup",- "disable-automatic-backup": "Disable automatic backup",- "backuppolicy-backup-enforced-and-cant-be-disabled": "{0} backup enforced and can't be disabled",- "backup-policy": {- "DAILY": "DAILY",- "WEEKLY": "WEEKLY"- },- "an-http-post-request-will-be-sent-to-it-after-a-successful-backup": "An HTTP POST request will be sent to it after a successful backup.",- "backup-info": {- "template": "Backup will be taken on every {dayOrWeek} at {time}. Backup data will be kept for {retentionDays} days."- },- "week": {- "Sunday": "Sunday",- "Monday": "Monday",- "Tuesday": "Tuesday",- "Wednesday": "Wednesday",- "Thursday": "Thursday",- "Friday": "Friday",- "Saturday": "Saturday",- "day": "day"- },- "enable-backup": "Enable backup",- "backup-now": "Backup now",- "create-a-manual-backup": "Create a manual backup",- "disabled": "Disabled",- "enabled": "Enabled",- "action-automatic-backup-for-database-props-database-name": "{0} automatic backup for database '{1}'.",- "updated-backup-webhook-url-for-database-props-database-name": "Updated backup webhook URL for database '{0}'.","last-sync-status": "Last sync status","last-sync-status-long": "Last sync status {0} at {1}","gitops-enabled": "GitOps enabled",- "restore-backup": "Restore backup '{0}' to a new database","nullable": "Nullable",- "restore": "Restore",- "backup": {- "enabled": "enabled",- "disabled": "disabled"- },"expression": "Expression","position": "Position","unique": "Unique",@@ -1666,20 +1611,6 @@},"show-reserved-tables": "Show Bytebase reserved tables","show-reserved-databases": "Show Bytebase reserved databases",- "backup-setting": {- "schedule": {- "disabled": "Disabled",- "weekly": "Every week",- "daily": "Every day"- },- "form": {- "schedule": "Schedule",- "day-of-week": "Day of week",- "time-of-day": "Time of day",- "retention-period": "Retention period(days)"- }- },- "backup-policy-violation": "Backup policy violation","synced-at": "Synced at {time}","not-found-last-successful-sync-was": "Not found, last successful sync was {time}","view-unassigned-databases": "View unassigned databases",@@ -1856,8 +1787,6 @@},"action": {"check-instance": "Check instance",- "view-backup": "View backup",- "configure-backup": "Configure backup","view-diff": "View diff"},"last-seen": "Last seen",@@ -2521,10 +2450,6 @@"title": "Rollout policy","desc": "Rollout policy controls whether the schema change task requires manual rolling out."},- "bb-feature-backup-policy": {- "title": "Backup policy",- "desc": "Backup policy will auto-backup your database based on the schedule."- },"bb-feature-environment-tier-policy": {"title": "Environment tier","desc": "Mark environment as production."@@ -2585,10 +2510,6 @@"title": "Online migration","desc": "Based on gh-ost. For large tables, it can reduce the table lock duration from hours to seconds."},- "bb-feature-disaster-recovery-pitr": {- "title": "Point-in-Time-Recovery (PITR)",- "desc": "Restore the database state to a point in time."- },"bb-feature-sync-schema-all-versions": {"title": "Synchronize schema all versions","desc": "Select any arbitrary migration version from the base database and synchronize it to the target database."diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex 27159ed562..7044644447 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -110,7 +110,6 @@"schema": "Esquema","anomalies": "Anomalías","do-not-show-again": "No mostrar de nuevo",- "backups": "Copias de seguridad","detail": "Detalle","type": "Tipo","language": "Idioma",@@ -195,7 +194,6 @@"enable": "Habilitar","disable": "Inhabilitar","view-doc": "Ver doc",- "backup-and-restore": "Respaldo y restauración","write-only": "solo escritura","pitr": "PITR","fix": "Corregir",@@ -272,7 +270,6 @@"missing-permission": "Faltan permisos requeridos","continue-anyway": "De todas maneras, continúe","permissions": "Permisos",- "backup": "Respaldo","cutover": "transición","baseline": "Base","project-member": "Miembro del proyecto",@@ -1423,10 +1420,6 @@"create": "Crear entorno","restore": "Restaurar este entorno","successfully-updated-environment": "entorno '{name}' actualizado exitosamente.",- "disable-auto-backup": {- "self": "Desactivar copia de seguridad automática de la base de datos",- "content": "La política de desactivación de copias de seguridad automáticas no se aplica de forma retroactiva.\n¿Está seguro de aplicarla a todas las bases de datos en este entorno?"- },"production-environment": "Entorno de producción","access-control": {"title": "Control de acceso",@@ -1507,16 +1500,6 @@"manual-by-workspace-admin": "Administrador del espacio de trabajo","manual-by-custom-project-roles": "Roles de proyecto personalizados"},- "backup": {- "name": "Política de programación de copias de seguridad de la base de datos",- "tip": "La política no se aplica retrospectivamente.",- "not-enforced": "No obligatoria",- "not-enforced-info": "No se aplica ninguna programación de copias de seguridad.",- "daily": "Copia de seguridad diaria",- "daily-info": "Aplica copias de seguridad diarias para cada base de datos.",- "weekly": "Copia de seguridad semanal",- "weekly-info": "Aplica copias de seguridad semanales para cada base de datos."- },"environment-tier": {"name": "Nivel de entorno","description": "El entorno aparecerá de manera diferente a otros entornos.",@@ -1565,7 +1548,6 @@"sync-status": "Estado de sincronización","last-successful-sync": "Última sincronización exitosa","filter-database": "Filtrar base de datos",- "database-backup": "copia de seguridad de la base de datos","transfer-project": "Transferir proyecto","unassign": "Desasignar","unassign-alert-title": "Desasignar bases de datos",@@ -1591,47 +1573,10 @@"batch-action-disabled-for-unassigned": "No se puede {action} para una base de datos no asignada","successfully-transferred-databases": "Bases de datos transferidas exitosamente","successfully-transferred-updateddatabase-name-to-project-updateddatabase-project-name": "Se transfirió correctamente '{0}' al proyecto '{1}'.",- "backup-name": "Nombre de la copia de seguridad",- "create-backup": "Crear copia de seguridad",- "automatic-x-backup": "Copia de seguridad automática cada {freq}",- "automatic-backup": "Copia de seguridad automática",- "disable-automatic-backup": "Desactivar copia de seguridad automática",- "backuppolicy-backup-enforced-and-cant-be-disabled": "Copia de seguridad {0} obligatoria y no se puede desactivar",- "backup-policy": {- "DAILY": "DIARIA",- "WEEKLY": "SEMANAL"- },- "an-http-post-request-will-be-sent-to-it-after-a-successful-backup": "Se enviará una solicitud HTTP POST después de una copia de seguridad exitosa.",- "backup-info": {- "template": "Se realizará una copia de seguridad todos los {dayOrWeek} a las {time}. Los datos de copia de seguridad se conservarán durante {retentionDays} días."- },- "week": {- "Sunday": "Domingo",- "Monday": "Lunes",- "Tuesday": "Martes",- "Wednesday": "Miércoles",- "Thursday": "Jueves",- "Friday": "Viernes",- "Saturday": "Sábado",- "day": "día"- },- "enable-backup": "Activar copia de seguridad",- "backup-now": "Realizar copia de seguridad ahora",- "create-a-manual-backup": "Crear una copia de seguridad manual",- "disabled": "Desactivado",- "enabled": "Activado",- "action-automatic-backup-for-database-props-database-name": "Copia de seguridad automática {0} para la base de datos '{1}'.",- "updated-backup-webhook-url-for-database-props-database-name": "Se actualizó la URL del webhook de copia de seguridad para la base de datos '{0}'.","last-sync-status": "Estado de sincronización anterior","last-sync-status-long": "Estado de sincronización anterior {0} a las {1}","gitops-enabled": "GitOps habilitado",- "restore-backup": "Restaurar copia de seguridad '{0}' en una nueva base de datos","nullable": "Anulable",- "restore": "Restaurar",- "backup": {- "enabled": "habilitado",- "disabled": "deshabilitado"- },"expression": "Expresión","position": "Posición","unique": "Único",@@ -1666,20 +1611,6 @@},"show-reserved-tables": "Mostrar tablas reservadas de Bytebase","show-reserved-databases": "Mostrar bases de datos reservadas de Bytebase",- "backup-setting": {- "schedule": {- "disabled": "Desactivado",- "weekly": "Cada semana",- "daily": "Cada día"- },- "form": {- "schedule": "Programar",- "day-of-week": "Día de la semana",- "time-of-day": "Hora del día",- "retention-period": "Período de retención (días)"- }- },- "backup-policy-violation": "Violación de la política de copias de seguridad","synced-at": "Sincronizado en {time}","not-found-last-successful-sync-was": "No encontrado, última sincronización exitosa fue {time}","view-unassigned-databases": "Ver bases de datos no asignadas",@@ -1856,8 +1787,6 @@},"action": {"check-instance": "Ver instancia",- "view-backup": "Ver copia de seguridad",- "configure-backup": "Configurar copia de seguridad","view-diff": "Ver diferencia"},"last-seen": "Último visto",@@ -2521,10 +2450,6 @@"title": "Política de implementación","desc": "La política de implementación controla si la tarea de cambio de esquema requiere una implementación manual."},- "bb-feature-backup-policy": {- "title": "Política de respaldo",- "desc": "La política de respaldo realizará una copia de seguridad automática de su base de datos según la programación establecida."- },"bb-feature-environment-tier-policy": {"title": "Nivel de entorno","desc": "Marque el entorno como producción."@@ -2585,10 +2510,6 @@"title": "Migración en línea","desc": "Basado en gh-ost. Para tablas grandes, puede reducir la duración del bloqueo de la tabla de horas a segundos."},- "bb-feature-disaster-recovery-pitr": {- "title": "Recuperación en punto en el tiempo (PITR)",- "desc": "Restaura el estado de la base de datos a un punto en el tiempo."- },"bb-feature-sync-schema-all-versions": {"title": "Sincronización de esquemas de todas las versiones","desc": "Selecciona cualquier versión de migración arbitraria de la base de datos y sincronízala con la base de datos de destino."diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.jsonindex 9dfe8b4a8d..cafa50ef2e 100644--- a/frontend/src/locales/ja-JP.json+++ b/frontend/src/locales/ja-JP.json@@ -110,7 +110,6 @@"schema": "スキーマ","anomalies": "異常","do-not-show-again": "再表示しない",- "backups": "バックアップ","detail": "詳細","type": "タイプ","language": "言語",@@ -195,7 +194,6 @@"enable": "有効にする","disable": "無効にする","view-doc": "ドキュメントを表示",- "backup-and-restore": "バックアップと復元","write-only": "書き込み専用","pitr": "PITR","fix": "修正",@@ -272,7 +270,6 @@"missing-permission": "必要な権限が不足しています","continue-anyway": "とにかく続けます","permissions": "権限",- "backup": "バックアップ","cutover": "カットオーバー","baseline": "ベースライン","project-member": "プロジェクトメンバー",@@ -1423,10 +1420,6 @@"create": "環境を作成する","restore": "この環境を復元する","successfully-updated-environment": "環境'{name}'が正常に更新されました。",- "disable-auto-backup": {- "self": "データベースの自動バックアップを無効にする",- "content": "自動バックアップポリシーの無効化は過去に適用されません。\nこの環境のすべてのデータベースに適用することを確認していますか?"- },"production-environment": "本番環境","access-control": {"title": "アクセス制御",@@ -1507,16 +1500,6 @@"manual-by-workspace-admin": "ワークスペース管理者","manual-by-custom-project-roles": "カスタムプロジェクト役割"},- "backup": {- "name": "データベースバックアップスケジュールポリシー",- "tip": "このポリシーは遡及的に適用されません。",- "not-enforced": "強制されていません",- "not-enforced-info": "バックアップスケジュールは強制されていません。",- "daily": "毎日のバックアップ",- "daily-info": "すべてのデータベースを毎日バックアップするように強制します。",- "weekly": "週次バックアップ",- "weekly-info": "すべてのデータベースを週次バックアップするように強制します。"- },"environment-tier": {"name": "環境ティア","description": "この環境は他の環境とは異なる表示になります。",@@ -1565,7 +1548,6 @@"sync-status": "同期ステータス","last-successful-sync": "最後の成功した同期","filter-database": "データベースをフィルターする",- "database-backup": "データベースのバックアップ","transfer-project": "プロジェクトの転送","unassign": "アンアサイン","unassign-alert-title": "データベースのアンアサイン",@@ -1591,47 +1573,10 @@"batch-action-disabled-for-unassigned": "アンアサインされたデータベースに対して{action}することはできません","successfully-transferred-databases": "データベースが正常に転送されました","successfully-transferred-updateddatabase-name-to-project-updateddatabase-project-name": "'{0}'がプロジェクト'{1}'に正常に転送されました",- "backup-name": "バックアップ名",- "create-backup": "バックアップを作成する",- "automatic-x-backup": "自動{freq}バックアップ",- "automatic-backup": "自動バックアップ",- "disable-automatic-backup": "自動バックアップを無効にする",- "backuppolicy-backup-enforced-and-cant-be-disabled": "{0}バックアップが強制されており、無効にすることはできません",- "backup-policy": {- "DAILY": "毎日",- "WEEKLY": "毎週"- },- "an-http-post-request-will-be-sent-to-it-after-a-successful-backup": "バックアップが成功した場合には、HTTP POSTリクエストが送信されます。",- "backup-info": {- "template": "バックアップは毎週の{dayOrWeek}の{time}に実行されます。バックアップデータは{retentionDays}日間保持されます。"- },- "week": {- "Sunday": "日曜日",- "Monday": "月曜日",- "Tuesday": "火曜日",- "Wednesday": "水曜日",- "Thursday": "木曜日",- "Friday": "金曜日",- "Saturday": "土曜日",- "day": "日"- },- "enable-backup": "バックアップを有効にする",- "backup-now": "今すぐバックアップ",- "create-a-manual-backup": "手動でバックアップを作成",- "disabled": "無効",- "enabled": "有効",- "action-automatic-backup-for-database-props-database-name": "データベース '{1}' の自動バックアップ {0}。",- "updated-backup-webhook-url-for-database-props-database-name": "データベース '{0}' のバックアップ Webhook URL を更新しました。","last-sync-status": "最後の同期ステータス","last-sync-status-long": "最後の同期ステータス {0} {1}","gitops-enabled": "GitOps が有効になっています",- "restore-backup": "バックアップ '{0}' を新しいデータベースに復元","nullable": "Nullable",- "restore": "復元",- "backup": {- "enabled": "有効",- "disabled": "無効"- },"expression": "式","position": "位置","unique": "ユニーク",@@ -1666,20 +1611,6 @@},"show-reserved-tables": "Bytebaseの予約済みテーブルを表示します","show-reserved-databases": "Bytebaseの予約済みデータベースを表示します",- "backup-setting": {- "schedule": {- "disabled": "無効",- "weekly": "毎週",- "daily": "毎日"- },- "form": {- "schedule": "スケジュール",- "day-of-week": "曜日",- "time-of-day": "時刻",- "retention-period": "保持期間(日)"- }- },- "backup-policy-violation": "バックアップポリシーの違反","synced-at": "{time}に同期済み","not-found-last-successful-sync-was": "見つかりませんでした、最後の成功した同期は{time}でした","view-unassigned-databases": "未割り当てのデータベースを表示する",@@ -1856,8 +1787,6 @@},"action": {"check-instance": "インスタンスのチェック",- "view-backup": "バックアップの表示",- "configure-backup": "バックアップの設定","view-diff": "差分の表示"},"last-seen": "最終確認日時",@@ -2056,7 +1985,7 @@"github-com-admin-requirement": "GitHubの組織の管理者である必要があります。","bitbucket-admin-requirement": "Bitbucketのワークスペースの管理者でなければなりません。","azure-devops-service": "Azure DevOps サービス",- "azure-admin-requirement":"Azure DevOpsの組織の管理者である必要があります。",+ "azure-admin-requirement": "Azure DevOpsの組織の管理者である必要があります。","add-success": "Gitプロバイダー {vcs} を正常に追加しました","choose": "Gitプロバイダーを選択してください","basic-info": {@@ -2521,10 +2450,6 @@"title": "展開ポリシー","desc": "展開ポリシーは、スキーマ変更タスクが手動で展開が必要かどうかを制御します。"},- "bb-feature-backup-policy": {- "title": "バックアップポリシー",- "desc": "バックアップポリシーは、スケジュールに基づいてデータベースを自動バックアップします。"- },"bb-feature-environment-tier-policy": {"title": "環境ティア","desc": "環境を本番環境としてマークします。"@@ -2585,10 +2510,6 @@"title": "オンラインマイグレーション","desc": "gh-ostをベースにしています。大きなテーブルの場合、テーブルのロック時間を数時間から数秒に短縮することができます。"},- "bb-feature-disaster-recovery-pitr": {- "title": "ポイントインタイムリカバリ(PITR)",- "desc": "データベースの状態を特定の時点に復元します。"- },"bb-feature-sync-schema-all-versions": {"title": "すべてのバージョンのスキーマを同期します","desc": "ベースデータベースから任意の移行バージョンを選択し、ターゲットデータベースに同期します。"diff --git a/frontend/src/locales/subscription/en-US.json b/frontend/src/locales/subscription/en-US.jsonindex 502f55f94c..7c2cc9028f 100644--- a/frontend/src/locales/subscription/en-US.json+++ b/frontend/src/locales/subscription/en-US.json@@ -71,11 +71,6 @@"batch-change-advanced": "Advanced","batch-change-advanced-tooltip": "Multi-environment + Multi-region / Multi-tenancy change","change-history": "Change history",- "disaster-recovery": "Disaster recovery",- "disaster-recovery-basic": "Basic",- "disaster-recovery-basic-tooltip": "Database backup / restore",- "disaster-recovery-advanced": "Advanced",- "disaster-recovery-advanced-tooltip": "Database backup / restore + Point-in-Time-Recovery (PITR)","rollout-policy": "Rollout Policy","rollout-policy-basic": "Basic","rollout-policy-basic-tooltip": "Automatic rollout",@@ -139,7 +134,6 @@"dba-workflow": "DBA workflow","dba-workflow-tooltip": "Only allow Admin and DBA to create or transfer database","environment-tier": "Environment tier",- "backup-policy": "Backup policy","sensitive-data": "Sensitive data masking","data-access-control": "Data access control","anomaly-detection": "Anomaly detection",@@ -172,7 +166,6 @@"gitops": "VCS integration #GitOps","pitr": "Point-in-Time-Recovery","sql-editor": "SQL Editor",- "database-backup-restore": "Database backup / restore","webhook-integration": "IM integration (Slack, Discord, etc)","email-support": "Email support","everything-in-free-plan": "Everything in community plan",@@ -180,7 +173,6 @@"gitlab-login": "GitLab login","online-schema-migration": "Large table online schema migration","sql-check-anomaly-detection": "Advanced SQL check and anomaly detection",- "backup-policy": "Review and backup policy","sla": "Dedicated CSM and SLA support","everything-in-team-plan": "Everything in team plan","batch-change-multi-environment": "Multi-environment batch change",diff --git a/frontend/src/locales/subscription/es-ES.json b/frontend/src/locales/subscription/es-ES.jsonindex dd317306c2..50c00b7b61 100644--- a/frontend/src/locales/subscription/es-ES.json+++ b/frontend/src/locales/subscription/es-ES.json@@ -71,11 +71,6 @@"batch-change-advanced": "Avanzado","batch-change-advanced-tooltip": "Multi-entorno + Multi-región / Cambio Multi-tenencia","change-history": "Historial de Cambios",- "disaster-recovery": "Recuperación de desastres",- "disaster-recovery-basic": "Básica",- "disaster-recovery-basic-tooltip": "Respaldo de Base de Datos / restauración",- "disaster-recovery-advanced": "Avanzado",- "disaster-recovery-advanced-tooltip": "Respaldo de Base de Datos / restauración + Recuperación en un punto en el tiempo (PITR)","rollout-policy": "Política de Despliegue","rollout-policy-basic": "Básica","rollout-policy-basic-tooltip": "Despliegue Automático",@@ -139,7 +134,6 @@"dba-workflow": "Flujo de Trabajo DBA","dba-workflow-tooltip": "Solo permita que el Administrador y el DBA creen o transfieran la base de datos","environment-tier": "Nivel de entorno",- "backup-policy": "Política de respaldo","sensitive-data": "Enmascaramiento de datos confidenciales","data-access-control": "Control de acceso a datos","anomaly-detection": "Detección de anomalías",@@ -172,7 +166,6 @@"gitops": "Integración de VCS #GitOps","pitr": "Recuperación en un punto en el tiempo","sql-editor": "Editor SQL",- "database-backup-restore": "Copia de seguridad / restauración de la base de datos","webhook-integration": "Integración IM (Slack, Discord, etc)","email-support": "Soporte por correo electrónico","everything-in-free-plan": "Todo en el plan comunitario",@@ -180,7 +173,6 @@"gitlab-login": "GitLab login","online-schema-migration": "Migración de esquema en línea para tablas grandes","sql-check-anomaly-detection": "Comprobación avanzada de SQL y detección de anomalías",- "backup-policy": "Política de revisión y copia de seguridad","sla": "Soporte dedicado de CSM y SLA","everything-in-team-plan": "Todo en plan de equipo","batch-change-multi-environment": "Cambio de lote multi-entorno",diff --git a/frontend/src/locales/subscription/ja-JP.json b/frontend/src/locales/subscription/ja-JP.jsonindex db209815ed..d1f76779b8 100644--- a/frontend/src/locales/subscription/ja-JP.json+++ b/frontend/src/locales/subscription/ja-JP.json@@ -71,11 +71,6 @@"batch-change-advanced": "高度","batch-change-advanced-tooltip": "マルチ環境+マルチリージョン/マルチテナンシー変更","change-history": "変更履歴",- "disaster-recovery": "災害復旧",- "disaster-recovery-basic": "基本",- "disaster-recovery-basic-tooltip": "データベースのバックアップ/リストア",- "disaster-recovery-advanced": "高度",- "disaster-recovery-advanced-tooltip": "データベースのバックアップ/リストア+ポイントインタイムリカバリ(PITR)","rollout-policy": "展開ポリシー","rollout-policy-basic": "基本","rollout-policy-basic-tooltip": "自動展開",@@ -139,7 +134,6 @@"dba-workflow": "DBAワークフロー","dba-workflow-tooltip": "管理者とDBAのみがデータベースの作成や移動を許可","environment-tier": "環境ティア",- "backup-policy": "バックアップポリシー","sensitive-data": "機密データのマスキング","data-access-control": "データアクセス制御","anomaly-detection": "異常検知",@@ -172,7 +166,6 @@"gitops": "VCS統合 #GitOps","pitr": "ポイントインタイムリカバリ","sql-editor": "SQLエディター",- "database-backup-restore": "データベースのバックアップ/リストア","webhook-integration": "IM統合(Slack、Discordなど)","email-support": "メールサポート","everything-in-free-plan": "コミュニティプランのすべて",@@ -180,7 +173,6 @@"gitlab-login": "GitLabログイン","online-schema-migration": "大規模テーブルのオンラインスキーマ移行","sql-check-anomaly-detection": "高度なSQLチェックと異常検出",- "backup-policy": "レビューとバックアップポリシー","sla": "専任のCSMとSLAサポート","everything-in-team-plan": "チームプランのすべて","batch-change-multi-environment": "複数環境の一括変更",diff --git a/frontend/src/locales/subscription/vi-VN.json b/frontend/src/locales/subscription/vi-VN.jsonindex 24622c77e1..e6272fc0ed 100644--- a/frontend/src/locales/subscription/vi-VN.json+++ b/frontend/src/locales/subscription/vi-VN.json@@ -71,11 +71,6 @@"batch-change-advanced": "Trình độ cao","batch-change-advanced-tooltip": "Đa môi trường + Đa vùng / Thay đổi nhiều đối tượng thuê","change-history": "Thay đổi lịch sử",- "disaster-recovery": "Khắc phục thảm họa",- "disaster-recovery-basic": "Nền tảng",- "disaster-recovery-basic-tooltip": "Sao lưu/khôi phục cơ sở dữ liệu",- "disaster-recovery-advanced": "Trình độ cao",- "disaster-recovery-advanced-tooltip": "Sao lưu/khôi phục cơ sở dữ liệu + Khôi phục theo thời điểm (PITR)","rollout-policy": "Chính sách triển khai","rollout-policy-basic": "Nền tảng","rollout-policy-basic-tooltip": "Tự động triển khai",@@ -139,7 +134,6 @@"dba-workflow": "Quy trình làm việc DBA","dba-workflow-tooltip": "Chỉ cho phép Quản trị viên và DBA tạo hoặc chuyển cơ sở dữ liệu","environment-tier": "Cấp môi trường",- "backup-policy": "Chính sách dự phòng","sensitive-data": "Che giấu dữ liệu nhạy cảm","data-access-control": "Kiểm soát truy cập dữ liệu","anomaly-detection": "Phát hiện bất thường",@@ -172,7 +166,6 @@"gitops": "Tích hợp VCS #GitOps","pitr": "Phục hồi tại thời điểm","sql-editor": "Trình soạn thảo SQL",- "database-backup-restore": "Sao lưu/khôi phục cơ sở dữ liệu","webhook-integration": "Tích hợp IM (Slack, Discord, v.v.)","email-support": "Hỗ trợ email","everything-in-free-plan": "Mọi thứ trong kế hoạch cộng đồng",@@ -180,7 +173,6 @@"gitlab-login": "Đăng nhập GitLab","online-schema-migration": "Di chuyển lược đồ trực tuyến bảng lớn","sql-check-anomaly-detection": "Kiểm tra SQL nâng cao và phát hiện bất thường",- "backup-policy": "Chính sách xem xét và sao lưu","sla": "Hỗ trợ CSM và SLA chuyên dụng","everything-in-team-plan": "Mọi thứ trong kế hoạch nhóm","batch-change-multi-environment": "Thay đổi hàng loạt đa môi trường",diff --git a/frontend/src/locales/subscription/zh-CN.json b/frontend/src/locales/subscription/zh-CN.jsonindex a120a392be..1b08f0394d 100644--- a/frontend/src/locales/subscription/zh-CN.json+++ b/frontend/src/locales/subscription/zh-CN.json@@ -71,11 +71,6 @@"batch-change-advanced": "高级","batch-change-advanced-tooltip": "多环境 + 多地域 / 多租户变更","change-history": "变更历史",- "disaster-recovery": "数据灾备",- "disaster-recovery-basic": "基础",- "disaster-recovery-basic-tooltip": "数据库备份和恢复",- "disaster-recovery-advanced": "高级",- "disaster-recovery-advanced-tooltip": "数据库备份和恢复 + 恢复到指定时间点 (PITR)","rollout-policy": "发布策略","rollout-policy-basic": "基础","rollout-policy-basic-tooltip": "自动发布",@@ -139,7 +134,6 @@"dba-workflow": "DBA 工作流","dba-workflow-tooltip": "仅允许管理员和 DBA 创建或者转移数据库","environment-tier": "环境分级",- "backup-policy": "审核和备份策略","sensitive-data": "数据脱敏","data-access-control": "数据访问控制","anomaly-detection": "异常检测",@@ -172,7 +166,6 @@"gitops": "VCS 集成 #GitOps","pitr": "恢复到指定时间点 (PITR)","sql-editor": "SQL 编辑器",- "database-backup-restore": "数据库备份和恢复","webhook-integration": "IM 集成 (Slack, Discord 等)","email-support": "邮件支持","everything-in-free-plan": "所有社区版的功能",@@ -180,7 +173,6 @@"gitlab-login": "通过 GitLab 登录","online-schema-migration": "在线大表结构变更","sql-check-anomaly-detection": "高阶 SQL 检查和异常检测",- "backup-policy": "备份策略","sla": "专属客户成功经理以及 SLA 支持","everything-in-team-plan": "所有团队版的功能","batch-change-multi-environment": "多环境批量变更",diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.jsonindex 8995067da8..b8132dbf56 100644--- a/frontend/src/locales/vi-VN.json+++ b/frontend/src/locales/vi-VN.json@@ -110,7 +110,6 @@"schema": "Lược đồ","anomalies": "dị thường","do-not-show-again": "Không hiển thị trở lại",- "backups": "Sao lưu","detail": "Chi tiết","type": "Kiểu","language": "Ngôn ngữ",@@ -195,7 +194,6 @@"enable": "Cho phép","disable": "Vô hiệu hóa","view-doc": "Xem tài liệu",- "backup-and-restore": "Sao lưu và khôi phục","write-only": "chỉ viết","pitr": "PITR","fix": "Sửa chữa",@@ -272,7 +270,6 @@"missing-permission": "Thiếu quyền cần thiết","continue-anyway": "Vẫn tiếp tục","permissions": "Quyền",- "backup": "Hỗ trợ","cutover": "Chuyển đổi","baseline": "Đường cơ sở","project-member": "Thành viên dự án",@@ -1423,10 +1420,6 @@"create": "Tạo môi trường","restore": "Khôi phục môi trường này","successfully-updated-environment": "Đã cập nhật thành công môi trường '{name}'.",- "disable-auto-backup": {- "self": "Vô hiệu hóa sao lưu tự động cơ sở dữ liệu",- "content": "Việc tắt chính sách sao lưu tự động không được áp dụng trở về trước.\nBạn có chắc chắn về việc áp dụng cho tất cả cơ sở dữ liệu trong môi trường này không?"- },"production-environment": "Môi trường sản xuất","access-control": {"title": "Kiểm soát truy cập",@@ -1507,16 +1500,6 @@"manual-by-workspace-admin": "Quản trị viên không gian làm việc","manual-by-custom-project-roles": "Vai trò dự án tùy chỉnh"},- "backup": {- "name": "Chính sách lịch trình sao lưu cơ sở dữ liệu",- "tip": "Chính sách này không được áp dụng hồi tố.",- "not-enforced": "Không thực thi",- "not-enforced-info": "Không có lịch trình sao lưu nào được thực thi.",- "daily": "Sao lưu hàng ngày",- "daily-info": "Thực thi mọi cơ sở dữ liệu để sao lưu hàng ngày.",- "weekly": "Sao lưu hàng tuần",- "weekly-info": "Thực thi mọi cơ sở dữ liệu để sao lưu hàng tuần."- },"environment-tier": {"name": "Cấp môi trường","description": "Môi trường sẽ xuất hiện khác với các môi trường khác.",@@ -1565,7 +1548,6 @@"sync-status": "Trạng thái đồng bộ hóa","last-successful-sync": "Đồng bộ hóa thành công lần cuối","filter-database": "Lọc cơ sở dữ liệu",- "database-backup": "sao lưu cơ sở dữ liệu","transfer-project": "Dự án chuyển nhượng","unassign": "Bỏ chỉ định","unassign-alert-title": "Bỏ gán cơ sở dữ liệu",@@ -1591,47 +1573,10 @@"batch-action-disabled-for-unassigned": "Không thể {action} đối với cơ sở dữ liệu chưa được chỉ định","successfully-transferred-databases": "Đã chuyển cơ sở dữ liệu thành công","successfully-transferred-updateddatabase-name-to-project-updateddatabase-project-name": "Đã chuyển thành công '{0}' sang dự án '{1}'.",- "backup-name": "Tên dự phòng",- "create-backup": "Tạo bản sao",- "automatic-x-backup": "Tự động sao lưu {freq}",- "automatic-backup": "Tự động sao lưu",- "disable-automatic-backup": "Vô hiệu hóa sao lưu tự động",- "backuppolicy-backup-enforced-and-cant-be-disabled": "Sao lưu {0} đã được thực thi và không thể tắt được",- "backup-policy": {- "DAILY": "HẰNG NGÀY",- "WEEKLY": "HÀNG TUẦN"- },- "an-http-post-request-will-be-sent-to-it-after-a-successful-backup": "Một yêu cầu HTTP POST sẽ được gửi tới nó sau khi sao lưu thành công.",- "backup-info": {- "template": "Quá trình sao lưu sẽ được thực hiện vào {dayOrWeek} hàng tuần vào lúc {time}. Dữ liệu sao lưu sẽ được lưu giữ trong {retentionDays} ngày."- },- "week": {- "Sunday": "Chủ nhật",- "Monday": "Thứ hai",- "Tuesday": "Thứ ba",- "Wednesday": "Thứ Tư",- "Thursday": "Thứ năm",- "Friday": "Thứ sáu",- "Saturday": "Thứ bảy",- "day": "ngày"- },- "enable-backup": "Bật sao lưu",- "backup-now": "Sao lưu ngay bây giờ",- "create-a-manual-backup": "Tạo bản sao lưu thủ công",- "disabled": "Tàn tật",- "enabled": "Đã bật",- "action-automatic-backup-for-database-props-database-name": "{0} sao lưu tự động cho cơ sở dữ liệu '{1}'.",- "updated-backup-webhook-url-for-database-props-database-name": "Đã cập nhật URL webhook sao lưu cho cơ sở dữ liệu '{0}'.","last-sync-status": "Trạng thái đồng bộ hóa lần cuối","last-sync-status-long": "Trạng thái đồng bộ hóa lần cuối {0} lúc {1}","gitops-enabled": "Đã bật GitOps",- "restore-backup": "Khôi phục bản sao lưu '{0}' sang cơ sở dữ liệu mới","nullable": "Có thể rỗng",- "restore": "Khôi phục",- "backup": {- "enabled": "đã bật",- "disabled": "tàn tật"- },"expression": "Sự biểu lộ","position": "Chức vụ","unique": "Độc nhất",@@ -1666,20 +1611,6 @@},"show-reserved-tables": "Hiển thị các bảng dành riêng của Bytebase","show-reserved-databases": "Hiển thị cơ sở dữ liệu dành riêng Bytebase",- "backup-setting": {- "schedule": {- "disabled": "Tàn tật",- "weekly": "Mỗi tuần",- "daily": "Hằng ngày"- },- "form": {- "schedule": "Lịch trình",- "day-of-week": "Ngày trong tuần",- "time-of-day": "Thời gian trong ngày",- "retention-period": "Thời gian lưu giữ (ngày)"- }- },- "backup-policy-violation": "Vi phạm chính sách sao lưu","synced-at": "Đã đồng bộ hóa lúc {time}","not-found-last-successful-sync-was": "Không tìm thấy, đồng bộ hóa thành công lần cuối là {time}","view-unassigned-databases": "Xem cơ sở dữ liệu chưa được chỉ định",@@ -1856,8 +1787,6 @@},"action": {"check-instance": "Kiểm tra phiên bản",- "view-backup": "Xem bản sao lưu",- "configure-backup": "Định cấu hình sao lưu","view-diff": "Xem khác biệt"},"last-seen": "Nhìn thấy lần cuối",@@ -2521,10 +2450,6 @@"title": "Chính sách triển khai","desc": "Chính sách triển khai kiểm soát xem tác vụ thay đổi lược đồ có yêu cầu triển khai thủ công hay không."},- "bb-feature-backup-policy": {- "title": "Chính sách dự phòng",- "desc": "Chính sách sao lưu sẽ tự động sao lưu cơ sở dữ liệu của bạn theo lịch trình."- },"bb-feature-environment-tier-policy": {"title": "Cấp môi trường","desc": "Đánh dấu môi trường là sản xuất."@@ -2585,10 +2510,6 @@"title": "Di chuyển trực tuyến","desc": "Dựa trên gh-ost. Đối với các bảng lớn, nó có thể giảm thời gian khóa bảng từ vài giờ xuống còn vài giây."},- "bb-feature-disaster-recovery-pitr": {- "title": "Phục hồi tại thời điểm (PITR)",- "desc": "Khôi phục trạng thái cơ sở dữ liệu về một thời điểm."- },"bb-feature-sync-schema-all-versions": {"title": "Đồng bộ hóa lược đồ tất cả các phiên bản","desc": "Chọn bất kỳ phiên bản di chuyển tùy ý nào từ cơ sở dữ liệu cơ sở và đồng bộ hóa nó với cơ sở dữ liệu đích."diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex 2159a895dc..39fac31927 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -110,7 +110,6 @@"schema": "Schema","anomalies": "异常","do-not-show-again": "不再显示",- "backups": "备份","detail": "详情","type": "类型","language": "语言",@@ -195,7 +194,6 @@"enable": "开启","disable": "禁用","view-doc": "查看文档",- "backup-and-restore": "备份与恢复","write-only": "仅写入","pitr": "PITR","fix": "修复",@@ -272,7 +270,6 @@"missing-permission": "缺少必需的权限","continue-anyway": "仍要继续","permissions": "权限",- "backup": "备份","cutover": "切换","baseline": "基线","project-member": "项目成员",@@ -1423,10 +1420,6 @@"create": "创建环境","restore": "恢复此环境","successfully-updated-environment": "环境'{name}'更新成功",- "disable-auto-backup": {- "self": "禁用数据库自动备份",- "content": "禁用自动备份策略仅对新添加的数据库生效。\n是否要将该设置应用到当前环境下的所有数据库?"- },"production-environment": "生产环境","access-control": {"title": "访问控制",@@ -1507,16 +1500,6 @@"manual-by-workspace-admin": "Bytebase 工作空间管理员","manual-by-custom-project-roles": "自定义项目角色"},- "backup": {- "name": "数据库备份策略",- "tip": "新策略仅对新添加的数据库生效",- "not-enforced": "无策略",- "not-enforced-info": "无备份策略。",- "daily": "每日",- "daily-info": "每日备份数据库。",- "weekly": "每周",- "weekly-info": "每周备份数据库。"- },"environment-tier": {"name": "环境级别","description": "使该环境在显示上不同于其他环境。",@@ -1590,48 +1573,10 @@"batch-action-disabled-for-unassigned": "无法对未分配的数据库{action}","successfully-transferred-databases": "数据库转移完成","successfully-transferred-updateddatabase-name-to-project-updateddatabase-project-name": "成功将'{0}'转移到项目'{1}'。",- "database-backup": "数据库备份",- "backup-name": "备份名称",- "create-backup": "创建备份",- "automatic-x-backup": "{freq}自动备份",- "automatic-backup": "自动备份",- "disable-automatic-backup": "禁用自动备份",- "backuppolicy-backup-enforced-and-cant-be-disabled": "强制{0}备份,不能禁用",- "backup-policy": {- "DAILY": "每日",- "WEEKLY": "每周"- },- "an-http-post-request-will-be-sent-to-it-after-a-successful-backup": "备份成功后向其发送 HTTP POST 请求。",- "backup-info": {- "template": "每{dayOrWeek} {time} 备份,数据将保留 {retentionDays} 天。"- },- "week": {- "Friday": "周五",- "Monday": "周一",- "Saturday": "周六",- "Sunday": "周日",- "Thursday": "周四",- "Wednesday": "周三",- "Tuesday": "周二",- "day": "日"- },- "enable-backup": "启用备份",- "backup-now": "现在备份",- "create-a-manual-backup": "创建手动备份",- "action-automatic-backup-for-database-props-database-name": "数据库'{1}'{0}自动备份",- "enabled": "启用",- "disabled": "禁用",- "updated-backup-webhook-url-for-database-props-database-name": "更新了数据库'{0}'的 webhook URL。","last-sync-status": "最后一次同步状态","last-sync-status-long": "最后一次同步在{1},状态为{0}","gitops-enabled": "已启用 GitOps",- "restore-backup": "恢复备份'{0}'到一个新的数据库中","nullable": "可为空",- "restore": "恢复",- "backup": {- "enabled": "已启用",- "disabled": "已禁用"- },"expression": "表达式","position": "位置","unique": "Unique",@@ -1666,20 +1611,6 @@},"show-reserved-tables": "显示 Bytebase 保留的表","show-reserved-databases": "显示 Bytebase 保留的数据库",- "backup-setting": {- "schedule": {- "disabled": "关闭",- "weekly": "每周",- "daily": "每天"- },- "form": {- "schedule": "计划",- "day-of-week": "星期",- "time-of-day": "时间",- "retention-period": "保留时长(天)"- }- },- "backup-policy-violation": "违反了备份策略","synced-at": "同步于 {time}","not-found-last-successful-sync-was": "未找到,上次成功同步于 {time}","view-unassigned-databases": "查看未分配的数据库",@@ -1856,8 +1787,6 @@},"action": {"check-instance": "检查实例",- "view-backup": "查看备份",- "configure-backup": "配置备份","view-diff": "查看差异"},"last-seen": "上次出现",@@ -2520,10 +2449,6 @@"title": "发布策略","desc": "「发布策略」可以控制数据库 schema 的变更是否需要手动发布"},- "bb-feature-backup-policy": {- "title": "备份策略",- "desc": "「备份策略」可以根据指定的周期自动备份数据库"- },"bb-feature-environment-tier-policy": {"title": "环境级别","desc": "「环境级别」可以将环境标记为生产环境"@@ -2584,10 +2509,6 @@"title": "在线大表变更","desc": "基于 gh-ost。对于大表,可以把锁表的时间从小时级降低到秒级。"},- "bb-feature-disaster-recovery-pitr": {- "title": "恢复到指定时间点 (PITR)",- "desc": "将数据库的状态恢复到一个时间点。"- },"bb-feature-sync-schema-all-versions": {"title": "库表同步","desc": "选择某个数据库的任意一个 Schema 版本,并将其同步到目标数据库。"diff --git a/frontend/src/types/iam/permission.ts b/frontend/src/types/iam/permission.tsindex f67980abd2..b430f4d2f3 100644--- a/frontend/src/types/iam/permission.ts+++ b/frontend/src/types/iam/permission.ts@@ -47,8 +47,6 @@ export type WorkspacePermission =| "bb.settings.set";export type ProjectPermission =- | "bb.backups.create"- | "bb.backups.list"| "bb.branches.create"| "bb.branches.delete"| "bb.branches.get"@@ -67,13 +65,11 @@ export type ProjectPermission =| "bb.databases.adviseIndex"| "bb.databases.export"| "bb.databases.get"- | "bb.databases.getBackupSetting"| "bb.databases.getSchema"| "bb.databases.list"| "bb.databases.query"| "bb.databases.sync"| "bb.databases.update"- | "bb.databases.updateBackupSetting"| "bb.issueComments.create"| "bb.issueComments.update"| "bb.issues.create"diff --git a/frontend/src/types/plan.ts b/frontend/src/types/plan.tsindex 2a4ffc37dd..9752b3d366 100644--- a/frontend/src/types/plan.ts+++ b/frontend/src/types/plan.ts@@ -46,7 +46,6 @@ export type FeatureType =| "bb.feature.index-advisor"// Policy Control| "bb.feature.approval-policy"- | "bb.feature.backup-policy"| "bb.feature.environment-tier-policy"| "bb.feature.sensitive-data"| "bb.feature.access-control"diff --git a/frontend/src/utils/v1/backup.ts b/frontend/src/utils/v1/backup.tsdeleted file mode 100644index c41d311779..0000000000--- a/frontend/src/utils/v1/backup.ts+++ /dev/null@@ -1,5 +0,0 @@-export const extractBackupResourceName = (name: string) => {- const pattern = /(?:^|\/)backups\/([^/]+)(?:$|\/)/;- const matches = name.match(pattern);- return matches?.[1] ?? "";-};diff --git a/frontend/src/utils/v1/instance.ts b/frontend/src/utils/v1/instance.tsindex 0da4e8b91a..ec5b41f799 100644--- a/frontend/src/utils/v1/instance.ts+++ b/frontend/src/utils/v1/instance.ts@@ -122,17 +122,6 @@ export const instanceV1HasAlterSchema = (return true;};-export const instanceV1HasBackupRestore = (- instanceOrEngine: Instance | Engine-): boolean => {- const engine = engineOfInstanceV1(instanceOrEngine);- if (engine === Engine.MONGODB) return false;- if (engine === Engine.REDIS) return false;- if (engine === Engine.SPANNER) return false;- if (engine === Engine.REDSHIFT) return false;- return true;-};-export const instanceV1HasReadonlyMode = (instanceOrEngine: Instance | Engine): boolean => {