Umbraco MySQL upgrade issue “can't specify target table for update in FROM clause”

不打扰是莪最后的温柔 提交于 2019-12-23 05:38:05

问题


Update

It looks like the issue is due to the following MySQL statement:

UPDATE cmsTemplate SET master = NULL WHERE 'master' IS NOT NULL AND 'master' NOT IN (SELECT nodeId FROM (SELECT * FROM cmsTemplate a) b)

Any ideas on how to make the above query compatible with MySQL?

Original Issue

We are having the following error when trying to upgrade our Umbraco installation (Server Core 2012 R2 / MySQL Database):

2016-12-07 15:49:25,532 [P5184/D5/T42] ERROR Umbraco.Web.Install.Controllers.InstallApiController - Installation step DatabaseUpgrade failed.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Umbraco.Web.Install.InstallException: The database failed to upgrade.

ERROR: The database configuration failed with the following message: An error occurred running a schema migration but the changes could not be rolled back.

Error: You can't specify target table 'cmsTemplate' for update in FROM clause. In some cases, it may be required that the database be restored to it's original state before running this upgrade process again.

Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt') at Umbraco.Web.Install.InstallSteps.DatabaseUpgradeStep.Execute(Object model) --- End of inner exception stack trace ---

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Umbraco.Web.Install.Controllers.InstallApiController.ExecuteStep(InstallSetupStep step, JToken instruction)

Any ideas how to resolve?

Many thanks,

Steve

来源:https://stackoverflow.com/questions/41022667/umbraco-mysql-upgrade-issue-cant-specify-target-table-for-update-in-from-claus

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!