Undefined method "add_reference"


#1

Greetings,

I try to add a foreign key in one of my rails migrations in the
following way:

def self.up
add_reference :categories, :items
end

This, strangely, leads to the following error during the migration:

– add_reference(:categories, :items)
rake aborted!
undefined method `add_reference’ for #

In the same way fails the code:

def self.up
change_table :categories do |t|
t.references :items
end
end

I recently upgraded to Rails 2.1.2, if this is relevant to my case. Does
anyone have any pointers on how to solve this problem?

Thanks in advance!