Fix oracle export and default sizes (#386)

This commit is contained in:
1ilit 2025-04-02 20:49:30 +04:00 committed by GitHub
parent 16ea2ee23c
commit 5c1b2928d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 6 deletions

View File

@ -1856,7 +1856,7 @@ const oraclesqlTypesBase = {
hasCheck: true,
isSized: true,
hasPrecision: false,
defaultSize: 4000,
defaultSize: 255,
hasQuotes: true,
},
NVARCHAR2: {
@ -1870,7 +1870,7 @@ const oraclesqlTypesBase = {
hasCheck: true,
isSized: true,
hasPrecision: false,
defaultSize: 4000,
defaultSize: 255,
hasQuotes: true,
},
CHAR: {
@ -2008,7 +2008,7 @@ const oraclesqlTypesBase = {
hasCheck: false,
isSized: true,
hasPrecision: false,
defaultSize: 2000,
defaultSize: 255,
hasQuotes: false,
},
};

View File

@ -2,6 +2,7 @@ import { dbToTypes } from "../../data/datatypes";
import { parseDefault } from "./shared";
export function toOracleSQL(diagram) {
console.log(diagram);
return `${diagram.tables
.map(
(table) =>
@ -12,9 +13,11 @@ export function toOracleSQL(diagram) {
(field) =>
`${field.comment === "" ? "" : `\t-- ${field.comment}\n`}\t"${
field.name
}" ${field.type}${field.size && Boolean(field.size.trim()) ? "(" + field.size + ")" : ""}${
field.notNull ? " NOT NULL" : ""
}${
}" ${field.type}${
field.size !== undefined && field.size !== ""
? "(" + field.size + ")"
: ""
}${field.notNull ? " NOT NULL" : ""}${
field.increment ? " GENERATED ALWAYS AS IDENTITY" : ""
}${field.unique ? " UNIQUE" : ""}${
field.default !== ""