[v9.4.x] SQLStore: Fix folder migration for MySQL < 5.7 (#62786)
SQLStore: Fix folder migration for MySQL < 5.7 (#62521)
* Nested folders: Do not skip integration tests
* SQLStore: Fix folder migration
It reduces the length of the title column to be equal with the respective
dashboard column.
(cherry picked from commit 4eaff63eda)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
This commit is contained in:
co-authored by
Sofia Papagiannaki
parent
5b305cb696
commit
022abcb47d
@@ -16,6 +16,12 @@ func addFolderMigrations(mg *migrator.Migrator) {
|
||||
Cols: []string{"uid", "org_id"},
|
||||
}))
|
||||
|
||||
mg.AddMigration("Update folder title length", migrator.NewTableCharsetMigration("folder", []*migrator.Column{
|
||||
// it should be lower than 191 (the maximum length of indexable VARCHAR fields in MySQL 5.6 <= with utf8mb4 encoding)
|
||||
// but the title column length of the dashboard table whose values are copied into this column is 189
|
||||
{Name: "title", Type: migrator.DB_NVarchar, Length: 189, Nullable: false},
|
||||
}))
|
||||
|
||||
mg.AddMigration("Add unique index for folder.title and folder.parent_uid", migrator.NewAddIndexMigration(folderv1(), &migrator.Index{
|
||||
Type: migrator.UniqueIndex,
|
||||
Cols: []string{"title", "parent_uid"},
|
||||
|
||||
Reference in New Issue
Block a user