Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#372 - spatie permissions update #406

Merged
merged 1 commit into from
Mar 19, 2024
Merged

Conversation

kamilpiech97
Copy link
Member

Should close #372.
Updated migrations for properly running tests - in migrations updates are connected with getting variables when tables are creating.
Example, before:

[$columnNames["team_foreign_key"], PermissionRegistrar::$pivotPermission, $columnNames["model_morph_key"], "model_type"],

after:

[$columnNames["team_foreign_key"], $pivotPermission, $columnNames["model_morph_key"], "model_type"],

and $pivotPermission is retrieved on the top of migration file, like that:
$pivotPermission = $columnNames["permission_pivot_key"] ?? "permission_id";

Also, we can stay with normal ids in permissions, we do not need to change them into uuid.

@kamilpiech97 kamilpiech97 requested a review from a team as a code owner March 19, 2024 07:02
Copy link
Member

@krzysztofrewak krzysztofrewak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okaaay, but what about production environment? We won't run these migrations there.

@EwelinaSkrzypacz
Copy link
Member

Okaaay, but what about production environment? We won't run these migrations there.

On beta environment it seems like it works without running migrations 👀

@kamilpiech97
Copy link
Member Author

Okaaay, but what about production environment? We won't run these migrations there.

On beta environment it seems like it works without running migrations 👀

We do not need to run updated migrations because they do not change the database, only the logic of creating tables, and we update them only for tests.

@kamilpiech97
Copy link
Member Author

We do not need to run updated migrations because they do not change the database, only the logic of creating tables, and we update them only for tests.

We do not need to run updated migrations because they do not change the database, only the logic of creating tables, and we update them only for tests.

@kamilpiech97 kamilpiech97 merged commit 5f4694a into main Mar 19, 2024
3 checks passed
@kamilpiech97 kamilpiech97 deleted the #372-spatie-permissions-update branch March 19, 2024 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update permissions package
3 participants