-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
#6628: Added a command to remove a deploy hook from the list of deployed hooks in the site State #6280
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
Open
harivansh0
wants to merge
8
commits into
drush-ops:13.x
Choose a base branch
from
harivansh0:deploy-6228
base: 13.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
#6628: Added a command to remove a deploy hook from the list of deployed hooks in the site State #6280
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1b1e9cf
6628: Added the hook-list command to show all deployed hooks.
925fece
6628: Updated the function comments.
578fcdb
6628: Added the hook unst command to unset the deployed hook.
2b9a91a
Fixed the undefined variable name
7ce7c9f
Added the command to re-deploy the hook.
e6a7cd5
Added the hook commend to set module version and the functional test.
c7ff023
Merge branch '13.x' of github.com:drush-ops/drush into deploy-6228
5935a1f
Fixed static analyis error.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Module Schema Commands | ||
|
||
## Overview | ||
|
||
The module schema commands allow you to manage the schema version of Drupal modules. | ||
|
||
In Drupal, each module maintains a schema version number that is used to track which database updates have been applied. When a module is updated, it may include update hooks (`hook_update_N()`) that need to be run to update the database schema or data. Drupal's update system uses the stored schema version to determine which updates need to be applied. | ||
|
||
## Available Commands | ||
|
||
### module:schema-set (mss) | ||
|
||
Set the schema version for a module. | ||
|
||
```bash | ||
drush module:schema-set <module> <version> | ||
``` | ||
|
||
#### Arguments | ||
|
||
- `module`: The machine name of the module. | ||
- `version`: The schema version to set. | ||
|
||
#### Examples | ||
|
||
```bash | ||
# Set the schema version for system module to 8000 | ||
drush module:schema-set system 8000 | ||
|
||
# Set the schema version for a custom module to 8001 | ||
drush mss custom_module 8001 | ||
``` | ||
|
||
#### Use Cases | ||
|
||
This command is useful in several scenarios: | ||
|
||
1. **Development**: When developing update hooks, you may need to reset the schema version to test your updates. | ||
2. **Troubleshooting**: If an update fails and you need to re-run it, you can set the schema version to a previous value. | ||
3. **Migration**: When migrating a site, you might need to adjust schema versions to match the expected state. | ||
4. **Testing**: For testing update paths or simulating specific module states. | ||
|
||
#### Notes | ||
|
||
- The module must be installed and enabled for this command to work. | ||
- Use with caution in production environments, as setting incorrect schema versions can lead to update hooks being skipped or run multiple times. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have this service available as
$this->keyValue
.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @MurzNN
The DeployHookCommands class does not have a keyValue property. Although the getRegistry() function injects the service, the class extends UpdateRegistry, which defines keyValue as a protected property. Since it's protected and not accessible directly in the subclass, we cannot use it, without modifying the drupal core UpdateRegistry or use refelection.
Or I could using autowire to inject
#[Autowire(service: 'keyvalue')] protected KeyValueFactoryInterface $keyValueFactory,