Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #24
This adds the option to migrate, seed, publish assets, re-migrate, re-seed, re-publish assets, un-migrate, un-seed and un-publish assets on installation/updating and uninstallation of a hook.
Events
Install
The installation of a hook will run the specific migrations from the hook, along with the hooks seeders and publish-ing the assets.
The migrations can be skipped using the
--no-migrate
option command-line.The seeding can be skipped using the
--no-seed
option command-line.The publishing of assets can be skipped using the
--no-publish
option command-line.Update
The updating of a hook will re-run the un-migrated migrations from the specific hooks along with running all the hooks seeders and publish-ing any non-manually-updated assets.
The migrations can be skipped using the
--no-migrate
option command-line.The seeding can be skipped using the
--no-seed
option command-line.The publishing of assets can be skipped using the
--no-publish
option command-line.Uninstall
The uninstallation of a hook will rollback the migrated migrations from the specific hooks along with running all the hooks un-seeders and un-publishing all the hooks assets.
The migrations can be skipped using the
--no-unmigrate
option command-line.The seeding can be skipped using the
--no-unseed
option command-line.The publishing of assets can be skipped using the
--no-unpublish
option command-line.Changed assets
Any assets that have been changed from the original assets from the hook, will not be overwritten on updating of the hook. Not even if the hook has an update to that file itself.
However, you can tell the system to overwrite the assets anyway using the
--force
option command-line.Composer File
The composer file is the key to all this. The hook will have to specify the migrations, seeders, un-seeders and assets paths inside the
composer.json
file.You can see an example hook using the migrations, seeders, un-seeders, and assets here.