ruby - Error adding decimal column: precision cannot be empty
天蓬老师
天蓬老师 2017-04-24 09:13:08
0
1
664

数据库迁移文件如下

class CreateWorks < ActiveRecord::Migration
  def change
    create_table :works do |t|
      t.integer :project_id
      t.integer :user_id
      t.datetime :datetimeperformed
      t.decimal :hours, percision: 5, scale: 2
      t.timestamps null: false
    end
  end
end

执行:

rake db:migrate 

报错
Error adding decimal column: precision cannot be empty if scale is specified

不知道是什么原因,请帮忙看一下,谢谢!

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(1)
Peter_Zhu

Resolved, precision was spelled incorrectly!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!