I am using Rails 2.1 and mysql.
I have a very simple migration:
class CreateTasks < ActiveRecord::Migration
def self.up
create_table :tasks do |t|
t.column :job_id, :integer, :null => false
t.column :name, :string, :null => false
t.column :description, :string
t.column :actual, :number, :null => true
end
end
def self.down
drop_table :tasks
end
end
When I run this, the SQL that is generated is broken:
CREATE TABLE tasks
(id
int(11) DEFAULT NULL auto_increment PRIMARY
KEY, name
varchar(255) NOT NULL, description
varchar(255) DEFAULT
NULL NULL, actual
number DEFAULT NULL NULL) ENGINE=InnoDB
Note the DEFAULT NULL NULL, after the description and actual columns
- and also the default NULL after the id column which I don’t think
should be there either - am I doing something totally stupid, or is
something broken here?
I have used migrations successfully on Rails 1.x and 2.0 on this
machine before OS X Tiger.