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

数据库迁移文件如下

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

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

天蓬老师
天蓬老师

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

全部回复(1)
Peter_Zhu

已解决,precision拼写错误!

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!