User login


Naming convention for follows / is followed by relationship?

Yes, i searched for what other people chose for a naming convention for a table (model) of follower and followee relationships.

The only directly relevant discussion was in this Ruby on Rails tutorial, which settled on "Relationship". What we've been using, Followership, is better than that, i think.

Using PostgreSQL (psql) - getting past the immediate authentication failure

How in the world aren't there very clear instructions for getting started with PostgreSQL after apt-get install postgresql?

UPDATE: Doing this the right way

Read the documentation that Debian (and so Ubuntu) provide, typically in /usr/share/doc/<package-name>

The documentation we need can be read with:
vi /usr/share/doc/postgresql-8.4/README.Debian.gz

2. Get a shell for the database superuser 'postgres'. If your system
has an active root user, use su:

Updating your Rakefile and syncing content

As when working on any Agaric project that may not have had maintenance done on it in a while, update the Rakefile to be in line with current processes.

First, make sure your Vlad checkout is up-to-date. Go to it cd ~/vlad (in my case, i symlinked Vlad's true location to my home folder so he can find it. On my system Vlad's true location is /usr/local/lib/site_ruby/1.8/i686-linux/vlad/) and git pull.

cd ~/code/projectname
mv Rakefile RakefileOLD
cp /home/ben/vlad/Rakefile Rakefile
diff -up

Use Drush to sync the database from one site to another

Based on Greg Anderson's chapter in the Definitive Guide to Drupal 7.

drush sql-sync @dgd7.local


A dgd7.aliases.drushrc.php file in a ~/.drush directory (that's a .drush folder in your home directory) that contains something like:

Too many connections in lock_may_be_available() on Drupal 7 site

Encountered this error:

The website encountered an unexpected error. Please try again later.
Error messagePDOException: SQLSTATE[08004] [1040] Too many connections in lock_may_be_available() (line 165 of /var/local/drupal/dgd7/drupal/includes/

The website encountered an unexpected error. Please try again later PDOException Too many connections in lock_may_be_available()

Stumbling through DBTNG, Drupal 7's new database layer

Order matters. condition() before countQuery()

This fails (note it trying to do a subquery):

return db_select('block')->countQuery()->condition('theme', $theme)->execute()->fetchField();

Browsing the Drupal database

Moshe on browsing the database at the Boston

He uses the Mac program SequelPro (completely free and open source).


Find $db_url in settings.php

username, password, host, and database name.

Can put this data into Sequel Pro.

Bottom line: as long as you have a backup, do not be afraid to fiddle with your database!

Export and re-import a database with Drush and the command line

These are run from the project's web root, example/web, so that drush can run, but the database itself is stored outside the web root, example/db.

On the export side:

drush sql-dump > ../db/development.sql

On the import side:

drush sql-connect < ../db/development.sql

expands to:

mysql -hlocalhost -uexample -pyMsx2rIP drupal-example < ../db/development.sql

Syndicate content