utf8mb4 charset and size of text fields
-
I’m trying to figure out the correct WP scheme for 4.4.2
We use separate migrations on staging before moving to prod, so need to do it manually.I inspected the scheme at /wp-admin/includes/schema.php:60, and it does not seem to correspond to what I’m getting after upgrading the database.
So far, I noticed that upgrade script converts the tables to utf8mb4, I assume using upgrade.php:1904 maybe_convert_table_to_utf8mb4().Some of my other installs that I inspected upgraded automatically and did not convert to utf8mb4, and I see no problems there.
But on that particular website, it does convert to utf8mb4 all native wp tables, and there are several observations I would like to share:
All the text fields that are less that longtext (i.e. tinytext, text, mediumtext) get upped one level as a result of changing the charset to utf8mb4.
So, as a result of regular “Update db” after upgrading to 4.4.2 from ~3.9.3, I get the following types in the tables:
comments.comment_author => text COLLATE utf8mb4_unicode_ci NOT NULL comments.comment_content => mediumtext COLLATE utf8mb4_unicode_ci NOT NULL links.link_notes => longtext COLLATE utf8mb4_unicode_ci NOT NULL posts.post_title => mediumtext COLLATE utf8mb4_unicode_ci NOT NULL posts.post_excerpt => mediumtext COLLATE utf8mb4_unicode_ci NOT NULL posts.to_ping => mediumtext COLLATE utf8mb4_unicode_ci NOT NULL posts.pinged => mediumtext COLLATE utf8mb4_unicode_ci NOT NULL
etc. the type changes from tinytext to text etc. at the time of converting table to utf8mb4 and I wonder if it is really intended.
- The topic ‘utf8mb4 charset and size of text fields’ is closed to new replies.