Skip to content

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

Add timetz datatype for postgres

Rudy Nurhadic8386a0f9911
diff --git a/src/data/datatypes.js b/src/data/datatypes.js
index cacb7ec5..275a0c34 100644
--- a/src/data/datatypes.js
+++ b/src/data/datatypes.js
@@ -909,6 +909,20 @@ const postgresTypesBase = {
hasPrecision: false,
hasQuotes: true,
},
+ TIMETZ: {
+ type: "TIMETZ",
+ checkDefault: (field) => {
+ const specialValues = ["now", "allballs"];
+ return (
+ /^(?:[01]?\d|2[0-3]):[0-5]?\d:[0-5]?\d([+-]\d{2}:\d{2})?$/.test(field.default) ||
+ specialValues.includes(field.default.toLowerCase())
+ );
+ },
+ hasCheck: false,
+ isSized: false,
+ hasPrecision: false,
+ hasQuotes: true,
+ },
TIMESTAMP: {
type: "TIMESTAMP",
checkDefault: (field) => {