Alerting: Fix annotation state migration to retain nullability on MySQL (#96640)

This commit is contained in:
Matthew Jacobson 2024-11-18 15:51:45 -05:00 committed by GitHub
parent 5a84048b9a
commit 2364299a8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -184,13 +184,13 @@ func addAnnotationMig(mg *Migrator) {
Postgres("ALTER TABLE annotation ALTER COLUMN tags TYPE VARCHAR(4096);"). Postgres("ALTER TABLE annotation ALTER COLUMN tags TYPE VARCHAR(4096);").
Mysql("ALTER TABLE annotation MODIFY tags VARCHAR(4096);")) Mysql("ALTER TABLE annotation MODIFY tags VARCHAR(4096);"))
mg.AddMigration("Increase prev_state column to length 40", NewRawSQLMigration(""). mg.AddMigration("Increase prev_state column to length 40 not null", NewRawSQLMigration("").
Postgres("ALTER TABLE annotation ALTER COLUMN prev_state TYPE VARCHAR(40);"). Postgres("ALTER TABLE annotation ALTER COLUMN prev_state TYPE VARCHAR(40);"). // Does not modify nullability.
Mysql("ALTER TABLE annotation MODIFY prev_state VARCHAR(40);")) Mysql("ALTER TABLE annotation MODIFY prev_state VARCHAR(40) NOT NULL;"))
mg.AddMigration("Increase new_state column to length 40", NewRawSQLMigration(""). mg.AddMigration("Increase new_state column to length 40 not null", NewRawSQLMigration("").
Postgres("ALTER TABLE annotation ALTER COLUMN new_state TYPE VARCHAR(40);"). Postgres("ALTER TABLE annotation ALTER COLUMN new_state TYPE VARCHAR(40);"). // Does not modify nullability.
Mysql("ALTER TABLE annotation MODIFY new_state VARCHAR(40);")) Mysql("ALTER TABLE annotation MODIFY new_state VARCHAR(40) NOT NULL;"))
} }
type AddMakeRegionSingleRowMigration struct { type AddMakeRegionSingleRowMigration struct {