text: -- Addition for 5.0
  
  UPDATE `{tbl_prefix}action_log` SET action_type = convert(cast(convert(action_type using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}action_log` SET action_username = convert(cast(convert(action_username using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}action_log` SET action_useremail = convert(cast(convert(action_useremail using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}action_log` SET action_ip = convert(cast(convert(action_ip using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}action_log` SET action_details = convert(cast(convert(action_details using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}admin_notes` SET note = convert(cast(convert(note using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}admin_todo` SET todo = convert(cast(convert(todo using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}ads_data` SET ad_name = convert(cast(convert(ad_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}ads_data` SET ad_code = convert(cast(convert(ad_code using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}ads_data` SET ad_placement = convert(cast(convert(ad_placement using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}ads_placements` SET placement = convert(cast(convert(placement using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}ads_placements` SET placement_name = convert(cast(convert(placement_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}collection_categories` SET category_name = convert(cast(convert(category_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}collection_categories` SET category_desc = convert(cast(convert(category_desc using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}collection_categories` SET date_added = convert(cast(convert(date_added using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}collection_items` SET type = convert(cast(convert(type using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}collections` SET collection_name = convert(cast(convert(collection_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}collections` SET collection_description = convert(cast(convert(collection_description using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}collections` SET collection_tags = convert(cast(convert(collection_tags using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}collections` SET category = convert(cast(convert(category using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}collections` SET featured = convert(cast(convert(featured using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}collections` SET broadcast = convert(cast(convert(broadcast using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}collections` SET allow_comments = convert(cast(convert(allow_comments using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}collections` SET active = convert(cast(convert(active using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}collections` SET public_upload = convert(cast(convert(public_upload using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}collections` SET type = convert(cast(convert(type using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}comments` SET type = convert(cast(convert(type using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}comments` SET comment = convert(cast(convert(comment using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}comments` SET anonym_name = convert(cast(convert(anonym_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}comments` SET anonym_email = convert(cast(convert(anonym_email using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}comments` SET vote = convert(cast(convert(vote using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}comments` SET voters = convert(cast(convert(voters using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}comments` SET spam_voters = convert(cast(convert(spam_voters using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}comments` SET comment_ip = convert(cast(convert(comment_ip using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}config` SET name = convert(cast(convert(name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}config` SET value = convert(cast(convert(value using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}conversion_queue` SET cqueue_name = convert(cast(convert(cqueue_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}conversion_queue` SET cqueue_ext = convert(cast(convert(cqueue_ext using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}conversion_queue` SET cqueue_tmp_ext = convert(cast(convert(cqueue_tmp_ext using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}conversion_queue` SET time_started = convert(cast(convert(time_started using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}conversion_queue` SET time_completed = convert(cast(convert(time_completed using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}counters` SET section = convert(cast(convert(section using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}counters` SET query = convert(cast(convert(query using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}counters` SET query_md5 = convert(cast(convert(query_md5 using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}counters` SET date_added = convert(cast(convert(date_added using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}countries` SET iso2 = convert(cast(convert(iso2 using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}countries` SET name = convert(cast(convert(name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}countries` SET name_en = convert(cast(convert(name_en using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}countries` SET iso3 = convert(cast(convert(iso3 using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}email_templates` SET email_template_name = convert(cast(convert(email_template_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}email_templates` SET email_template_code = convert(cast(convert(email_template_code using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}email_templates` SET email_template_subject = convert(cast(convert(email_template_subject using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}email_templates` SET email_template = convert(cast(convert(email_template using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}email_templates` SET email_template_allowed_tags = convert(cast(convert(email_template_allowed_tags using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}favorites` SET type = convert(cast(convert(type using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}flags` SET type = convert(cast(convert(type using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}group_categories` SET category_name = convert(cast(convert(category_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}group_categories` SET category_desc = convert(cast(convert(category_desc using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}group_categories` SET date_added = convert(cast(convert(date_added using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}group_categories` SET category_thumb = convert(cast(convert(category_thumb using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}group_posts` SET post_content = convert(cast(convert(post_content using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}group_topics` SET topic_title = convert(cast(convert(topic_title using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}group_topics` SET topic_post = convert(cast(convert(topic_post using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}group_topics` SET topic_icon = convert(cast(convert(topic_icon using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}groups` SET group_name = convert(cast(convert(group_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}groups` SET group_admins = convert(cast(convert(group_admins using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}groups` SET group_description = convert(cast(convert(group_description using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}groups` SET group_tags = convert(cast(convert(group_tags using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}groups` SET group_url = convert(cast(convert(group_url using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}groups` SET category = convert(cast(convert(category using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}languages` SET language_code = convert(cast(convert(language_code using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}languages` SET language_name = convert(cast(convert(language_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}languages` SET language_regex = convert(cast(convert(language_regex using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}mass_emails` SET email_subj = convert(cast(convert(email_subj using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}mass_emails` SET email_from = convert(cast(convert(email_from using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}mass_emails` SET email_msg = convert(cast(convert(email_msg using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}mass_emails` SET configs = convert(cast(convert(configs using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}mass_emails` SET users = convert(cast(convert(users using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}messages` SET message_to = convert(cast(convert(message_to using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}messages` SET message_content = convert(cast(convert(message_content using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}messages` SET message_attachments = convert(cast(convert(message_attachments using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}messages` SET message_subject = convert(cast(convert(message_subject using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}modules` SET module_name = convert(cast(convert(module_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}modules` SET module_file = convert(cast(convert(module_file using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}modules` SET active = convert(cast(convert(active using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}modules` SET module_include_file = convert(cast(convert(module_include_file using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}pages` SET page_name = convert(cast(convert(page_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}pages` SET page_title = convert(cast(convert(page_title using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}pages` SET page_content = convert(cast(convert(page_content using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}photos` SET photo_key = convert(cast(convert(photo_key using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}photos` SET photo_title = convert(cast(convert(photo_title using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}photos` SET photo_description = convert(cast(convert(photo_description using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}photos` SET photo_tags = convert(cast(convert(photo_tags using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}photos` SET voters = convert(cast(convert(voters using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}photos` SET filename = convert(cast(convert(filename using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}photos` SET file_directory = convert(cast(convert(file_directory using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}photos` SET ext = convert(cast(convert(ext using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}photos` SET server_url = convert(cast(convert(server_url using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}photos` SET owner_ip = convert(cast(convert(owner_ip using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}photos` SET photo_details = convert(cast(convert(photo_details using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}phrases` SET lang_iso = convert(cast(convert(lang_iso using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}phrases` SET varname = convert(cast(convert(varname using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}phrases` SET text = convert(cast(convert(text using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}playlist_items` SET playlist_item_type = convert(cast(convert(playlist_item_type using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}playlists` SET playlist_name = convert(cast(convert(playlist_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}playlists` SET playlist_type = convert(cast(convert(playlist_type using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}playlists` SET description = convert(cast(convert(description using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}playlists` SET tags = convert(cast(convert(tags using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}playlists` SET voters = convert(cast(convert(voters using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}playlists` SET last_update = convert(cast(convert(last_update using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}playlists` SET first_item = convert(cast(convert(first_item using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}playlists` SET cover = convert(cast(convert(cover using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}plugin_config` SET plugin_id_code = convert(cast(convert(plugin_id_code using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}plugin_config` SET plugin_config_name = convert(cast(convert(plugin_config_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}plugin_config` SET plugin_config_value = convert(cast(convert(plugin_config_value using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}plugin_config` SET player_admin_file = convert(cast(convert(player_admin_file using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}plugin_config` SET player_include_file = convert(cast(convert(player_include_file using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}plugins` SET plugin_file = convert(cast(convert(plugin_file using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}plugins` SET plugin_folder = convert(cast(convert(plugin_folder using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}plugins` SET plugin_license_type = convert(cast(convert(plugin_license_type using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}plugins` SET plugin_license_key = convert(cast(convert(plugin_license_key using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}plugins` SET plugin_license_code = convert(cast(convert(plugin_license_code using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}sessions` SET session = convert(cast(convert(session using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}sessions` SET session_string = convert(cast(convert(session_string using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}sessions` SET session_value = convert(cast(convert(session_value using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}sessions` SET ip = convert(cast(convert(ip using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}sessions` SET current_page = convert(cast(convert(current_page using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}sessions` SET referer = convert(cast(convert(referer using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}sessions` SET agent = convert(cast(convert(agent using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}stats` SET video_stats = convert(cast(convert(video_stats using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}stats` SET user_stats = convert(cast(convert(user_stats using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}stats` SET group_stats = convert(cast(convert(group_stats using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}subscriptions` SET subscribed_to = convert(cast(convert(subscribed_to using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}template` SET template_name = convert(cast(convert(template_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}template` SET template_dir = convert(cast(convert(template_dir using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_categories` SET category_name = convert(cast(convert(category_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_categories` SET category_desc = convert(cast(convert(category_desc using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_categories` SET date_added = convert(cast(convert(date_added using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_categories` SET category_thumb = convert(cast(convert(category_thumb using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_levels` SET user_level_name = convert(cast(convert(user_level_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_levels_permissions` SET plugins_perms = convert(cast(convert(plugins_perms using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_permission_types` SET user_permission_type_name = convert(cast(convert(user_permission_type_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_permission_types` SET user_permission_type_desc = convert(cast(convert(user_permission_type_desc using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_permissions` SET permission_name = convert(cast(convert(permission_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_permissions` SET permission_code = convert(cast(convert(permission_code using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_permissions` SET permission_desc = convert(cast(convert(permission_desc using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET profile_title = convert(cast(convert(profile_title using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET profile_desc = convert(cast(convert(profile_desc using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET featured_video = convert(cast(convert(featured_video using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET first_name = convert(cast(convert(first_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET last_name = convert(cast(convert(last_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET avatar = convert(cast(convert(avatar using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET postal_code = convert(cast(convert(postal_code using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET profile_tags = convert(cast(convert(profile_tags using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET web_url = convert(cast(convert(web_url using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET hometown = convert(cast(convert(hometown using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET city = convert(cast(convert(city using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET browse_criteria = convert(cast(convert(browse_criteria using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET about_me = convert(cast(convert(about_me using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET education = convert(cast(convert(education using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET schools = convert(cast(convert(schools using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET occupation = convert(cast(convert(occupation using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET companies = convert(cast(convert(companies using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET relation_status = convert(cast(convert(relation_status using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET hobbies = convert(cast(convert(hobbies using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET fav_movies = convert(cast(convert(fav_movies using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET fav_music = convert(cast(convert(fav_music using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET fav_books = convert(cast(convert(fav_books using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET background = convert(cast(convert(background using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET profile_item = convert(cast(convert(profile_item using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}user_profile` SET voters = convert(cast(convert(voters using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET featured_video = convert(cast(convert(featured_video using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET username = convert(cast(convert(username using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET user_session_key = convert(cast(convert(user_session_key using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET password = convert(cast(convert(password using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET email = convert(cast(convert(email using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET avatar = convert(cast(convert(avatar using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET avatar_url = convert(cast(convert(avatar_url using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET country = convert(cast(convert(country using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET avcode = convert(cast(convert(avcode using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET session = convert(cast(convert(session using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET ip = convert(cast(convert(ip using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET signup_ip = convert(cast(convert(signup_ip using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET upload = convert(cast(convert(upload using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET background = convert(cast(convert(background using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET background_color = convert(cast(convert(background_color using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET background_url = convert(cast(convert(background_url using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}users` SET banned_users = convert(cast(convert(banned_users using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}validation_re` SET re_name = convert(cast(convert(re_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}validation_re` SET re_code = convert(cast(convert(re_code using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}validation_re` SET re_syntax = convert(cast(convert(re_syntax using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET videokey = convert(cast(convert(videokey using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET video_password = convert(cast(convert(video_password using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET video_users = convert(cast(convert(video_users using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET username = convert(cast(convert(username using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET title = convert(cast(convert(title using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET flv = convert(cast(convert(flv using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET file_name = convert(cast(convert(file_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET file_directory = convert(cast(convert(file_directory using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET description = convert(cast(convert(description using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET tags = convert(cast(convert(tags using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET category = convert(cast(convert(category using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET category_parents = convert(cast(convert(category_parents using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET broadcast = convert(cast(convert(broadcast using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET location = convert(cast(convert(location using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET country = convert(cast(convert(country using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET allow_embedding = convert(cast(convert(allow_embedding using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET rated_by = convert(cast(convert(rated_by using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET voter_ids = convert(cast(convert(voter_ids using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET allow_comments = convert(cast(convert(allow_comments using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET comment_voting = convert(cast(convert(comment_voting using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET featured = convert(cast(convert(featured using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET featured_description = convert(cast(convert(featured_description using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET allow_rating = convert(cast(convert(allow_rating using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET active = convert(cast(convert(active using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET favourite_count = convert(cast(convert(favourite_count using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET playlist_count = convert(cast(convert(playlist_count using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET flagged = convert(cast(convert(flagged using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET duration = convert(cast(convert(duration using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET flv_file_url = convert(cast(convert(flv_file_url using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET aspect_ratio = convert(cast(convert(aspect_ratio using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET embed_code = convert(cast(convert(embed_code using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET refer_url = convert(cast(convert(refer_url using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET uploader_ip = convert(cast(convert(uploader_ip using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET unique_embed_code = convert(cast(convert(unique_embed_code using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET remote_play_url = convert(cast(convert(remote_play_url using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET server_ip = convert(cast(convert(server_ip using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET file_server_path = convert(cast(convert(file_server_path using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET files_thumbs_path = convert(cast(convert(files_thumbs_path using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET file_thumbs_count = convert(cast(convert(file_thumbs_count using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET filegrp_size = convert(cast(convert(filegrp_size using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET video_version = convert(cast(convert(video_version using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET extras = convert(cast(convert(extras using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video` SET thumbs_version = convert(cast(convert(thumbs_version using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_categories` SET category_name = convert(cast(convert(category_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_categories` SET category_desc = convert(cast(convert(category_desc using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_categories` SET date_added = convert(cast(convert(date_added using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_categories` SET category_thumb = convert(cast(convert(category_thumb using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET file_conversion_log = convert(cast(convert(file_conversion_log using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET encoder = convert(cast(convert(encoder using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET command_used = convert(cast(convert(command_used using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_path = convert(cast(convert(src_path using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_name = convert(cast(convert(src_name using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_ext = convert(cast(convert(src_ext using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_format = convert(cast(convert(src_format using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_duration = convert(cast(convert(src_duration using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_size = convert(cast(convert(src_size using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_bitrate = convert(cast(convert(src_bitrate using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_video_width = convert(cast(convert(src_video_width using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_video_height = convert(cast(convert(src_video_height using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_video_wh_ratio = convert(cast(convert(src_video_wh_ratio using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_video_codec = convert(cast(convert(src_video_codec using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_video_rate = convert(cast(convert(src_video_rate using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_video_bitrate = convert(cast(convert(src_video_bitrate using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_video_color = convert(cast(convert(src_video_color using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_audio_codec = convert(cast(convert(src_audio_codec using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_audio_bitrate = convert(cast(convert(src_audio_bitrate using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_audio_rate = convert(cast(convert(src_audio_rate using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET src_audio_channels = convert(cast(convert(src_audio_channels using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET output_path = convert(cast(convert(output_path using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET output_format = convert(cast(convert(output_format using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET output_duration = convert(cast(convert(output_duration using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET output_size = convert(cast(convert(output_size using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET output_bitrate = convert(cast(convert(output_bitrate using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET output_video_width = convert(cast(convert(output_video_width using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET output_video_height = convert(cast(convert(output_video_height using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET output_video_wh_ratio = convert(cast(convert(output_video_wh_ratio using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET output_video_codec = convert(cast(convert(output_video_codec using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET output_video_rate = convert(cast(convert(output_video_rate using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET output_video_bitrate = convert(cast(convert(output_video_bitrate using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET output_video_color = convert(cast(convert(output_video_color using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET output_audio_codec = convert(cast(convert(output_audio_codec using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET output_audio_bitrate = convert(cast(convert(output_audio_bitrate using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET output_audio_rate = convert(cast(convert(output_audio_rate using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_files` SET output_audio_channels = convert(cast(convert(output_audio_channels using  latin1) as binary) using utf8);
  UPDATE `{tbl_prefix}video_views` SET video_id = convert(cast(convert(video_id using  latin1) as binary) using utf8);
  
  INSERT INTO `{tbl_prefix}config`(`name`, `value`) VALUES
  	('password_salt', SUBSTRING(HEX(SHA2(CONCAT(NOW(), RAND(), UUID()), 512)),1, 32) ),
  	('show_collapsed_checkboxes', '0'),
  	('enable_advertisement', '0'),
  	('chromecast', 'no'),
  	('vid_cat_width', '120'),
  	('vid_cat_height', '120');
  
  ALTER TABLE `{tbl_prefix}users` CHANGE `password` `password` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
  
  ALTER TABLE `{tbl_prefix}user_levels_permissions` ADD `view_photos` ENUM('yes', 'no') NOT NULL DEFAULT 'yes' AFTER `view_video`;
  ALTER TABLE `{tbl_prefix}user_levels_permissions` ADD `view_collections` ENUM('yes', 'no') NOT NULL DEFAULT 'yes' AFTER `view_photos`;
  
  INSERT INTO `{tbl_prefix}user_permissions` (`permission_type`, `permission_name`, `permission_code`, `permission_desc`, `permission_default`) VALUES
  	(1, 'View Photos Page', 'view_photos', 'User can view photos page', 'yes'),
  	(1, 'View Collections Page', 'view_collections', 'User can view collections page', 'yes');