Explorar o código

migrations: dashboard version migration handles nulls

If a dashboard has a null value for updated_by then the migration
for the dashboard version table fails. This change uses coalesce to
set -1 instead of null when inserting into the created_by column
which has a non-null constraint. Fixes #8783.
Daniel Lee %!s(int64=8) %!d(string=hai) anos
pai
achega
6d4c29ea9b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      pkg/services/sqlstore/migrations/dashboard_version_mig.go

+ 1 - 1
pkg/services/sqlstore/migrations/dashboard_version_mig.go

@@ -50,7 +50,7 @@ SELECT
 	dashboard.version,
 	dashboard.version,
 	dashboard.version,
 	dashboard.version,
 	dashboard.updated,
 	dashboard.updated,
-	dashboard.updated_by,
+	COALESCE(dashboard.updated_by, -1),
 	'',
 	'',
 	dashboard.data
 	dashboard.data
 FROM dashboard;`
 FROM dashboard;`