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( const endField = endTable.fields.find(
(f) => f.name === endFieldName, (f) => f.name === endFieldName,
); );
if (endField) return; if (!endField) return;
const startField = table.fields.find( const startField = table.fields.find(
(f) => f.name === startFieldName, (f) => f.name === startFieldName,

View File

@@ -4,10 +4,12 @@ import { dbToTypes } from "../../data/datatypes";
const affinity = { const affinity = {
[DB.ORACLESQL]: new Proxy( [DB.ORACLESQL]: new Proxy(
{ INT: "INTEGER" }, {
{ NUMERIC: "NUMBER" }, INT: "INTEGER",
{ DECIMAL: "NUMBER" }, NUMERIC: "NUMBER",
{ CHARACTER: "CHAR" }, DECIMAL: "NUMBER",
CHARACTER: "CHAR",
},
{ get: (target, prop) => (prop in target ? target[prop] : "BLOB") }, { get: (target, prop) => (prop in target ? target[prop] : "BLOB") },
), ),
[DB.GENERIC]: new Proxy( [DB.GENERIC]: new Proxy(
@@ -25,7 +27,6 @@ export function fromOracleSQL(ast, diagramDb = DB.GENERIC) {
const enums = []; const enums = [];
const parseSingleStatement = (e) => { const parseSingleStatement = (e) => {
console.log(e);
if (e.operation === "create") { if (e.operation === "create") {
if (e.object === "table") { if (e.object === "table") {
const table = {}; const table = {};

View File

@@ -13,7 +13,7 @@ const affinity = {
INTEGER: "INT", INTEGER: "INT",
MEDIUMINT: "INTEGER", MEDIUMINT: "INTEGER",
BIT: "BOOLEAN", BIT: "BOOLEAN",
"CHATACTER VARYING": "VARCHAR", "CHARACTER VARYING": "VARCHAR",
}, },
{ get: (target, prop) => (prop in target ? target[prop] : "BLOB") }, { get: (target, prop) => (prop in target ? target[prop] : "BLOB") },
), ),