0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 01:46:24 +01:00

Add @kryton's fix for MySQL support in _update_descendant_url_paths, from #215

This commit is contained in:
Matt Westcott 2014-05-01 13:06:20 +01:00
parent 419b671fcc
commit ba339a0bfb

View File

@ -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