目次

Version 1, last updated by zvozin at Apr 30 12:32 UTC

If you want Schemifier to create a useful column definition, you need to provide explicit MathContext when declaring your MappedDecimal field, and override MappedDecimal.scale like so:

object balance extends MappedDecimal(this, MathContext.DECIMAL64, 0)
{
    override val scale = 2
}

Pick a MathContext other than MathContext.Unlimited. It’s the default, and will result in column definition that uses the database’s default DECIMAL scale, which is usually 0 decimal positions.