Skip to content

Instantly share code, notes, and snippets.

@bradfordcondon
Last active December 19, 2017 18:02
Show Gist options
  • Save bradfordcondon/f398426f761f8a1a27bf4f3062e2fa1c to your computer and use it in GitHub Desktop.
Save bradfordcondon/f398426f761f8a1a27bf4f3062e2fa1c to your computer and use it in GitHub Desktop.
drush cheatsheet
#run database updates
drush updatedb
## Force a specific update to run
drush eval "module_load_install('tripal_elasticsearch'); tripal_elasticsearch_update_7201();"
drush dre [modulename] #disable, uninstall, re-install, enable module
# Connect from bash
sudo su - postgres
pgsql
#Now that you're connected list and connect
\l
\c [db name]
#Copy the results of a query and export like so
COPY ( select uniquename from chado.feature WHERE type_id = 422) TO '/var/www/html/sites/default/files/host/Fexcelsior_list.csv' WITH (FORMAT csv, HEADER true);
pg_dump -U [db username] -d [database] > [backup output]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment