From cccf9da8ce04cbca956a7b7305822d429e94b360 Mon Sep 17 00:00:00 2001 From: Robert Steuck Date: Tue, 7 Nov 2023 08:09:19 +0100 Subject: [PATCH] Add value precision workaround to README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index b7184a5..e424f90 100644 --- a/README.md +++ b/README.md @@ -310,6 +310,21 @@ Rollup stores both dates and times in the `time` column depending on the interva - MySQL: `CAST(time AS date)` - SQLite: `date(time)` +### Value Precision + +The default value column is of type `:float` which might not have the precision you need. If you need a different precision you can change the type of the value column like this + +```ruby +# some_migration.rb +def up + change_column :rollups, :value, :decimal, precision: 24, scale: 2 +end + +def down + change_column :rollups, :value, :float +end +``` + ## Examples - [Ahoy](#ahoy)