Tying to create a new table in laravel schema and command php artisan make:migration create_asks_table --create tasks
and having the schema like
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTasksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tasks', function (Blueprint $table) {
$table->increments('id');
$table->string('body');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('tasks');
}
} ?>
and i am trying to create table using php artisan migrate
command but it is not considering new table tasks
to create it tries to create first table user
that is already existing table that has been created in default and the error is
>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, name varchar(255) not null, email varchar(255) not null, password varchar(255) not null, remember_token varchar(100) null, created_at timestamp null, updated_at` timestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci)
[PDOException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists
how can shoud i skip already existing table too create
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire