Skip to content

Free, simple, and intuitive online database diagram editor and SQL generator.

Fix export DECIMAL precision in MariaDB SQL generation (#980)

Jason7130ae114506
diff --git a/src/utils/exportSQL/mariadb.js b/src/utils/exportSQL/mariadb.js
index 8bab3bc6..59255d41 100644
--- a/src/utils/exportSQL/mariadb.js
+++ b/src/utils/exportSQL/mariadb.js
@@ -10,7 +10,10 @@ function parseType(field) {
res += `${field.values ? "(" + field.values.map((value) => "'" + value + "'").join(", ") + ")" : ""}`;
}
- if (dbToTypes[DB.MARIADB][field.type].isSized) {
+ if (
+ dbToTypes[DB.MARIADB][field.type].isSized ||
+ dbToTypes[DB.MARIADB][field.type].hasPrecision
+ ) {
res += `${field.size && field.size !== "" ? "(" + field.size + ")" : ""}`;
}