los valores pueden tener decimales

usamos decimal y no float para no perder precisión
This commit is contained in:
f 2022-06-08 11:14:49 -03:00
parent 9801cf8521
commit 21193a08ac

View file

@ -0,0 +1,11 @@
# frozen_string_literal: true
class ChangeValueToDecimal < ActiveRecord::Migration[6.1]
def up
change_column :sensors, :value, :decimal, precision: 10
end
def down
change_column :sensors, :value, :integer
end
end