mrterryh/Permissions

Migrate Error: Cannot add a NOT NULL column

Closed this issue · 2 comments

I am receiving the error when migrating with: $ php artisan migrate --package="mrterryh/permissions" when I am using my local machine set with sqlite.

[Illuminate\Database\QueryException]                                                                                                                     
  SQLSTATE[HY000]: General error: 1 Cannot add a NOT NULL column with default value NULL (SQL: alter table "users" add column "role_id" integer not null) 

Sorry about that. When adding a new column to an existing table, a default value is provided for all existing rows.

SQLite typically uses NULL as the default value, but in this case, the column isn't nullable.

Issue should be fixed in commit 07352a8 – can you confirm?

Thanks!

Thanks, I can confirm this fixes the issue. I thought that was what would solve the issue.

Glad I can help you make this even better.