Skip to main content

Module mysql_text

Module mysql_text 

Source
Expand description

Long content columns on MySQL.

The framework renders an unbounded String as TEXT on MySQL, which holds 65,535 bytes; Postgres text and SQLite TEXT are unbounded. A long StreamField body, translation blob or snippet overflows it: strict mode refuses the save (ERROR 1406) and non-strict mode truncates the JSON. Until the framework maps these to a long type, widen_long_text converts them in place.

Its text columns also inherit MySQL’s default collation, which is case- and accent-insensitive, so /ABOUT served /about and slugs Hero and hero could not coexist. exact_identity_columns gives the columns the CMS looks things up by a case- and accent-sensitive collation instead.

Functions§

exact_identity_columns
On MySQL, give the CMS’s identity columns a case- and accent-sensitive collation (utf8mb4_0900_as_cs on MySQL 8), keeping each column’s type, nullability and default. Returns how many columns it changed; a no-op off MySQL and on a column already converted.
widen_long_text
On MySQL, turn every TEXT column that a registered model declares as an unbounded String into LONGTEXT, keeping its nullability and collation. Returns how many columns it changed.