Skip to content

Commit 0a60bd9

Browse files
authored
Import diagram fixes (#549)
1 parent d464fed commit 0a60bd9

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/utils/importSQL/mariadb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export function fromMariaDB(ast, diagramDb = DB.GENERIC) {
121121
const endField = endTable.fields.find(
122122
(f) => f.name === endFieldName,
123123
);
124-
if (endField) return;
124+
if (!endField) return;
125125

126126
const startField = table.fields.find(
127127
(f) => f.name === startFieldName,

src/utils/importSQL/oraclesql.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import { dbToTypes } from "../../data/datatypes";
44

55
const affinity = {
66
[DB.ORACLESQL]: new Proxy(
7-
{ INT: "INTEGER" },
8-
{ NUMERIC: "NUMBER" },
9-
{ DECIMAL: "NUMBER" },
10-
{ CHARACTER: "CHAR" },
7+
{
8+
INT: "INTEGER",
9+
NUMERIC: "NUMBER",
10+
DECIMAL: "NUMBER",
11+
CHARACTER: "CHAR",
12+
},
1113
{ get: (target, prop) => (prop in target ? target[prop] : "BLOB") },
1214
),
1315
[DB.GENERIC]: new Proxy(
@@ -25,7 +27,6 @@ export function fromOracleSQL(ast, diagramDb = DB.GENERIC) {
2527
const enums = [];
2628

2729
const parseSingleStatement = (e) => {
28-
console.log(e);
2930
if (e.operation === "create") {
3031
if (e.object === "table") {
3132
const table = {};

src/utils/importSQL/postgres.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const affinity = {
1313
INTEGER: "INT",
1414
MEDIUMINT: "INTEGER",
1515
BIT: "BOOLEAN",
16-
"CHATACTER VARYING": "VARCHAR",
16+
"CHARACTER VARYING": "VARCHAR",
1717
},
1818
{ get: (target, prop) => (prop in target ? target[prop] : "BLOB") },
1919
),

0 commit comments

Comments
 (0)