Laravel 5.1 migration new table not working

主宰稳场 提交于 2019-12-13 05:21:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!