class ConvertTrainingModulesToUtf8Mb4 < ActiveRecord::Migration[6.0]
  def change
    execute "ALTER TABLE training_slides ROW_FORMAT=DYNAMIC"
    execute "ALTER TABLE training_slides CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"
    execute "ALTER TABLE training_slides MODIFY content TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"
    execute "ALTER TABLE training_slides MODIFY translations TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"
  end
end

class ConvertTrainingModulesToUtf8Mb4 < ActiveRecord::Migration[6.0]
  def change
    remove_index :training_slides, :slug, unique: true;
    execute "ALTER TABLE training_slides ROW_FORMAT=DYNAMIC"
    execute "ALTER TABLE training_slides CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"
    execute "ALTER TABLE training_slides MODIFY content TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"
    execute "ALTER TABLE training_slides MODIFY translations TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"
    add_index :training_slides, :slug, unique: true;
  end
end

Remove and re-add training slug index
Remove and re-add training slug index

This may let us work around the index size problem.
