Skip to content

Free, simple, and intuitive online database diagram editor and SQL generator.

Import diagram fixes (#549)

Karen Mkrtumyan0a60bd9bb051
diff --git a/src/utils/importSQL/mariadb.js b/src/utils/importSQL/mariadb.js
index 8c7f3a87..4f06f376 100644
--- a/src/utils/importSQL/mariadb.js
+++ b/src/utils/importSQL/mariadb.js
@@ -121,7 +121,7 @@ export function fromMariaDB(ast, diagramDb = DB.GENERIC) {
const endField = endTable.fields.find(
(f) => f.name === endFieldName,
);
- if (endField) return;
+ if (!endField) return;
const startField = table.fields.find(
(f) => f.name === startFieldName,
diff --git a/src/utils/importSQL/oraclesql.js b/src/utils/importSQL/oraclesql.js
index ab065544..de76814e 100644
--- a/src/utils/importSQL/oraclesql.js
+++ b/src/utils/importSQL/oraclesql.js
@@ -4,10 +4,12 @@ import { dbToTypes } from "../../data/datatypes";
const affinity = {
[DB.ORACLESQL]: new Proxy(
- { INT: "INTEGER" },
- { NUMERIC: "NUMBER" },
- { DECIMAL: "NUMBER" },
- { CHARACTER: "CHAR" },
+ {
+ INT: "INTEGER",
+ NUMERIC: "NUMBER",
+ DECIMAL: "NUMBER",
+ CHARACTER: "CHAR",
+ },
{ get: (target, prop) => (prop in target ? target[prop] : "BLOB") },
),
[DB.GENERIC]: new Proxy(
@@ -25,7 +27,6 @@ export function fromOracleSQL(ast, diagramDb = DB.GENERIC) {
const enums = [];
const parseSingleStatement = (e) => {
- console.log(e);
if (e.operation === "create") {
if (e.object === "table") {
const table = {};
diff --git a/src/utils/importSQL/postgres.js b/src/utils/importSQL/postgres.js
index a3751719..50a496b2 100644
--- a/src/utils/importSQL/postgres.js
+++ b/src/utils/importSQL/postgres.js
@@ -13,7 +13,7 @@ const affinity = {
INTEGER: "INT",
MEDIUMINT: "INTEGER",
BIT: "BOOLEAN",
- "CHATACTER VARYING": "VARCHAR",
+ "CHARACTER VARYING": "VARCHAR",
},
{ get: (target, prop) => (prop in target ? target[prop] : "BLOB") },
),