Fixes bad SQL syntax for _update_descendant_url_paths on Microsoft SQL Server (#2838)

pull/2869/merge
Jesse Legg 2016-08-01 08:05:32 -04:00 zatwierdzone przez Matt Westcott
rodzic 43269fd763
commit ed9758d378
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -603,6 +603,12 @@ class Page(six.with_metaclass(PageBase, MP_Node, index.Indexed, ClusterableModel
SET url_path= CONCAT(%s, substring(url_path, %s))
WHERE path LIKE %s AND id <> %s
"""
elif connection.vendor in ('mssql', 'microsoft'):
update_statement = """
UPDATE wagtailcore_page
SET url_path= CONCAT(%s, (SUBSTRING(url_path, 0, %s)))
WHERE path LIKE %s AND id <> %s
"""
else:
update_statement = """
UPDATE wagtailcore_page