Fix error when field.values is undefined and add it to issues

This commit is contained in:
1ilit
2023-09-19 15:51:20 +03:00
parent aa7b8905b8
commit 81792a5243
4 changed files with 47 additions and 14 deletions

View File

@@ -377,11 +377,26 @@ export default function Table(props) {
(value === "INT" ||
value === "BIGINT" ||
value === "SMALLINT");
updateField(props.tableData.id, j, {
type: value,
length: value === "VARCHAR" ? 255 : "",
increment: incr,
});
if (value === "ENUM" || value === "SET") {
updateField(props.tableData.id, j, {
type: value,
values: [],
increment: incr,
});
} else if (value === "VARCHAR") {
updateField(props.tableData.id, j, {
type: value,
length: 255,
increment: incr,
});
} else {
updateField(props.tableData.id, j, {
type: value,
increment: incr,
length: "",
values: [],
});
}
}}
></Select>
</Col>
@@ -1102,7 +1117,6 @@ export default function Table(props) {
type: "",
default: "",
check: "",
length: "",
primary: false,
unique: false,
notNull: false,