Permission migration adds an empty entry. #2717
Unanswered
4andrisbriedis
asked this question in
Q&A
Replies: 1 comment
-
Without seeing application code, one must guess at possible causes. I suspect something peculiar in your migration logic, but it could also be in your extended Permission (or other) models. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello.
There is laravel 5.5 and laravel-permission 1.0.3 (as far as I understand). For 7 years, many permissions have been imported. I took the now empty database and ran the whole import from the beginning. Everything seemed to work until the end, but all the rights in the "permissions" table were added as empty entries. DB::listen also showed that insert sql is only with created_at and updated_at fields. The others are not included.
Maybe someone knows why this can happen.
The funniest thing is that I also took it in another place and did the same thing. And also empty records. I tried everything. Also the following commands:
php artisan config:cache
php artisan cache: clear
php artisan config: clear
php artisan route: clear
php artisan view: clear
But immediately after their execution, nothing changes. Minutes 5 passed, and suddenly, without changing anything, the entire record began to save correctly. In migrations.
Maybe someone has an idea why.
Obviously something with cash, but what?
p.s.
Then when it started to save, the first time the migration was run, it gave an error that the corresponding permission already exists. There wasn't even a table yet. On the second run, everything worked correctly.
Roles works fine. 2 default roles. Both saved.
Beta Was this translation helpful? Give feedback.
All reactions