Alerting: Fix saving of screenshots uploaded with a signed url (#53933)

The URL of screenshots uploaded to external image storages can be optionally signed, resulting in a long string (800+ chars).
This commit is contained in:
Valério Valério
2022-08-24 12:40:50 +01:00
committed by GitHub
parent 55c7b8add2
commit b5142832fa
2 changed files with 17 additions and 2 deletions
@@ -396,6 +396,11 @@ func AddAlertImageMigrations(mg *migrator.Migrator) {
{Cols: []string{"token"}, Type: migrator.UniqueIndex},
},
}
mg.AddMigration("create alert_image table", migrator.NewAddTableMigration(imageTable))
mg.AddMigration("add unique index on token to alert_image table", migrator.NewAddIndexMigration(imageTable, imageTable.Indices[0]))
mg.AddMigration("support longer URLs in alert_image table", migrator.NewRawSQLMigration("").
Postgres("ALTER TABLE alert_image ALTER COLUMN url TYPE VARCHAR(2048);").
Mysql("ALTER TABLE alert_image MODIFY url VARCHAR(2048) NOT NULL;"))
}