在我的Laravel 8项目上迁移控制器时错误
在Laravel 8课程之后,我正在从事我的大学项目。删除了权限,角色和角色和角色的表格表(我正在使用Spatie),我不知道为什么,但是我正在搜索再次创建这些表,但我正在键入PHP Artisan Migrate
和现在出现此错误:
Migrating: 2022_05_15_135154_create_providers_table
Illuminate\Database\QueryException
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'providers' already exists (SQL: create table `providers` (`id` bigint unsigned not null auto_increment primary key, `name` varchar(255) not null, `businessName` varchar(255) not null, `rut` varchar(255) not null, `adress` varchar(255) not null, `city` varchar(255) not null, `country` varchar(255) not null, `phone` varchar(255) not null, `email` varchar(255) not null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')
at C:\xampp\htdocs\crud_habibi\vendor\laravel\framework\src\Illuminate\Database\Connection.php:742
738▕ // If an exception occurs when attempting to run a query, we'll format the error
739▕ // message to include the bindings with SQL, which will make this exception a
740▕ // lot more helpful to the developer instead of just the database's errors.
741▕ catch (Exception $e) {
➜ 742▕ throw new QueryException(
743▕ $query, $this->prepareBindings($bindings), $e
744▕ );
745▕ }
746▕ }
1 C:\xampp\htdocs\crud_habibi\vendor\laravel\framework\src\Illuminate\Database\Connection.php:527
PDOException::("SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'providers' already exists")
2 C:\xampp\htdocs\crud_habibi\vendor\laravel\framework\src\Illuminate\Database\Connection.php:527
PDOStatement::execute()
I'm working on my project of my university following a course of Laravel 8. I have all fine but in a moment, the teacher said to write the command: php artisan migrate:fresh -seed
and my tables of permissions, roles and roleHasPermissions was deleted (I'm using Spatie), I don't know why, but I'm searching to create again these tables but I'm typing php artisan migrate
and now appears this error:
Migrating: 2022_05_15_135154_create_providers_table
Illuminate\Database\QueryException
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'providers' already exists (SQL: create table `providers` (`id` bigint unsigned not null auto_increment primary key, `name` varchar(255) not null, `businessName` varchar(255) not null, `rut` varchar(255) not null, `adress` varchar(255) not null, `city` varchar(255) not null, `country` varchar(255) not null, `phone` varchar(255) not null, `email` varchar(255) not null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')
at C:\xampp\htdocs\crud_habibi\vendor\laravel\framework\src\Illuminate\Database\Connection.php:742
738▕ // If an exception occurs when attempting to run a query, we'll format the error
739▕ // message to include the bindings with SQL, which will make this exception a
740▕ // lot more helpful to the developer instead of just the database's errors.
741▕ catch (Exception $e) {
➜ 742▕ throw new QueryException(
743▕ $query, $this->prepareBindings($bindings), $e
744▕ );
745▕ }
746▕ }
1 C:\xampp\htdocs\crud_habibi\vendor\laravel\framework\src\Illuminate\Database\Connection.php:527
PDOException::("SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'providers' already exists")
2 C:\xampp\htdocs\crud_habibi\vendor\laravel\framework\src\Illuminate\Database\Connection.php:527
PDOStatement::execute()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它可能有效
it may works