From ba339a0bfb533db729465b8efecd82f155dc0d2f Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Thu, 1 May 2014 13:06:20 +0100 Subject: [PATCH] Add @kryton's fix for MySQL support in _update_descendant_url_paths, from #215 --- wagtail/wagtailcore/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wagtail/wagtailcore/models.py b/wagtail/wagtailcore/models.py index 5c9fc0f27a..5d829aac64 100644 --- a/wagtail/wagtailcore/models.py +++ b/wagtail/wagtailcore/models.py @@ -312,6 +312,12 @@ class Page(MP_Node, ClusterableModel, Indexed): SET url_path = %s || substr(url_path, %s) WHERE path LIKE %s AND id <> %s """ + elif connection.vendor == 'mysql': + update_statement = """ + UPDATE wagtailcore_page + SET url_path= CONCAT(%s, substring(url_path, %s)) + WHERE path LIKE %s AND id <> %s + """ else: update_statement = """ UPDATE wagtailcore_page