def METHOD_NAME(doctype, old_fieldname, new_fieldname):
	"""This functions assumes that doctype is already synced"""
	meta = frappe.get_meta(doctype, cached=False)
	new_field = meta.get_field(new_fieldname)
	if not new_field:
		print("rename_field: " + (new_fieldname) + " not found in " + doctype)
		return
	if not meta.issingle and not frappe.db.has_column(doctype, old_fieldname):
		print("rename_field: " + (old_fieldname) + " not found in table for: " + doctype)
		# never had the field?
		return
	if new_field.fieldtype in table_fields:
		# change parentfield of table mentioned in options
		frappe.db.sql(
			"""update `tab%s` set parentfield=%s
			where parentfield=%s"""
			% (new_field.options.split("\n", 1)[0], "%s", "%s"),
			(new_fieldname, old_fieldname),
		)
	elif new_field.fieldtype not in no_value_fields:
		if meta.issingle:
			frappe.db.sql(
				"""update `tabSingles` set field=%s
				where doctype=%s and field=%s""",
				(new_fieldname, doctype, old_fieldname),
			)
		else:
			# copy field value
			frappe.db.sql(f"""update `tab{doctype}` set `{new_fieldname}`=`{old_fieldname}`""")
		update_reports(doctype, old_fieldname, new_fieldname)
		update_users_report_view_settings(doctype, old_fieldname, new_fieldname)
		if new_field.fieldtype == "Password":
			rename_password_field(doctype, old_fieldname, new_fieldname)
	# update in property setter
	update_property_setters(doctype, old_fieldname, new_fieldname)
	# update in user settings
	update_user_settings(doctype, old_fieldname, new_fieldname)