Skip to main content

Drupal node table information

I don't advocate updating databases without going through the application. However, I had issues with some data when I migrated it from one database to another and had to fix the data.

This is REALLY not recommended, and your results will vary depending on which version you are using.

This SQL generated the update statement I needed to run to fix the problem.

SELECT
   ' UPDATE node SET ' ||
   'created = ' || created::text ||
   ', changed = ' || changed::text ||
   ', status = ' || status::text ||
   ', promote = ' || promote::text ||
   ' where nid = ' || nid::text || ';'
FROM
   node
ORDER BY
   nid
   ;

The following fields are explained here:

  • created - The date/time the node was created in integer format
  • changed - The date/time the node was last updated in integer format
  • status - Whether the node is published (1) or not (0)
  • promote - Wether the node is promoted to the front page (1) or not (0)
  • type - Type of content