Upgrade problem with h2 database when upgrading from 192 to 200 : Scale must not be bigger than precision

This data type is not valid and was never supported by H2, but old H2, due to bug, somehow accepted it.

  1. You need to export your database to a script with 1.4.192 Beta using
SCRIPT TO 'source.sql'

You need to use the original database file, because if you opened file from 1.4.192 Beta with 1.4.200, it may be corrupted by it, such automatic upgrade is not supported.

  1. You need to replace DATETIME(23,3) with TIMESTAMP(3) or whatever you need using a some text editor. If exported SQL is too large for regular text editors, you can use a stream editor, such as sed:
sed 's/DATETIME(23,3)/TIMESTAMP(3)/g' source.sql > fixed.sql
  1. Now you can create a new database with 1.4.200 and import the edited script into it:
RUNSCRIPT FROM 'fixed.sql'

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top