Hi,
In the following migration I am trying to create a decimal column
called stars. After rake migrate you can see that the field does not
come out right in mysql. The decimal column has no decimal part. Does
anyone know what I am doing wrong or should be doing?
create_table :areas do |t|
t.column :name, :string
t.column :stars, :decimal, :precision=>4, :scale=>3
end
produces
±------------±--------------±-----±----±--------±---------------+
| Field | Type | Null | Key | Default | Extra |
±------------±--------------±-----±----±--------±---------------+
| id | int(11) | | PRI | NULL | auto_increment |
| name | varchar(255) | YES | | NULL | |
| stars | decimal(10,0) | YES | | NULL | |
±------------±--------------±-----±----±--------±---------------+
I think that I’m hoping to see decimal(4,3)
Thanks,
Peter