Ben Lieber
2009-Jan-23 05:37 UTC
There is already an object named ''schema_migrations'' in the
Hi I have an unusual one, hoping one of you geniuses can give me a hint as I don''t know where else to look. I''m running an combo of Rails/Sql Server (I know, I know, legacy though) using Ubuntu/UnixODBC/FreeTDS/activerecord-odbc-adapter. The app seems to be talking to the DB perfectly. When I have a clean database, I''m able to run rake db:migrate and everything generates correctly. However, if I add another migration and run the migrations again, I get this error: rake aborted! S0001 (2714) [unixODBC][FreeTDS][SQL Server]There is already an object named ''schema_migrations'' in the database. Which, of course there is! I''m just attempting to add a new table, column, etc. The only way I''ve been able to add migrations thus far is to wipe the database and rerun the migrations from scratch. Obviously can''t keep that up forever. with a --trace argument, I do notice that it thinks I''m running them for the first time. Where does the rake task look to decide this? ** Invoke db:migrate (first_time) ** Invoke environment (first_time) Thanks so much for any help you can provide! -Ben -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Piyush with Rails
2009-Jan-23 06:27 UTC
Re: There is already an object named ''schema_migrations'' in the
Hi Ben, I think there should be a table generated with name as schema_info in your database. this table will have version as the column that contain the number of the latest migration file you executed. next time when you run migrations it will run all migration files having number above the version number mentioned in schema_info table. try to trace the schema_info table as above behavior. Thanks, Piyush. try to trace it and On Jan 23, 10:37 am, Ben Lieber <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi I have an unusual one, hoping one of you geniuses can give me a hint > as I don''t know where else to look. > > I''m running an combo of Rails/Sql Server (I know, I know, legacy though) > using Ubuntu/UnixODBC/FreeTDS/activerecord-odbc-adapter. The app seems > to be talking to the DB perfectly. When I have a clean database, I''m > able to run rake db:migrate and everything generates correctly. However, > if I add another migration and run the migrations again, I get this > error: > > rake aborted! > S0001 (2714) [unixODBC][FreeTDS][SQL Server]There is already an object > named ''schema_migrations'' in the database. > > Which, of course there is! I''m just attempting to add a new table, > column, etc. The only way I''ve been able to add migrations thus far is > to wipe the database and rerun the migrations from scratch. Obviously > can''t keep that up forever. > > with a --trace argument, I do notice that it thinks I''m running them for > the first time. Where does the rake task look to decide this? > > ** Invoke db:migrate (first_time) > ** Invoke environment (first_time) > > Thanks so much for any help you can provide! > > -Ben > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ben Lieber
2009-Jan-23 16:01 UTC
Re: There is already an object named ''schema_migrations'' in the
Thanks for the response Piyush, Actually the schema_info table was replace by the schema_migrations table in later versions of rails (2.0+ I think?). When looking at the schema_migrations table, I do see all the migrations to date listed. Rails seems to be making the decision that this is the first time the migrations have run from some local setting. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Denis Haskin
2009-Jan-24 14:32 UTC
Re: There is already an object named ''schema_migrations'' in the
The "first_time" just means that''s the first time the task is being invoked in this rake run, I believe. Doesn''t mean it thinks you''re running migrations for the first time ever. I encountered this error with a plugin that had not been upgraded to be compatible with Rails 2.x. I would recommend running rake --trace again, but then look at the call stack that gets dumped to figure out exactly which task is causing this error, and perhaps what plugin may or may not be related. dwh Ben Lieber wrote:> Hi I have an unusual one, hoping one of you geniuses can give me a hint > as I don''t know where else to look. > > I''m running an combo of Rails/Sql Server (I know, I know, legacy though) > using Ubuntu/UnixODBC/FreeTDS/activerecord-odbc-adapter. The app seems > to be talking to the DB perfectly. When I have a clean database, I''m > able to run rake db:migrate and everything generates correctly. However, > if I add another migration and run the migrations again, I get this > error: > > rake aborted! > S0001 (2714) [unixODBC][FreeTDS][SQL Server]There is already an object > named ''schema_migrations'' in the database. > > Which, of course there is! I''m just attempting to add a new table, > column, etc. The only way I''ve been able to add migrations thus far is > to wipe the database and rerun the migrations from scratch. Obviously > can''t keep that up forever. > > with a --trace argument, I do notice that it thinks I''m running them for > the first time. Where does the rake task look to decide this? > > ** Invoke db:migrate (first_time) > ** Invoke environment (first_time) > > Thanks so much for any help you can provide! > > -Ben >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ben Lieber
2009-Jan-26 17:59 UTC
Re: There is already an object named ''schema_migrations'' in the
I got this working finally. I decided to try the rails-sqlserver-2000-2005-adapter gem rather than the activerecord-odbc-adapter I was using before. I then had change the connection type in database.yml from: adapter:ODBC to: adapter:sqlserver mode:ODBC This seems to have fixed the issue, and give me the added bonus of the sql output to the console, which I wasn''t getting with the other adapter. thanks for all your input! -Ben -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ben Lieber
2009-Feb-09 21:41 UTC
Re: There is already an object named ''schema_migrations'' in the
Looks like there was another post with a similar issue, just figured I''d cross-reference in case someone actually does still want to use the activerecord-odbc-adapter. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---