Import diagram fixes (#549)

This commit is contained in:
Karen Mkrtumyan
2025-08-09 00:21:48 +04:00
committed by GitHub
parent d464fedee4
commit 0a60bd9bb0
3 changed files with 8 additions and 7 deletions

View File

@@ -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,

View File

@@ -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 = {};

View File

@@ -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") },
),