diff --git a/src/components/gui/schema-editor/column-provider.tsx b/src/components/gui/schema-editor/column-provider.tsx index f47a05a..451b054 100644 --- a/src/components/gui/schema-editor/column-provider.tsx +++ b/src/components/gui/schema-editor/column-provider.tsx @@ -1,5 +1,5 @@ +import { DatabaseTableColumnChange } from "@/drivers/base-driver"; import { PropsWithChildren, createContext, useContext } from "react"; -import { DatabaseTableColumnChange } from "."; const ColumnContext = createContext<{ columns: DatabaseTableColumnChange[] }>({ columns: [], diff --git a/src/components/gui/table-cell/generic-cell.tsx b/src/components/gui/table-cell/generic-cell.tsx index e65737a..21be342 100644 --- a/src/components/gui/table-cell/generic-cell.tsx +++ b/src/components/gui/table-cell/generic-cell.tsx @@ -209,7 +209,8 @@ export default function GenericCell({ const fkContent = useMemo(() => { if ( header.foreignKey?.foreignTableName && - header.foreignKey.foreignColumns + header.foreignKey.foreignColumns && + header.foreignKey?.foreignSchemaName ) { return (
diff --git a/src/drivers/mysql/mysql-driver.ts b/src/drivers/mysql/mysql-driver.ts index e094f8a..011c7c2 100644 --- a/src/drivers/mysql/mysql-driver.ts +++ b/src/drivers/mysql/mysql-driver.ts @@ -107,8 +107,9 @@ export default abstract class MySQLLikeDriver extends CommonSQLImplement { }; const tableKey = c.TABLE_SCHEMA + "." + c.TABLE_NAME; - if (tableRecord[tableKey].tableSchema) { - tableRecord[tableKey].tableSchema.columns.push(column); + const tableSchema = tableRecord[tableKey].tableSchema; + if (tableSchema) { + tableSchema.columns.push(column); } }