Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore(schema-edtior): update default value options (#10487)

boojack14f72a150428
diff --git a/frontend/src/components/SchemaEditorLite/utils/columnDefaultValue.ts b/frontend/src/components/SchemaEditorLite/utils/columnDefaultValue.ts
index 5debf934e5..5f4c82d10e 100644
--- a/frontend/src/components/SchemaEditorLite/utils/columnDefaultValue.ts
+++ b/frontend/src/components/SchemaEditorLite/utils/columnDefaultValue.ts
@@ -86,7 +86,14 @@ export const getColumnTypeDefaultValueOptions = (
type.startsWith("CHAR")
) {
return [NO_DEFAULT_OPTION, EMPTY_STRING_OPTION, EXPRESSION_OPTION];
- } else if (type === "INT" || type === "INTEGER") {
+ } else if (
+ type === "INTEGER" ||
+ type === "INT" ||
+ type === "SMALLINT" ||
+ type === "TINYINT" ||
+ type === "MEDIUMINT" ||
+ type === "BIGINT"
+ ) {
return [NO_DEFAULT_OPTION, INT_ZERO_OPTION, EXPRESSION_OPTION];
} else if (type === "FLOAT" || type === "DOUBLE") {
return [NO_DEFAULT_OPTION, INT_ZERO_OPTION];
@@ -100,7 +107,17 @@ export const getColumnTypeDefaultValueOptions = (
type.startsWith("CHAR")
) {
return [NO_DEFAULT_OPTION, EMPTY_STRING_OPTION, EXPRESSION_OPTION];
- } else if (type === "INTEGER" || type === "BIGINT" || type === "SERIAL") {
+ } else if (
+ type === "SMALLINT" ||
+ type === "INTEGER" ||
+ type === "BIGINT" ||
+ type === "SERIAL" ||
+ type === "SMALLSERIAL" ||
+ type === "BIGSERIAL" ||
+ type === "INT2" ||
+ type === "INT4" ||
+ type === "INT8"
+ ) {
return [NO_DEFAULT_OPTION, INT_ZERO_OPTION, EXPRESSION_OPTION];
} else if (type === "BOOLEAN") {
return [NO_DEFAULT_OPTION, BOOLEAN_TRUE_OPTION, BOOLEAN_FALSE_OPTION];
diff --git a/frontend/src/components/SchemaEditorV1/utils/columnDefaultValue.ts b/frontend/src/components/SchemaEditorV1/utils/columnDefaultValue.ts
index 5debf934e5..5f4c82d10e 100644
--- a/frontend/src/components/SchemaEditorV1/utils/columnDefaultValue.ts
+++ b/frontend/src/components/SchemaEditorV1/utils/columnDefaultValue.ts
@@ -86,7 +86,14 @@ export const getColumnTypeDefaultValueOptions = (
type.startsWith("CHAR")
) {
return [NO_DEFAULT_OPTION, EMPTY_STRING_OPTION, EXPRESSION_OPTION];
- } else if (type === "INT" || type === "INTEGER") {
+ } else if (
+ type === "INTEGER" ||
+ type === "INT" ||
+ type === "SMALLINT" ||
+ type === "TINYINT" ||
+ type === "MEDIUMINT" ||
+ type === "BIGINT"
+ ) {
return [NO_DEFAULT_OPTION, INT_ZERO_OPTION, EXPRESSION_OPTION];
} else if (type === "FLOAT" || type === "DOUBLE") {
return [NO_DEFAULT_OPTION, INT_ZERO_OPTION];
@@ -100,7 +107,17 @@ export const getColumnTypeDefaultValueOptions = (
type.startsWith("CHAR")
) {
return [NO_DEFAULT_OPTION, EMPTY_STRING_OPTION, EXPRESSION_OPTION];
- } else if (type === "INTEGER" || type === "BIGINT" || type === "SERIAL") {
+ } else if (
+ type === "SMALLINT" ||
+ type === "INTEGER" ||
+ type === "BIGINT" ||
+ type === "SERIAL" ||
+ type === "SMALLSERIAL" ||
+ type === "BIGSERIAL" ||
+ type === "INT2" ||
+ type === "INT4" ||
+ type === "INT8"
+ ) {
return [NO_DEFAULT_OPTION, INT_ZERO_OPTION, EXPRESSION_OPTION];
} else if (type === "BOOLEAN") {
return [NO_DEFAULT_OPTION, BOOLEAN_TRUE_OPTION, BOOLEAN_FALSE_OPTION];