Last active
April 1, 2019 19:19
-
-
Save DanLaufer/d258a0dc2f1935715c87f1c356e93504 to your computer and use it in GitHub Desktop.
Drupal 8 - Useful Drush Commands
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
// List things with Drush | |
Node Types - drush ev "print_r(array_keys(node_type_get_types()));" | |
User Roles - drush ev "print_r(array_keys(\Drupal::entityTypeManager()->getStorage('user_role')->loadMultiple()));" | |
Fields (on a content type) - drush ev "print_r(array_keys(\Drupal::entityManager()->getFieldDefinitions('node', 'insight')));" | |
Vocabularies - drush ev "print_r(array_keys(taxonomy_vocabulary_get_names()));" | |
Image Styles - drush ev "print_r(array_keys(\Drupal::entityTypeManager()->getStorage('image_style')->loadMultiple()));" | |
// Running db updates for one module | |
drush ev "module_load_install('webform');webform_update_7423();" | |
//Handling Permissions in Drush | |
drush role:list | |
drush role:list --module=draggableviews | |
drush role-add-perm ventures_approver 'use published_to_needs_review transition' | |
drush role-add-perm --module=node | |
drush role-remove-perm ventures_editor 'use published_published transition' | |
drush role-add-perm 'connector_partner_editor' --module=draggableviews | |
// Login as user | |
drush uli myUserName | |
// Create users with drush | |
drush ucrt username --password=myUserPW | |
// preview config import diff | |
drush cim --preview=diff | |
// import partial configs | |
drush cim --partial --source=sites/default/partial | |
// run drush commands on a remote environment | |
drush @pantheon.mysite.myenvironment cr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment