Making Composite Migrations work on Rails 1.2
Posted by admin, Tue Apr 17 03:49:51 UTC 2007
I was attempting to use the Composite Migrations plugin when I discovered that it didn’t work with Rails 1.2.
<br />
$ rake db:migrate
(in /Users/lori/Projects/workspace/eTriever)
== AddCurrentSearches: migrating ==============================================
-- create_table(:current_searches, {:primary_key=>[:user_id, :type]})
rake aborted!
undefined method `type_to_sql' for #<activerecord ::ConnectionAdapters::ColumnDefinition:0x7fe3740>
</activerecord>
It only took a couple of minutes of spelunking to discover the fix. Inside ‘composite_migrations’, you need to change the call
type_to_sqlto
base.type_to_sqlDone. Works now.
lori@kwigger ~/etriever
$ rake db:migrate
(in /Users/lori/Projects/workspace/eTriever)
== AddCurrentSearches: migrating ==============================================
-- create_table(:current_searches, {:primary_key=>[:user_id, :type]})
-> 0.0271s