diff --git a/pkg/services/sqlstore/migrations/annotation_mig.go b/pkg/services/sqlstore/migrations/annotation_mig.go index c11ab34dd13..3e2a18787c9 100644 --- a/pkg/services/sqlstore/migrations/annotation_mig.go +++ b/pkg/services/sqlstore/migrations/annotation_mig.go @@ -184,13 +184,13 @@ func addAnnotationMig(mg *Migrator) { 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 prev_state column to length 40 not null", NewRawSQLMigration(""). + Postgres("ALTER TABLE annotation ALTER COLUMN prev_state TYPE VARCHAR(40);"). // Does not modify nullability. + Mysql("ALTER TABLE annotation MODIFY prev_state VARCHAR(40) NOT NULL;")) - 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);")) + mg.AddMigration("Increase new_state column to length 40 not null", NewRawSQLMigration(""). + Postgres("ALTER TABLE annotation ALTER COLUMN new_state TYPE VARCHAR(40);"). // Does not modify nullability. + Mysql("ALTER TABLE annotation MODIFY new_state VARCHAR(40) NOT NULL;")) } type AddMakeRegionSingleRowMigration struct {