Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: remove redundant 'consolidated model' comments (#18616)
p0ny928b41af2acc
diff --git a/backend/api/v1/plan_service.go b/backend/api/v1/plan_service.goindex 94cf989e5c..31503570b7 100644--- a/backend/api/v1/plan_service.go+++ b/backend/api/v1/plan_service.go@@ -252,7 +252,6 @@ func (s *PlanService) CreatePlan(ctx context.Context, request *connect.Request[vreturn nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to create plan, error: %v", err))}- // Create consolidated plan check run if applicable.planCheckRun, err := getPlanCheckRunFromPlan(project, plan, databaseGroup)if err != nil {return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to get plan check run for plan, error: %v", err))@@ -759,7 +758,7 @@ func storePlanConfigHasRelease(plan *storepb.PlanConfig) bool {// Converters section - ordered with callers before callees.-// getPlanCheckRunFromPlan returns a single consolidated plan check run for a plan.+// getPlanCheckRunFromPlan returns the plan check run for a plan.func getPlanCheckRunFromPlan(project *store.ProjectMessage, plan *store.PlanMessage, databaseGroup *v1pb.DatabaseGroup) (*store.PlanCheckRunMessage, error) {var targets []*storepb.PlanCheckRunConfig_CheckTargetdiff --git a/backend/migrator/migration/3.14/0009##plan_check_run_unique_plan_id.sql b/backend/migrator/migration/3.14/0009##plan_check_run_unique_plan_id.sqlindex b3e3693b79..2e7b0e01bc 100644--- a/backend/migrator/migration/3.14/0009##plan_check_run_unique_plan_id.sql+++ b/backend/migrator/migration/3.14/0009##plan_check_run_unique_plan_id.sql@@ -1,4 +1,3 @@--- Drop the non-unique index and add a unique index on plan_id.--- This enforces the consolidated model (one record per plan) and enables UPSERT.+-- Replace non-unique index with unique index to enable UPSERT.DROP INDEX IF EXISTS idx_plan_check_run_plan_id;CREATE UNIQUE INDEX idx_plan_check_run_unique_plan_id ON plan_check_run(plan_id);diff --git a/backend/runner/approval/runner.go b/backend/runner/approval/runner.goindex 3f83f1c1fd..9dacefac9b 100644--- a/backend/runner/approval/runner.go+++ b/backend/runner/approval/runner.go@@ -452,7 +452,6 @@ func (r *Runner) buildCELVariablesForDatabaseChange(ctx context.Context, issue *return nil, false, errors.Errorf("plan %v not found", *issue.PlanUID)}- // Check plan check run status (consolidated model: one run per plan)planCheckRun, err := r.store.GetPlanCheckRun(ctx, plan.UID)if err != nil {return nil, false, errors.Wrapf(err, "failed to get plan check run for plan %v", plan.UID)diff --git a/backend/runner/plancheck/executor_combined.go b/backend/runner/plancheck/executor_combined.goindex 71c97fd784..e93655beb1 100644--- a/backend/runner/plancheck/executor_combined.go+++ b/backend/runner/plancheck/executor_combined.go@@ -11,7 +11,7 @@ import ("github.com/bytebase/bytebase/backend/store")-// CombinedExecutor processes all plan check types for a consolidated plan check run.+// CombinedExecutor processes all plan check types.type CombinedExecutor struct {store *store.StoresheetManager *sheet.Manager@@ -34,7 +34,7 @@ func NewCombinedExecutor(}}-// Run runs all checks for a consolidated config.+// Run runs all checks for the given config.func (e *CombinedExecutor) Run(ctx context.Context, config *storepb.PlanCheckRunConfig) ([]*storepb.PlanCheckRunResult_Result, error) {var allResults []*storepb.PlanCheckRunResult_Resultdiff --git a/backend/store/plan_check_run.go b/backend/store/plan_check_run.goindex c76a8ae85e..3d9ea30a13 100644--- a/backend/store/plan_check_run.go+++ b/backend/store/plan_check_run.go@@ -48,7 +48,6 @@ type FindPlanCheckRunMessage struct {}// CreatePlanCheckRun creates or replaces the plan check run for a plan.-// With the consolidated model, there is only one record per plan.func (s *Store) CreatePlanCheckRun(ctx context.Context, create *PlanCheckRunMessage) error {config, err := protojson.Marshal(create.Config)if err != nil {@@ -157,7 +156,6 @@ func (s *Store) GetPlanCheckRun(ctx context.Context, planUID int64) (*PlanCheckRif len(runs) == 0 {return nil, nil}- // With consolidated model, there should be only one record per planreturn runs[0], nil}diff --git a/backend/tests/sql.go b/backend/tests/sql.goindex a22c26bad2..239186d0c0 100644--- a/backend/tests/sql.go+++ b/backend/tests/sql.go@@ -41,7 +41,6 @@ func (ctl *controller) GetSQLReviewResult(ctx context.Context, plan *v1pb.Plan)return nil, err}check := resp.Msg- // With consolidated model, check if any result has STATEMENT_ADVISE typehasStatementAdvise := falsefor _, result := range check.Results {if result.Type == v1pb.PlanCheckRun_Result_STATEMENT_ADVISE {diff --git a/backend/tests/sql_review_test.go b/backend/tests/sql_review_test.goindex a90d4dbe5a..5a37de483e 100644--- a/backend/tests/sql_review_test.go+++ b/backend/tests/sql_review_test.go@@ -486,7 +486,6 @@ func createIssueAndReturnSQLReviewResult(ctx context.Context, a *require.Assertiresult, err := ctl.GetSQLReviewResult(ctx, plan.Msg)a.NoError(err)- // With consolidated model, filter to only STATEMENT_ADVISE resultsvar statementAdviseResults []*v1pb.PlanCheckRun_Resultfor _, r := range result.Results {if r.Type == v1pb.PlanCheckRun_Result_STATEMENT_ADVISE {