Hello, I''m new to rails and I''m trying to get a tutorial
application
off the ground
when running rake migrate it errors with a mysql syntax error
response:
Mysql::Error: You 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, `address`
varchar(255) DEFAULT NULL, `ci'' at line 1: CREATE TABLE people (`id`
int(11) DEFAULT NULL auto_increment PRIMARY KEY(11), `name`
varchar(255) DEFAULT NULL, `address` varchar(255) DEFAULT NULL, `city`
varchar(255) DEFAULT NULL, `state` varchar(255) DEFAULT NULL,
`zipcode` varchar(255) DEFAULT NULL) ENGINE=InnoDB
My db file is as follows:
class ContactDb < ActiveRecord::Migration
def self.up
create_table "people" do |t|
t.column "id", :integer
t.column "name", :string
t.column "address", :string
t.column "city", :string
t.column "state", :string
t.column "zipcode", :string
end
end
def self.down
drop_table :people
end
end
I''m using a default mysql, apache, ruby, rails etc. install.
I noticed that It set the value of PRIMAY KEY to 11 and thought that
was kind of strange.
Anybody got any suggestions to get rake working right?
Thanks,
Donald
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---