Can't use models in migrations

Hi there,

This always used to work for me... but not now. I want to blame Rails 1.2 but I'm sure its not.

I can't use AR models in my migrations. To make sure its not just my dodgy code I tried to do the same with a well known plugin.. acts_as_versioned.

A migration such as the one below (taken from acts_as_versioned) is giving the error undefined method `create_versioned_table' for #<ActiveRecord::ConnectionAdapters::MysqlAdapter:0xb74a1d44>

What the hell is that about? create_versioned_table is a definition of Post.. not bloody SqlAdapter whatever.

Ideas?

Thanks -henry

        # class AddVersions < ActiveRecord::Migration         # def self.up         # # create_versioned_table takes the same options hash         # # that create_table does         # Post.create_versioned_table         # end

Hmmm, as expected I was at fault..

I was giving my migrations the same class names as their respective models... madness.

ta -h