By daveslc on
I want to import content directly into the database.
I think that I can do this with SQL statements (or easier yet, in phpmyadmin and uploading csv files).
But, I cannot find how to do this in Drupal 6.
So:
Is there documentation anywhere as to:
1. What tables are used for nodes?
2. What tables are used for CCK content?
3. How does 1 relate to 2?
Is there documentation on the structure of Drupal's database?
Comments
Anyone? Any documentation on Drupal's Database?
Anyone? Any documentation on Drupal's Database?
Brief tables info...
Firstly, unless you have thousands of elements, you'd be far better off using the normal Drupal interface. I'm trying to manually convert an SMF forum into a Drupal6+modules install, and it's way more complex than it first seems.
1. Nodes have revisions, but remember even a brand new node has one revision.
`node` and `node_revisions` are the main tables for adding a new node. `nid` is the key which links the two.
2. `content_node_field` and `content_node_field_instance` are used for defining CCK fields, but I don't understand how they work yet. There are many fields in these two tables containing serialised data (such as a:10:{s:13:"default_value";s:3:"now";s:18:"default...).
3. `content_type_event` holds the values of CCK fields for my `event` content types. The rows hold `vid` (primary key, possible related to revision), `nid` (the node ID, this is the useful one) and the actual value field.
You can try feeding in data manually, but it's best to create your structure and CCK fields using the normal methods.
Still doesn't answer the question
I'm extending a module and couldn't find any documentation. I'm reverse engineering the cck to get the info I need.
Thanks for the answer above though.
how did u do with finding out about how cck stores data
I investigated and i think i can identify the tables drupal uses for storing data for a node type via cck. I created just a few sample records, uhmm, i mean nodes, to see how / where the data is stored, and using this method identified the 'default' data that is used for certain fields.
How about yourself, what did u find out. How did you proceed..
Rob
Drupal tables reference
Here's: http://drupal.org/node/22754