これは以前に尋ねられたようです: rails decimal precision and scale
ただし、またはのchange_column
移行を実行すると、実際にはスキーマやデータベースには影響しませんが、エラーなしで実行されます。:precision
:scale
db:migrate
私の移行ファイルは次のようになります。
class ChangePrecisionAndScaleOfPaybackPeriodInTags < ActiveRecord::Migration
def self.up
change_column :tags, :payback_period, :decimal, { :scale => 3, :precision => 10 }
end
def self.down
change_column :tags, :payback_period, :decimal
end
end
しかし、私のスキーマ (およびデータ) は次のようになります。
t.decimal "payback_period"
他の誰かがこの問題を抱えていますか?
ありがとう、
ジョシュ