问题
I have got some problem with migration. I create new migrate file
php artisan make:migration create_menu_table --create=menu
then i edit the new Migration file and when i try migrate it's not working
I tried:
php artisan migrate
php artisan migrate --force
php artisan migrate:refresh
php artisan migrate:refresh --seed
php artisan migrate:rollback
php artisan migrate:reset
but they do not add created table
I do not have any errors
Thanks for help
回答1:
Run composer dumpautoload
and then try php artisan migrate:refresh
again.
Hope this helps!
回答2:
add schema ::defaultStringLength(191) to migrate file(put in every file migrate)
like this
public function up()
{
schema::defaultStringLength(191);
Schema::create('products', function (Blueprint $table) {
$table->increments('id');
$table->string ('Name');
$table->float('price');
$table->timestamps();
});
}
来源:https://stackoverflow.com/questions/34283262/laravel-5-1-migration-new-table-not-working