Rake db_schema_import on vanilla schema.rb


#1

Hi all,

I dumped my schema from SQLServer 2000 without any problems. I then
tried to “rake db_schema_import” on MySQL 4. To do this i changed my
database.yml settings to use the mysql adapter (as it was set to use
sqlsever before) and attempted the import.

I haven’t changed a thing in the schema.rb script and, even though I do
have generated a migration, I think I don’t even need it and rake simply
ignores it (or I guess it does).

The rake script exits like this:

C:\Lorenzo\therapy>rake db_schema_import
(in C:/Lorenzo/therapy)
rake aborted!
undefined method `[]=’ for #

(See full trace by running task with --trace)

Anybody knows what the story is?

Thanks in advance,
Lorenzo


#2

Lorenzo B. wrote:

C:\Lorenzo\therapy>rake db_schema_import
(in C:/Lorenzo/therapy)
rake aborted!
undefined method `[]=’ for #

Reply to self:

to make rake work on sqlserver I added the line suggested here to
environment.rb to fix OLE errors:
http://wiki.rubyonrails.com/rails/pages/HowtoConnectToMicrosoftSQLServer/

That same line got in MySQL way when I switched the adapter from
sqlserver to mysql

Commenting that line fixed everything and rake db_schema_import worked
as expected.

Lorenzo