hi i have problem with migration when i use php artisan migrate show below error :
windows command line; C:\Users\Google\projects\minisocialnetwork>php artisan migrate
[Illuminate\Database\QueryException]
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists (SQL: create table users
( id
int unsigned not null auto_increment primary key, username
varchar(32) not null, dob
date not null, name
varchar(255) not null, email
varchar(255) not null, password
varchar(255) not null, remember_token
varchar(10
0) null, created_at
timestamp null, updated_at
timestamp null) default character set utf8mb4 collate utf8mb4_un
icode_ci)
[PDOException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists
// I can not see the other tables except the user table in the database
laravel 5.4
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreatePostsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('posts', function (Blueprint $table) { $table->increments('id'); $table->integer('user_id'); $table->text('content'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('posts'); } }You need to generate autoload files.
In terminal navigate to your project and run: composer dump-autoload
and than try to migrate
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community