fix: prevent datasource json data stored as nil (#15508)

prevent datasource json data stored as nil

closes #14239
This commit is contained in:
Marcus Efraimsson
2019-03-02 21:18:26 +01:00
committed by Carl Bergquist
parent 06de01dc23
commit d49f0bedd3
2 changed files with 13 additions and 0 deletions
@@ -130,4 +130,7 @@ func addDataSourceMigration(mg *Migrator) {
const migrateLoggingToLoki = `UPDATE data_source SET type = 'loki' WHERE type = 'logging'`
mg.AddMigration("Migrate logging ds to loki ds", NewRawSqlMigration(migrateLoggingToLoki))
const setEmptyJSONWhereNullJSON = `UPDATE data_source SET json_data = '{}' WHERE json_data is null`
mg.AddMigration("Update json_data with nulls", NewRawSqlMigration(setEmptyJSONWhereNullJSON))
}