I want to increase the Frappe document name field from VARCHAR(140) to VARCHAR(255)

I want to increase the Frappe document name field from VARCHAR(140) to VARCHAR(255) permanently. I don’t want the change to be reverted to 140 after running bench migrate. Could you please provide the correct way to make this change permanently, including any required changes to Frappe’s schema or related Link fields?

name gets its size from frappe.db.VARCHAR_LEN (140), and migrate rewrites it from there, so you’d have to change that constant and alter every varchar(140) column. Even then, framework_mariadb.sql hardcodes 140, so new sites and restored backups come back at 140.

Also, InnoDB stores the primary key inside every secondary index, so longer name values make every index on that table bigger, not just the name column.

Easier: short name (hash or series), long text in a Data field (length up to 1000), set as Title Field with “Show Title in Link Fields”.

What’s the use case, what are you trying to store in name?