# Rake db:migrate - where is my table?

**URL:** <https://www.ruby-forum.com/t/rake-db-migrate-where-is-my-table/124250>\
**Category:** Rails\
**Created:** [December 27, 2007, 3:44am UTC](https://www.ruby-forum.com/t/rake-db-migrate-where-is-my-table/124250 "2007-12-27T03:44:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![alfredojahn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@alfredojahn](https://www.ruby-forum.com/u/alfredojahn)\
**Post date:** [December 27, 2007, 3:44am UTC](https://www.ruby-forum.com/t/rake-db-migrate-where-is-my-table/124250/1 "2007-12-27T03:44:08Z")

</div>

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?

Thanks.

---

<div class="post-metadata">

**Author:** ![alfredojahn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@alfredojahn](https://www.ruby-forum.com/u/alfredojahn)\
**Post date:** [December 27, 2007, 4:30am UTC](https://www.ruby-forum.com/t/rake-db-migrate-where-is-my-table/124250/2 "2007-12-27T04:30:56Z")

</div>

Are you sure you specified the correct database in config/database.yml?

On Dec 27, 2007 1:13 PM, alfredojahn [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> that?
> 
> Thanks.
> 
> >

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

Feel free to add me to MSN and/or GTalk as this email.

---

<div class="post-metadata">

**Author:** ![alfredojahn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@alfredojahn](https://www.ruby-forum.com/u/alfredojahn)\
**Post date:** [December 27, 2007, 8:18am UTC](https://www.ruby-forum.com/t/rake-db-migrate-where-is-my-table/124250/3 "2007-12-27T08:18:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![alfredojahn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@alfredojahn](https://www.ruby-forum.com/u/alfredojahn)\
**Post date:** [December 27, 2007, 8:31am UTC](https://www.ruby-forum.com/t/rake-db-migrate-where-is-my-table/124250/4 "2007-12-27T08:31:26Z")

</div>

Thufir if u have different doubt than the existing thread pls dont post  
there itself start a new thread and post there…

So that the continuity/tracability will be maintained…

---

<div class="post-metadata">

**Author:** ![alfredojahn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@alfredojahn](https://www.ruby-forum.com/u/alfredojahn)\
**Post date:** [December 27, 2007, 8:29am UTC](https://www.ruby-forum.com/t/rake-db-migrate-where-is-my-table/124250/5 "2007-12-27T08:29:37Z")

</div>

Thufir wrote:

> 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.

---

<div class="post-metadata">

**Author:** ![alfredojahn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@alfredojahn](https://www.ruby-forum.com/u/alfredojahn)\
**Post date:** [December 27, 2007, 10:00am UTC](https://www.ruby-forum.com/t/rake-db-migrate-where-is-my-table/124250/6 "2007-12-27T10:00:08Z")

</div>

On Thu, 27 Dec 2007 08:31:26 +0100, Ratnavel S. wrote:

> Thufir if u have different doubt than the existing thread pls dont post  
> there itself start a new thread and post there…

Pardon, I don’t follow your point. Yes, I’m all for thread continuity  
🙂

-Thufir

---

<div class="post-metadata">

**Author:** ![alfredojahn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@alfredojahn](https://www.ruby-forum.com/u/alfredojahn)\
**Post date:** [December 27, 2007, 4:37pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-where-is-my-table/124250/7 "2007-12-27T16:37:51Z")

</div>

On Dec 26, 2007 9:43 PM, alfredojahn [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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.

–  
Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)

---

<div class="post-metadata">

**Author:** ![alfredojahn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@alfredojahn](https://www.ruby-forum.com/u/alfredojahn)\
**Post date:** [January 15, 2008, 4:23pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-where-is-my-table/124250/8 "2008-01-15T16:23:36Z")

</div>

alfredojahn wrote:

> 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:

> **[Rails 2.0.2: Some new defaults and a few fixes](https://rubyonrails.org/2007/12/17/rails-2-0-2-some-new-defaults-and-a-few-fixes)**
>
> Now that we have the big Rails 2.0 release out the door, it’s a lot easier to push out smaller updates more frequently. So that’s what we’re going to do. Rails 2.0.2 contains a bunch of smaller fixes to various bugs, no show-stopping action, just...

"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.
