3

in the database table as below;

 public function up()
    {
        Schema::create('current_adresses', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('id');
            $table->string('current_name',50)->nullable();
            $table->string('current_surname',50)->nullable();
            $table->string('telephone',25)->nullable();
          $table->timestamps();
        });
    }

I want to do as below;

public function up()
    {
        Schema::create('current_adresses', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('id');
            $table->string('current_name',50)->nullable();
            $table->string('current_surname',50)->nullable();
            $table->string('gsm',25)->nullable();
            $table->string('telephone',25)->nullable();
          $table->timestamps();
        });
    }

how can I update the new column(gsm column) without refreshing(php artisan migrate:refresh)

ufuk
  • 367
  • 3
  • 16

1 Answers1

4

Add new migration-

public function up()
{
    Schema::table('current_adresses', function($table) {
        $table->string('gsm',25)->nullable();
    });
}

public function down()
{
    Schema::table('current_adresses', function($table) {
        $table->dropColumn('gsm');
   });
}

See this link for better understanding.

Sohel0415
  • 9,523
  • 21
  • 30