tricks

MySQL useful queries

Check the size of a database:

SELECT table_schema "Database",
sum( data_length + index_length ) / 1024 / 1024 "Size in MB",
FROM information_schema.TABLES
WHERE table_schema = 'DATABASE NAME;'
GROUP BY table_schema;

Truncate multiple tables:

SELECT concat('TRUNCATE TABLE ', TABLE_NAME, ';')
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME LIKE 'cache%';

Then, you copy & paste the result into the mysql client.

Quick notes about Drush Make

I started to work with Drush make files quite recently and it's a shame for my that I didn't had the chance to work with it before. Make is a really powerfull tool that allows quick deployment of full drupal sites highly customized. This post isn't about how to use drush make, is just a set of quick notes of things I found while using it.

Downloading a library into any place