ruby - Error adding decimal column: precision cannot be empty

【字号: 日期:2022-10-15浏览:49作者:雯心

问题描述

数据库迁移文件如下

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 endend

执行:

rake db:migrate

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

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

问题解答

回答1:

已解决,precision拼写错误!

相关文章: