fix: migration for ingestion dashboard (#6610)

* fix: migration for ingestion dashboard

* fix: remove redundant uuid

* Update pkg/query-service/app/dashboards/model.go

Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>

---------

Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
This commit is contained in:
Nityananda Gohain 2024-12-10 18:49:21 +05:30 committed by GitHub
parent 32fa5a403c
commit b25df66381
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2753 additions and 0 deletions

View File

@ -289,6 +289,10 @@ func GetDashboard(ctx context.Context, uuid string) (*Dashboard, *model.ApiError
return nil, &model.ApiError{Typ: model.ErrorNotFound, Err: fmt.Errorf("no dashboard found with uuid: %s", uuid)}
}
if dashboard.Data["title"] == "Ingestion" && dashboard.Data["description"] != nil {
dashboard.Data["description"] = "This dashboard is deprecated. Please use the new Ingestion V2 dashboard. " + dashboard.Data["description"].(string)
}
return &dashboard, nil
}

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,7 @@ import (
"github.com/ClickHouse/clickhouse-go/v2/lib/driver"
"github.com/jmoiron/sqlx"
"go.uber.org/zap"
)
type DataMigration struct {
@ -53,6 +54,17 @@ func Migrate(dsn string) error {
return err
}
if m, err := getMigrationVersion(conn, "0.62_ingestion_dashboard"); err == nil && m == nil {
if err := migrateIngestionDashboard(conn); err != nil {
zap.L().Error("failed to migrate 0.62_ingestion_dashboard", zap.Error(err))
} else {
_, err := conn.Exec("INSERT INTO data_migrations (version, succeeded) VALUES ('0.62_ingestion_dashboard', true)")
if err != nil {
return err
}
}
}
return nil
}