diff --git a/src/components/ControlPanel.jsx b/src/components/ControlPanel.jsx index d13fef0..2abf33b 100644 --- a/src/components/ControlPanel.jsx +++ b/src/components/ControlPanel.jsx @@ -223,7 +223,7 @@ export default function ControlPanel({ } else if (a.component === "field_delete") { setRelationships((prev) => { return prev.map((e) => { - if (e.startTableId === a.tid && e.startFieldId > a.data.id) { + if (e.startTableId === a.tid && e.startFieldId >= a.data.id) { return { ...e, startFieldId: e.startFieldId + 1, @@ -231,7 +231,7 @@ export default function ControlPanel({ startY: tables[a.tid].y + (e.startFieldId + 1) * 36 + 50 + 19, }; } - if (e.endTableId === a.tid && e.endFieldId > a.data.id) { + if (e.endTableId === a.tid && e.endFieldId >= a.data.id) { return { ...e, endFieldId: e.endFieldId + 1, @@ -1256,8 +1256,8 @@ export default function ControlPanel({ field.comment = ""; field.unique = false; if (d.unique) field.unique = true; - field.auto_increment = false; - if (d.auto_increment) field.auto_increment = true; + field.increment = false; + if (d.auto_increment) field.increment = true; field.notNull = false; if (d.nullable) field.notNull = true; field.primary = false; diff --git a/src/components/Table.jsx b/src/components/Table.jsx index aa11c1e..0f01e7d 100644 --- a/src/components/Table.jsx +++ b/src/components/Table.jsx @@ -1266,7 +1266,6 @@ export default function Table(props) {