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

[1.x] Make migrations publishable #81

Merged
merged 3 commits into from
Dec 5, 2023
Merged

[1.x] Make migrations publishable #81

merged 3 commits into from
Dec 5, 2023

Conversation

toitzi
Copy link
Contributor

@toitzi toitzi commented Dec 1, 2023

Similiar to other first pary packages i thought it would be great to allow publishing migrations. Same as in this pr #80: a more practical use case might be if you use something like tenancy for laravel where you might want to have those migrations for your tenant databases as well

@SRWieZ
Copy link
Contributor

SRWieZ commented Dec 1, 2023

This will also be useful for skipping the migration in test

Example, by wrapping the up() function with

if (app()->runningUnitTests()) 

@timacdonald
Copy link
Member

@SRWieZ If you want to disable Pulse during tests, you should set the env - otherwise it'll be doing work during the test still - but just swallowing exceptions.

<server name="PULSE_ENABLED" value="false"/>

@timacdonald timacdonald changed the title Make migrations publishable [1.x] Make migrations publishable Dec 3, 2023
@timacdonald
Copy link
Member

Publishing migrations is also nice as it gives the apps control over the indexes, which may be optimized further for specific applications.

@taylorotwell
Copy link
Member

@timacdonald @jessarcher we are moving most of our first party packages to only publishing migrations (never running them behind the scenes). We are making this change for Sanctum and maybe others in Laravel 11.

It may be good to go ahead and just take this approach here?

@taylorotwell taylorotwell marked this pull request as draft December 4, 2023 19:19
@timacdonald timacdonald marked this pull request as ready for review December 5, 2023 05:16
@timacdonald
Copy link
Member

@taylorotwell dig it. Updated this one and updated the docs over here: laravel/docs#9176

@taylorotwell taylorotwell marked this pull request as draft December 5, 2023 14:46
@taylorotwell
Copy link
Member

Conflicts. 😅

@jbrooksuk
Copy link
Member

@taylorotwell I've resolved the conflicts.

toitzi and others added 3 commits December 6, 2023 09:33
@timacdonald timacdonald marked this pull request as ready for review December 5, 2023 22:44
@taylorotwell taylorotwell merged commit e65fbbe into laravel:1.x Dec 5, 2023
9 checks passed
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.

5 participants