mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-12-20 01:00:56 +08:00
Fix corrupted endFieldIds after import
This commit is contained in:
@@ -119,7 +119,7 @@ export function fromMariaDB(ast, diagramDb = DB.GENERIC) {
|
|||||||
const endFieldId = tables[endTableId].fields.findIndex(
|
const endFieldId = tables[endTableId].fields.findIndex(
|
||||||
(f) => f.name === endField,
|
(f) => f.name === endField,
|
||||||
);
|
);
|
||||||
if (endField === -1) return;
|
if (endFieldId === -1) return;
|
||||||
|
|
||||||
const startFieldId = table.fields.findIndex(
|
const startFieldId = table.fields.findIndex(
|
||||||
(f) => f.name === startField,
|
(f) => f.name === startField,
|
||||||
@@ -223,7 +223,7 @@ export function fromMariaDB(ast, diagramDb = DB.GENERIC) {
|
|||||||
const endFieldId = tables[endTableId].fields.findIndex(
|
const endFieldId = tables[endTableId].fields.findIndex(
|
||||||
(f) => f.name === endField,
|
(f) => f.name === endField,
|
||||||
);
|
);
|
||||||
if (endField === -1) return;
|
if (endFieldId === -1) return;
|
||||||
|
|
||||||
const startFieldId = tables[startTableId].fields.findIndex(
|
const startFieldId = tables[startTableId].fields.findIndex(
|
||||||
(f) => f.name === startField,
|
(f) => f.name === startField,
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ export function fromMSSQL(ast, diagramDb = DB.GENERIC) {
|
|||||||
const endFieldId = tables[endTableId].fields.findIndex(
|
const endFieldId = tables[endTableId].fields.findIndex(
|
||||||
(f) => f.name === endField,
|
(f) => f.name === endField,
|
||||||
);
|
);
|
||||||
if (endField === -1) return;
|
if (endFieldId === -1) return;
|
||||||
|
|
||||||
const startFieldId = table.fields.findIndex(
|
const startFieldId = table.fields.findIndex(
|
||||||
(f) => f.name === startField,
|
(f) => f.name === startField,
|
||||||
@@ -235,7 +235,7 @@ export function fromMSSQL(ast, diagramDb = DB.GENERIC) {
|
|||||||
const endFieldId = tables[endTableId].fields.findIndex(
|
const endFieldId = tables[endTableId].fields.findIndex(
|
||||||
(f) => f.name === endField,
|
(f) => f.name === endField,
|
||||||
);
|
);
|
||||||
if (endField === -1) return;
|
if (endFieldId === -1) return;
|
||||||
|
|
||||||
const startFieldId = tables[startTableId].fields.findIndex(
|
const startFieldId = tables[startTableId].fields.findIndex(
|
||||||
(f) => f.name === startField,
|
(f) => f.name === startField,
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ export function fromMySQL(ast, diagramDb = DB.GENERIC) {
|
|||||||
const endFieldId = tables[endTableId].fields.findIndex(
|
const endFieldId = tables[endTableId].fields.findIndex(
|
||||||
(f) => f.name === endField,
|
(f) => f.name === endField,
|
||||||
);
|
);
|
||||||
if (endField === -1) return;
|
if (endFieldId === -1) return;
|
||||||
|
|
||||||
const startFieldId = table.fields.findIndex(
|
const startFieldId = table.fields.findIndex(
|
||||||
(f) => f.name === startField,
|
(f) => f.name === startField,
|
||||||
@@ -223,7 +223,7 @@ export function fromMySQL(ast, diagramDb = DB.GENERIC) {
|
|||||||
const endFieldId = tables[endTableId].fields.findIndex(
|
const endFieldId = tables[endTableId].fields.findIndex(
|
||||||
(f) => f.name === endField,
|
(f) => f.name === endField,
|
||||||
);
|
);
|
||||||
if (endField === -1) return;
|
if (endFieldId === -1) return;
|
||||||
|
|
||||||
const startFieldId = tables[startTableId].fields.findIndex(
|
const startFieldId = tables[startTableId].fields.findIndex(
|
||||||
(f) => f.name === startField,
|
(f) => f.name === startField,
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ export function fromSQLite(ast, diagramDb = DB.GENERIC) {
|
|||||||
const endFieldId = tables[endTableId].fields.findIndex(
|
const endFieldId = tables[endTableId].fields.findIndex(
|
||||||
(f) => f.name === endField,
|
(f) => f.name === endField,
|
||||||
);
|
);
|
||||||
if (endField === -1) return;
|
if (endFieldId === -1) return;
|
||||||
|
|
||||||
const startFieldId = table.fields.findIndex(
|
const startFieldId = table.fields.findIndex(
|
||||||
(f) => f.name === startField,
|
(f) => f.name === startField,
|
||||||
|
|||||||
Reference in New Issue
Block a user