在机器之间移动项目时Laravel中的SQL错误(SQL error in Laravel when moving project between machines)

我只是将我的laravel项目从一台机器移到另一台机器上。 我没做的是: - 创建一个新的Laravel Homestead机器。 - 从我的laravel应用程序的文件夹中复制所有文件

该网站可以从我的新机器上运行,但任何依赖数据库的操作都会失败,因为这些表不是在我的新服务器中创建的。 错误如下:

QueryException in Connection.php line 673: SQLSTATE[42S02]: Base table or view not found:

迁移存在于我的新机器中,但我无法做到

php artisan migrate

或者a

php artisan migrate:刷新

既然都回归了

[Symfony\Component\Debug\Exception\FatalErrorException] Cannot declare class CreateUsersTable, because the name is already in use

我在这里度过了很多时间,我不知道该怎么做。

I just moved my laravel project from one machine to another. What I didn was: -Create a new Laravel Homestead machine. -Copy all files from my laravel app's folder

The website serves ok from my new machine but any database dependant operation fails because the tables aren't created in my new server. The error is the following:

QueryException in Connection.php line 673: SQLSTATE[42S02]: Base table or view not found:

The migrations are present in my new machine but I cant do a

php artisan migrate

or a

php artisan migrate:refresh

since both return

[Symfony\Component\Debug\Exception\FatalErrorException] Cannot declare class CreateUsersTable, because the name is already in use

I've spent so much time here I don't know what to do.

最满意答案

手动删除数据库中的所有表,包括迁移表并运行php artisan migrate

delete all the tables from the database manually including the migrations table and run php artisan migrate

在机器之间移动项目时Laravel中的SQL错误(SQL error in Laravel when moving project between machines)

我只是将我的laravel项目从一台机器移到另一台机器上。 我没做的是: - 创建一个新的Laravel Homestead机器。 - 从我的laravel应用程序的文件夹中复制所有文件

该网站可以从我的新机器上运行,但任何依赖数据库的操作都会失败,因为这些表不是在我的新服务器中创建的。 错误如下:

QueryException in Connection.php line 673: SQLSTATE[42S02]: Base table or view not found:

迁移存在于我的新机器中,但我无法做到

php artisan migrate

或者a

php artisan migrate:刷新

既然都回归了

[Symfony\Component\Debug\Exception\FatalErrorException] Cannot declare class CreateUsersTable, because the name is already in use

我在这里度过了很多时间,我不知道该怎么做。

I just moved my laravel project from one machine to another. What I didn was: -Create a new Laravel Homestead machine. -Copy all files from my laravel app's folder

The website serves ok from my new machine but any database dependant operation fails because the tables aren't created in my new server. The error is the following:

QueryException in Connection.php line 673: SQLSTATE[42S02]: Base table or view not found:

The migrations are present in my new machine but I cant do a

php artisan migrate

or a

php artisan migrate:refresh

since both return

[Symfony\Component\Debug\Exception\FatalErrorException] Cannot declare class CreateUsersTable, because the name is already in use

I've spent so much time here I don't know what to do.

最满意答案

手动删除数据库中的所有表,包括迁移表并运行php artisan migrate

delete all the tables from the database manually including the migrations table and run php artisan migrate