a13xh7 / QaraTMS

QaraTMS is open source test case, test suites, test plans and test runs management tool.
MIT License
77 stars 21 forks source link

Database Migration fails for Create Permission when we run with the latest code. #53

Closed bhattisatish closed 1 month ago

bhattisatish commented 2 months ago

If we checkout the latest code and try to create a new setup, it fails with the following error: image "Access to undeclared static property $Spatie\Permission\PermissionRegistrar::$pivotPermission"

This is because of the following line in the database/migrations/2022_06_09_185929_create_permission_tables.php file.

The issue is due to the updated PermissionProvider library but the migration is using the old api's. One suggested solution is to regenerate the migration: See https://github.com/spatie/laravel-permission/discussions/2576#discussioncomment-8417545 I haven't tried it.

For now the easiest workaround I found was the following:

  1. Checkout dc9c8fef599c22e5abd5c5402510f953a17dae7a
  2. Run composer install
  3. Run php artisan key:generate
  4. Update the .env file
  5. Run php artisan migrate
  6. Run php artisan db:seed --class=AdminSeeder
  7. Pull the latest
  8. Rerun composer install
a13xh7 commented 1 month ago

fixed