資料庫遷移檔案如下
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
不知道是什麼原因,請幫忙看一下,謝謝!