mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 05:05:56 +08:00
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:
parent
32fa5a403c
commit
b25df66381
@ -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
|
||||
}
|
||||
|
||||
|
2737
pkg/query-service/migrate/ingestion_dashboard.go
Normal file
2737
pkg/query-service/migrate/ingestion_dashboard.go
Normal file
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user