Hi all,
I’m creating the db schema for MySQL 5.0 using migration but run into
error. My migration file is as follows:
class CreateCustomers < ActiveRecord::Migration
def self.up
create_table :customers do |t|
t.column :id, :integer, :null => false
t.column :name, :string
end
end
def self.down
drop_table :customers
end
end
And the error information is:
== CreateCustomers: migrating
– create_table(:customers)
rake aborted!
Mysql::Error: #42000You 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 customers (id
int(11) DEFAULT
NULL auto_increment PRIMARY KEY(11), name
varchar(255) DEFAULT NULL)
ENGINE=InnoDB
I’ve never seen this error before. What’s wrong with my migration file
or develop env? How could I solve this? Thanks a lot.