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

[7.x] Delete Me #32304

Closed
wants to merge 76 commits into from
Closed

[7.x] Delete Me #32304

wants to merge 76 commits into from

Conversation

lancepioch
Copy link
Contributor

@lancepioch lancepioch commented Apr 9, 2020

Force pushed and bricked this PR apparently

GrahamCampbell and others added 28 commits March 23, 2020 14:30
# Conflicts:
#	src/Illuminate/Foundation/Application.php
* fixed component class view reference

* Update ComponentMakeCommand.php

Co-authored-by: Taylor Otwell <taylor@laravel.com>
* Removed deprecated code

* Update WorkCommand.php

Co-authored-by: Taylor Otwell <taylor@laravel.com>
The boolean will be cast to an int resulting in exit code 1, but if the application is already down/up exit code 0 would be desirable.
This PR adds support for a new php artisan schema:dump command which uses mysqldump or pgdump to dump the current state of your schema to a database/schema/{connection}-schema.mysql file.

When this file exists and php artisan migrate or php artisan migrate:fresh is run AND no migrations have run against the database yet (migrations table is empty), this schema file will be loaded into the database first and then any outstanding migrations will be run. This means that effectively this schema file would typically only ever be used during local development or during CI testing. In production, you would typically already have migrations that have run in the past so this schema file would never be triggered.

Once the schema file is created, any or all of your existing migrations my be deleted as long as they have already run against your production environment. They are no longer needed during local development since the schema file exists. For convenience, a --prune flag has been added to the schema:dump command to delete your existing migrations after dumping the schema.

This new feature solves two problems. First, it relieves developers from having a huge migrations directory full of files they no longer need. Second, loading a single schema file is quicker than running hundreds of migrations for each test class in your applications, so your tests can run much faster when using a schema.
@lancepioch lancepioch closed this Apr 9, 2020
@lancepioch lancepioch changed the title [7.x] Replace while with for to optimize performance [7.x] Delete Me Apr 9, 2020
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.

7 participants