How do images ('files' table) relate to nodes on a database level?
I'd expect entries in the 'files' table to have an 'nid' foreign key that links back to the nodes primary key, or there should be a linking/lookup table (something like 'files_nodes') that caters for a many-many relationship. I've inspected the database, had a look a at the schema module, trawled the forums, asked google and earned more than my weekly share of gray hair while wrestling with something that shouldn't be an issue at all.
The reason I need this is that I'm migrating a clients site over to wordpress and I wrote a script that sorts everything out, from taxonomy to semi-custom imce tables. All thats left is matching the images up to the nodes/posts.
Also, how does Drupal know how to arrange the images (ie. Above, below in in the middle) in the node?
I'm relatively new to Drupal, but am fairly experienced with Wordpress and other CMSs like Wordpress & Joomla.
Thanks in advance for anyone who has the time and patience to help out