fleet/server/datastore/mysql/migrations/tables/20230313135301_AddProfileNameColumnToHostMDMAppleProfilesTable.go
Jahziel Villasana-Espinoza 9d2b07f76f
add a test that checks collation on new migrations (#29309)
> closes #26403

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [x] If database migrations are included, checked table schema to
confirm autoupdate
- For database migrations:
- [x] Ensured the correct collation is explicitly set for character
columns (`COLLATE utf8mb4_unicode_ci`).
- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-05-29 17:00:30 -04:00

22 lines
546 B
Go

package tables
import (
"database/sql"
"github.com/pkg/errors"
)
func init() {
MigrationClient.AddMigration(Up_20230313135301, Down_20230313135301)
}
func Up_20230313135301(tx *sql.Tx) error {
if _, err := tx.Exec("ALTER TABLE `host_mdm_apple_profiles` ADD COLUMN `profile_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ''"); err != nil {
return errors.Wrap(err, "adding profile_name column to `host_mdm_apple_profiles")
}
return nil
}
func Down_20230313135301(tx *sql.Tx) error {
return nil
}