# Rake migrate question!

**URL:** <https://www.ruby-forum.com/t/rake-migrate-question/106651>\
**Category:** Rails\
**Created:** [June 12, 2007, 8:59pm UTC](https://www.ruby-forum.com/t/rake-migrate-question/106651 "2007-06-12T20:59:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 12, 2007, 8:59pm UTC](https://www.ruby-forum.com/t/rake-migrate-question/106651/1 "2007-06-12T20:59:08Z")

</div>

I have followed the tutorial at  
[http://godbit.com/article/beginners-guide-to-rails-part-1](http://godbit.com/article/beginners-guide-to-rails-part-1)  
to learn rake migrate. I created a database and have the database  
information in my database.yml correct.

I ran ruby to generate migrate for table and in the ruby code I added  
the following

class ContactDB \< ActiveRecord::Migration — was already there  
def self.up — was  
already  
create\_table “people” do |t|  
t.column “id”, :integer  
t.column “name”, :string  
end  
end

def self.down  
drop\_table :people  
end  
end

when I ran ‘rake migrate’ I get an error like the following

== ContactDb: migrating ==========================  
— create\_table(“people”)  
rake aborted  
MySql::Error: #420000You have an error in your SQL syntax: check the  
manual that corresponds to your MySql server version for the right  
syntax to use near ‘(11), ‘name’ varchar(255) DEFAULT NULL)  
ENGINE=InnoDB’ at line 1 CREATE TABLE people (‘id’ int(11) DEFAULT  
NULL auto\_increment PRIMARY KEY(11), ‘name’ varchar(255) DEFAULT NULL)  
ENGINE=InnoDB

(See full trace by running task with --trace)

Could some one tell me what am I doing wrong?

Thanks.

---

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 12, 2007, 9:06pm UTC](https://www.ruby-forum.com/t/rake-migrate-question/106651/2 "2007-06-12T21:06:10Z")

</div>

DBC User wrote:

> ```
> create_table "people" do |t|
> 
> ```
> 
> when I ran ‘rake migrate’ I get an error like the following
> 
> (See full trace by running task with --trace)
> 
> Could some one tell me what am I doing wrong?
> 
> Thanks.

Rails automatically adds the “id” field. You do not need to (must not)  
include that in your schema.

I don’t think there are any other errors, but I’m sleepy 😃

Cheers  
Mohit.

---

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 12, 2007, 9:12pm UTC](https://www.ruby-forum.com/t/rake-migrate-question/106651/3 "2007-06-12T21:12:13Z")

</div>

On Jun 12, 2:04 pm, Mohit S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > already
> 
> > ENGINE=InnoDB  
> > I don’t think there are any other errors, but I’m sleepy 😃
> 
> Cheers  
> Mohit.- Hide quoted text -
> 
> - Show quoted text -

Thank you so much, it worked. Now I remember, in the begining when I  
using MySql I ran into the same problem.  
Thanks again.
