Alerting: Fix long KeepLast annotations failing to save (#96503)

Certain combinations of KeepLast state transition annotations exceed the current
 limit of 25 characters. This increases the column size limit to be able to
 handle the longest combination (27) with some extra space for comfort.
This commit is contained in:
Matthew Jacobson 2024-11-15 10:43:56 -05:00 committed by GitHub
parent 7d25e9ce86
commit c6a90ed3cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -183,6 +183,14 @@ func addAnnotationMig(mg *Migrator) {
mg.AddMigration("Increase tags column to length 4096", NewRawSQLMigration("").
Postgres("ALTER TABLE annotation ALTER COLUMN tags TYPE VARCHAR(4096);").
Mysql("ALTER TABLE annotation MODIFY tags VARCHAR(4096);"))
mg.AddMigration("Increase prev_state column to length 40", NewRawSQLMigration("").
Postgres("ALTER TABLE annotation ALTER COLUMN prev_state TYPE VARCHAR(40);").
Mysql("ALTER TABLE annotation MODIFY prev_state VARCHAR(40);"))
mg.AddMigration("Increase new_state column to length 40", NewRawSQLMigration("").
Postgres("ALTER TABLE annotation ALTER COLUMN new_state TYPE VARCHAR(40);").
Mysql("ALTER TABLE annotation MODIFY new_state VARCHAR(40);"))
}
type AddMakeRegionSingleRowMigration struct {