diff --git a/tools/generate_tables_sql.php b/tools/generate_tables_sql.php index 18b1c39d8d9..d58e45d7c1a 100755 --- a/tools/generate_tables_sql.php +++ b/tools/generate_tables_sql.php @@ -94,6 +94,12 @@ case "radio": $bits[0] = enumizeOptions($bits[3], $table = [], $bits[1]); break; + case "numeric": + // without this option, default MySQL is simply numeric + // which is traduced to "decimal(10,0)" + // which truncates the floating point part. + $bits[0] = "decimal(14,4)"; + break; case "select": $bits[0] = enumizeOptions( $bits[3] ?? null, diff --git a/tools/generate_tables_sql_and_testNames.php b/tools/generate_tables_sql_and_testNames.php index 3f529a11702..186a1014a87 100755 --- a/tools/generate_tables_sql_and_testNames.php +++ b/tools/generate_tables_sql_and_testNames.php @@ -87,6 +87,11 @@ $bits[0] = "varchar(255)"; } elseif ($bits[0] == "static") { $bits[0] = "varchar(255)"; + } elseif ($bits[0] == "numeric") { + // without this option, default MySQL is simply numeric + // which is traduced to "decimal(10,0)" + // which truncates the floating point part. + $bits[0] = "decimal(14,4)"; } $output .= "`$bits[1]` $bits[0] default NULL,\n";