Merge pull request #8111 from adityahase/fix-comments
fix(comments): Remove size restriction on _comments column
This commit is contained in:
commit
6a9b21c2d4
3 changed files with 14 additions and 2 deletions
|
|
@ -228,7 +228,7 @@ class DbTable:
|
|||
for fieldname in optional_columns:
|
||||
fl.append({
|
||||
"fieldname": fieldname,
|
||||
"fieldtype": "Text"
|
||||
"fieldtype": "Long Text"
|
||||
})
|
||||
|
||||
# add _seen column if track_seen
|
||||
|
|
|
|||
|
|
@ -248,4 +248,5 @@ frappe.patches.v12_0.move_form_attachments_to_attachments_folder
|
|||
frappe.patches.v12_0.move_timeline_links_to_dynamic_links
|
||||
frappe.patches.v12_0.delete_feedback_request_if_exists #1
|
||||
frappe.patches.v12_0.rename_events_repeat_on
|
||||
frappe.patches.v12_0.fix_public_private_files
|
||||
frappe.patches.v12_0.fix_public_private_files
|
||||
frappe.patches.v12_0.change_comments_column_data_type_to_longtext
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
import frappe
|
||||
from frappe.core.utils import find
|
||||
|
||||
def execute():
|
||||
if frappe.db.db_type != "postgres":
|
||||
doctypes = frappe.get_all("DocType")
|
||||
for doctype in doctypes:
|
||||
columns = frappe.db.get_table_columns_description("tab{}".format(doctype.name))
|
||||
comments_column = find(columns, lambda x: x.name == "_comments")
|
||||
if comments_column and comments_column.type != "longtext":
|
||||
frappe.db.sql("ALTER TABLE `tab{}` MODIFY _comments LONGTEXT".format(doctype.name))
|
||||
Loading…
Add table
Reference in a new issue