我从本地数据库中删除了一个表并将更改推送到 github,当尝试将更改部署到 laravel forge 时,我收到错误消息,提示我们无法部署服务器。我如何在我的服务器上进行更改。我是否必须通过 ssh 进入我的服务器,还是必须在我的本地机器上完成所有工作。我该怎么做才能删除表并让我的服务器再次运行?
here the error:
Sun Jan 26 19:25:36 UTC 2020
From github.com:mkesha/project-vo
* branch master -> FETCH_HEAD
2e774fb..651c301 master -> origin/master
error: Your local changes to the following files would be overwritten by merge:
vendor/composer/autoload_classmap.php
vendor/composer/autoload_static.php
Please commit your changes or stash them before you merge.
Aborting
Updating 2e774fb..651c301
您收到此消息是因为您的 Forge 部署脚本正在尝试执行拉取请求,但 Git 抛出警告导致您的部署脚本失败。您必须更改服务器上的某些文件,Git 才会抛出此警告。拉取请求未能避免覆盖这些更改。
在我的服务器上编译用于生产的应用程序资产后,我遇到了与 Forge 类似的情况。我通过在拉取请求之前将这一行添加到我的部署脚本并稍后在脚本中编译资产来解决该问题:
## Warning: This will reset local changes!
git reset --hard
git pull origin master
#...rest of the script below...
在git reset --hard
您的服务器上运行之前,请确保您了解它的作用:您的本地更改将永远丢失。
这应该可以解决您的部署错误。
现在,如果您想从您的应用程序数据库(在 Forge 或任何服务器上)中删除一个表,您应该创建一个迁移来删除该表。
Schema::dropIfExists('users');
请参阅 Laravel 文档:https ://laravel.com/docs/5.8/migrations#renaming-and-dropping-tables
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句