Add timetz datatype for postgres

This commit is contained in:
Rudy Nurhadi
2024-10-03 11:11:12 +07:00
committed by GitHub
parent 3127d70c3a
commit b56024bc83

View File

@@ -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) => {