Tuesday, December 05, 2006

A New Website, Part Twelve - Node Fields

Well... I've been working on posts and have noticed that the whole Drupal database has changed form as I've added content types. Here's what the node tables look like now:

node
node_access
node_comment_statistics
node_content_article
node_content_author
node_content_event
node_content_journal
node_content_post
node_content_quote
node_counter
node_data_field_author
node_data_field_crdate
node_data_field_description
node_data_field_email
node_data_field_event
node_data_field_id
node_data_field_link
node_field
node_field_instance
node_revisions
node_type_content

So what's happening? Node data always gets entered into node and node_revisions, as before. But for content types, one of two things happens.

If a content field, such as 'description', is used in two or more content types, then a special data table, node_data_field_description, is created for that field, and the data stored there.

Otherwise, the data is stored in a field reserved for the data type itself, such as node_content_post.

No great disaster, I'm just glad I found this out now. It means some changes to the script, nothing major.

I also discovered that my post database is 17 megabytes large. To load it, I saved it as an SQL file, uploaded by FTP, then ran the command:

mysql -u username -p databasename < post.sql

Worked like a charm.

1 comment:

  1. Hello, Stephen,

    If you want to reduce the database size for dumps/backups/etc, you can truncate the cache table and the watchdog table -- this eliminates cached info (such as some blocks, some static pages for anonymous viewers, etc) and some system events (many of which are stored in the watchdog table) but, if you're looking to save space on the db size, that will do it safely.

    ReplyDelete

I welcome your comments - I'm really sorry about the moderation, but Google's filters are basically ineffective.