Not sure if this is another rails 2.0 issue and the info in AWDWR 2nd
ed, or not…
(I’m new to Rails) I modified the 001_create_products.rb file and
added the needed info to create 3 tables in a database that I created
using CocoaMySQL. When I ran “rake db:migrate” the info on the console
looked good. I then go into CocoaMySQL, select that same database, but
there are no tables in it. Any ideas? I also use mysql on the command
line to look at that database, but no table to be found. What up with
that?
On Wed, 26 Dec 2007 18:43:37 -0800, alfredojahn wrote:
When I ran “rake db:migrate” the info on the console looked good.
What’s the result of:
rake db:migrate VERSION=0 --trace
-Thufir
rake db:migrate – this will create tables for you as described in
migration files into the database specified in the database.yml file
VERSION=0 – If you are using a version control system it’ll consider
the zeroth version of yr project(Mostly initial import to the
repository), This can be skipped actually.
–trace this is the additional attribute passed with rake command to see
the complete log message.
You can carry out this jus by giving rake db:migrate this will hold
good.
Not sure if this is another rails 2.0 issue and the info in AWDWR 2nd
ed, or not…
(I’m new to Rails) I modified the 001_create_products.rb file and
added the needed info to create 3 tables in a database that I created
using CocoaMySQL.
Had you already migrated using this migration before you modified it?
This is the picture I get from saying you modified it rather than
creating it.
When I ran “rake db:migrate” the info on the console
looked good. I then go into CocoaMySQL, select that same database, but
there are no tables in it. Any ideas? I also use mysql on the command
line to look at that database, but no table to be found. What up with
that?
If you really did modify it, then rake db:migrate probably didn’t do
anything other than get the current schema version from the database,
notice that it was already 1, and quit.
In general you want to generate a new migration each time you make a
schema change to the database.
I then go into CocoaMySQL, select that same database, but
there are no tables in it. Any ideas? I also use mysql on the command
line to look at that database, but no table to be found. What up with
that?
I had the same problem as you and found my answer here:
"SQLite3 is the new default database…
If you want to preconfigure your database for MySQL (or any of the other
adapters), you simply do “rails -d mysql myapp†and everything is the
same as before. "
So I recreated my app as above and the tables are now showing in MySQL.
Greg.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.