我如何从laravel forge中删除表?(无法分发服务器)

问题描述 投票:0回答:1

我从本地数据库中删除了一个表,并将更改推送到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
php laravel eloquent forge
1个回答
0
投票

您收到此消息是因为您的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

© www.soinside.com 2019 - 2024. All rights reserved.