Importing data with migration for habtm

I have 2 tables: products and categories. They are both linked by a
habtm association. I have a fixture to import all the data in each table
but I dont know how to import the data in the categories_products table
since that table has no model, so I cant use that code:

f =, # a database connection
                 "categories", # table name
                 Category, # model class


How can I do this?

Humm… I am surely not the first person to do this! I have googled
around and couldnt find anything…