TyForHelpDude
TyForHelpDude

Reputation: 5001

laravel update table with artisan migration

I simply create a migration and run migrate with commands here is the commands I type and the result I get;

Serkan:itsp mehmet$ php artisan make:migration alter_table_rates --path="database/migrations/v141/" --table="rates"
Created Migration: 2016_05_27_120219_alter_table_rates
Serkan:itsp mehmet$ php artisan migrate
Nothing to migrate.

Here is the new migration file content I simply add new column('purchase'):

 public function up()
    {
        Schema::table('rates', function (Blueprint $table) {
            $table->integer('purchase')->nullable();
        });
    }
    public function down()
    {
        Schema::table('rates', function (Blueprint $table) {
            $table->dropColumn(['purchase']);
        });
    }

What do you think that can cause this ?

Upvotes: 0

Views: 1186

Answers (1)

thefallen
thefallen

Reputation: 9749

It's because you're creating it in another directory. You should run it like this:

php artisan migrate --path=database/migrations/v141

Upvotes: 1

Related Questions