Add timetz datatype for postgres

This commit is contained in:
Rudy Nurhadi 2024-10-03 11:11:12 +07:00 committed by 1ilit
parent 468210f28a
commit c8386a0f99

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