How can I do a migration in laravel 5.5?

后端 未结 4 2212
野趣味
野趣味 2020-12-02 03:20

I\'ve created an Auth project with laravel 5.5 and created new migration and when I migrate I receive this error msg:

In Connection.php line 647:

4条回答
  •  再見小時候
    2020-12-02 03:50

    after reading error msg in CMD (DOS) and check laravel documentation

    error in length i dont know if any one see this error before or not but when i edit length its work

    i edit 3 migration as below :-

    1 -1- Schema::create('users', function (Blueprint $table) { $table->increments('id'); $table->string('name'); $table->string('username')->unique(); $table->string('email')->unique(); $table->string('password'); $table->rememberToken(); $table->timestamps(); $table->integer('role'); });
    

    and now its

            Schema::create('users', function (Blueprint $table) {
            $table->increments('id')->autoIncrement();
            $table->string('name',200);
            $table->string('username',50)->unique();
            $table->string('email',100)->unique();
            $table->string('password',50);
            $table->string('role',50);
            $table->rememberToken();
            $table->timestamps();
    
        });
    

    number 2 it was

     Schema::create('password_resets', function (Blueprint $table) { $table->string('email')->index(); $table->string('token'); $table->timestamp('created_at')->nullable(); });
    

    and now its :-

            Schema::create('passwordreset', function (Blueprint $table) {
            $table->string('email',200)->index();
            $table->string('token',200);
            $table->timestamp('created_at')->nullable();
        });
    

    number 3 it was :-

    3- Schema::create('tweets', function (Blueprint $table) { $table->increments('id'); $table->integer('user_id')->unsigned()->index(); $table->text('text'); $table->timestamps(); });
    

    now its :-

            Schema::create('tweets', function (Blueprint $table) {
            $table->increments('id')->autoIncrement();
            $table->string('user_id',50)->index();
            $table->string('twetts',255);
            $table->timestamps();
        });
    

提交回复
热议问题