@@ -24,6 +24,7 @@ def migrate(verbose=True, rebuild_website=False): | |||||
- sync fixtures | - sync fixtures | ||||
- sync desktop icons | - sync desktop icons | ||||
- sync web pages (from /www)''' | - sync web pages (from /www)''' | ||||
frappe.flags.in_migrate = True | |||||
clear_global_cache() | clear_global_cache() | ||||
# run patches | # run patches | ||||
@@ -53,3 +54,4 @@ def migrate(verbose=True, rebuild_website=False): | |||||
clear_notifications() | clear_notifications() | ||||
frappe.publish_realtime("version-update") | frappe.publish_realtime("version-update") | ||||
frappe.flags.in_migrate = False |
@@ -98,7 +98,7 @@ def execute_patch(patchmodule, method=None, methodargs=None): | |||||
def update_patch_log(patchmodule): | def update_patch_log(patchmodule): | ||||
"""update patch_file in patch log""" | """update patch_file in patch log""" | ||||
frappe.get_doc({"doctype": "Patch Log", "patch": patchmodule}).insert() | |||||
frappe.get_doc({"doctype": "Patch Log", "patch": patchmodule}).insert(ignore_permissions=True) | |||||
def executed(patchmodule): | def executed(patchmodule): | ||||
"""return True if is executed""" | """return True if is executed""" | ||||
@@ -1,6 +1,7 @@ | |||||
execute:frappe.db.sql("""update `tabPatch Log` set patch=replace(patch, '.4_0.', '.v4_0.')""") #2014-05-12 | execute:frappe.db.sql("""update `tabPatch Log` set patch=replace(patch, '.4_0.', '.v4_0.')""") #2014-05-12 | ||||
frappe.patches.v5_0.convert_to_barracuda_and_utf8mb4 | frappe.patches.v5_0.convert_to_barracuda_and_utf8mb4 | ||||
execute:frappe.utils.global_search.setup_global_search_table() | execute:frappe.utils.global_search.setup_global_search_table() | ||||
frappe.patches.v8_0.update_global_search_table | |||||
frappe.patches.v7_0.update_auth | frappe.patches.v7_0.update_auth | ||||
frappe.patches.v7_1.rename_scheduler_log_to_error_log | frappe.patches.v7_1.rename_scheduler_log_to_error_log | ||||
frappe.patches.v7_3.rename_page_role_to_has_role | frappe.patches.v7_3.rename_page_role_to_has_role | ||||
@@ -8,8 +8,11 @@ def execute(): | |||||
""" | """ | ||||
frappe.reload_doc("core", "doctype", "feedback_request") | frappe.reload_doc("core", "doctype", "feedback_request") | ||||
frappe.db.sql("""update tabCommunication set content=ifnull(feedback, "feedback details not provided") | |||||
where communication_type="Feedback" and content is NULL""") | |||||
frappe.reload_doc("core", "doctype", "communication") | |||||
if frappe.db.has_column('Communication', 'feedback'): | |||||
frappe.db.sql("""update tabCommunication set content=ifnull(feedback, "feedback details not provided") | |||||
where communication_type="Feedback" and content is NULL""") | |||||
frappe.db.sql(""" update tabCommunication set sender_full_name="" where communication_type="Feedback" | frappe.db.sql(""" update tabCommunication set sender_full_name="" where communication_type="Feedback" | ||||
and sender_full_name='Guest None' """) | and sender_full_name='Guest None' """) | ||||
@@ -1,8 +1,9 @@ | |||||
import frappe | import frappe | ||||
from frappe.utils.global_search import rebuild_for_doctype | |||||
def execute(): | def execute(): | ||||
from frappe.website.router import get_doctypes_with_web_view | from frappe.website.router import get_doctypes_with_web_view | ||||
from frappe.utils.global_search import rebuild_for_doctype | |||||
if not 'published' in frappe.db.get_db_table_columns('__global_search'): | if not 'published' in frappe.db.get_db_table_columns('__global_search'): | ||||
frappe.db.sql('''alter table __global_search | frappe.db.sql('''alter table __global_search | ||||
add column `title` varchar(140)''') | add column `title` varchar(140)''') | ||||
@@ -51,7 +51,8 @@ def update_controller_context(context, controller): | |||||
except frappe.PermissionError: | except frappe.PermissionError: | ||||
raise | raise | ||||
except: | except: | ||||
frappe.errprint(frappe.utils.get_traceback()) | |||||
if not frappe.flags.in_migrate: | |||||
frappe.errprint(frappe.utils.get_traceback()) | |||||
if hasattr(module, "get_children"): | if hasattr(module, "get_children"): | ||||
context.children = module.get_children(context) | context.children = module.get_children(context) | ||||
@@ -8,5 +8,6 @@ no_cache = 1 | |||||
no_sitemap = 1 | no_sitemap = 1 | ||||
def get_context(context): | def get_context(context): | ||||
if frappe.flags.in_migrate: return | |||||
print frappe.get_traceback().encode("utf-8") | print frappe.get_traceback().encode("utf-8") | ||||
return {"error": frappe.get_traceback().replace("<", "<").replace(">", ">") } | return {"error": frappe.get_traceback().replace("<", "<").replace(">", ">") } |