los valores pueden tener decimales
usamos decimal y no float para no perder precisión
This commit is contained in:
parent
9801cf8521
commit
21193a08ac
1 changed files with 11 additions and 0 deletions
11
db/migrate/20220608141004_change_value_to_decimal.rb
Normal file
11
db/migrate/20220608141004_change_value_to_decimal.rb
Normal 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
|
Loading…
Reference in a new issue