spatie/laravel-permission

Problem with migrate

Closed this issue · 1 comments

Hi Author.
I get error when do migrate.

These tables was created:

Please help check!

I found your problem.
The primary cannot be nullable.
So please remove ->nullable(); in permission_role and role_user:

So, well done.
But when you rollback migration, we met an error :D (not yet perfect ha).

Well, let fix it.
At the end of migrate file, you call #dropTable# function, but this function doest not exists in laravel 5.1 any more. Change to #drop# like this:
(You also forget to delete role_user table too.)
Schema::drop('role_user');
Schema::drop('permission_role');
Schema::drop('roles');
Schema::drop('permissions');


Retest migrate:reset. Wao. it's work like a boss.