PHP Developers Network
http://forums.devnetwork.net/

How to make migration flexable in laravel ??
http://forums.devnetwork.net/viewtopic.php?f=72&t=143244
Page 1 of 1

Author:  gautamz07 [ Sun Jan 01, 2017 10:18 am ]
Post subject:  How to make migration flexable in laravel ??

Hey guys i have the following migration file in my laravel app as of now:

Syntax: [ Download ] [ Hide ]
class QualityCheckTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */

    public function up()
    {
        Schema::create('quality_check', function (Blueprint $table) {
            $table->increments('id');
            $table->text('site-name');
            $table->boolean('favicon');
            $table->boolean('title');
            $table->boolean('image-optimization');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */

    public function down()
    {
        Schema::drop('quality_check');
    }
}
 


Every now and then i have to add a new property to the migration ... how do i make this migration flexable ?? I.E. Say i want to add the following property to the above migration:

Syntax: [ Download ] [ Hide ]
$table->boolean('favicon');


How do i do it ?? without loosing my earlier data and my earlier migration ??

Thank you.
Gautam.

Author:  Celauran [ Sun Jan 01, 2017 10:30 am ]
Post subject:  Re: How to make migration flexable in laravel ??

Create a new migration to add the new field only.

Author:  Celauran [ Sun Jan 01, 2017 11:28 am ]
Post subject:  Re: How to make migration flexable in laravel ??

https://laravel.com/docs/5.3/migrations

Author:  gautamz07 [ Wed Jan 04, 2017 2:25 am ]
Post subject:  Re: How to make migration flexable in laravel ??

ok thanks ! :)

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/