Add more keywords for defaults (#553)

* Add more keywords for defaults

* Add date functions to check default
This commit is contained in:
1ilit
2025-08-16 16:18:01 +04:00
committed by GitHub
parent 2d7c2c6d30
commit 21a68e9b13
2 changed files with 13 additions and 1 deletions

View File

@@ -1023,6 +1023,9 @@ const postgresTypesBase = {
"today",
"tomorrow",
"yesterday",
"current_date",
"current_timestamp",
"current_time",
];
return (
/^\d{4}-\d{2}-\d{2}$/.test(field.default) ||

View File

@@ -33,7 +33,16 @@ export function strHasQuotes(str) {
);
}
const keywords = ["CURRENT_TIMESTAMP", "NULL"];
const keywords = [
"NULL",
"TRUE",
"FALSE",
"CURRENT_DATE",
"CURRENT_TIME",
"CURRENT_TIMESTAMP",
"LOCALTIME",
"LOCALTIMESTAMP"
];
export function isKeyword(str) {
return keywords.includes(str.toUpperCase());