I had to create a sqlite3 database in my rails 3.1.1 app manually, converting from a mysql database using the mysql2sqlite tool, and then running:
sqlite3 development.sqlite3 < mysql2sqlite_dump.sql
Anyways, the development.sqlite3 file is there, and the server starts up fine and all the pages are loading fine (no database errors about missing tables or anything), but the data isn’t being read… just as if it wasn’t there. Even running Event.all, for example, in console gives me :
Event Load (0.1ms) SELECT "events".* FROM "events"
=> []
When there should actually be several events. Looking in the sqlite3 file, I can see that all the information is there, but it’s just not being read. I will post part of the database file if anybody requests it.
My question is: Why isn’t the database being read properly, and how can I make it so?
Thanks.
Well, I seemed to have solved the problem. The issue was that
mysqldump(being executed inside of themysql2sqlitescript) was dropping and then creating the tables (which is default), and that was conflicting with the schema file. So, I created the database according the schema file, and then ran the script again with the--no-create-infooption added formysqldumpso that it would only insert the information.Thanks for the help everybody!