| Message: 61984 |
 |
BY: Praveen Devarao (praveend) DATE: 2008-11-10 11:26 SUBJECT: RE: Upgrading to Rails 2.1 Hi David,
Yes, you have got it right, with Rails-2.0 and onwards you need not register ibm_db adapter with Activerecord, it is recognized automatically.
You can do a scaffold against an existing table. It will work fine. I tried doing a scaffold against an existing table and it works fine, showing me the data in the table. The only way I could see the kind of results that you are seeing is that rows in the database have null values for all the columns except for the id column(which is not shown by Rails). Could you check the data of the table, that you are accessing, through db2 command prompt or control center (Note: - Might be there are 2 tables with same name but in different schema and your are accessing a table in the wrong schema).
Coming to scaffold, you did right by dropping the schema_migrations table and starting fresh. Seeing the error message seems like your new rails (>2.0) environment is not getting invoked, I says this because your error message says No migration with version number 3, which was thrown out in the earlier Rails version, with new Rails the schema_migrations table will contain the timestamp of the migration and not numbers. Just check if the version of Rails being invoked is greater than 2.0 by checking in your applications environment.rb file (could you provide me with the output of rails --version). Also check if your database has a table called schema_info, (which was being created by Rails version less than 2.0), whose presence should actually not affect.
If the case is not as said above could you provide me with a small use case with which I will be able to repro the problem.
Let me know if you require more details or require some clarification.
Thanks
Praveen | |