mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-05-24 10:29:11 +00:00
Fix oracle export and default sizes (#386)
This commit is contained in:
parent
16ea2ee23c
commit
5c1b2928d1
@ -1856,7 +1856,7 @@ const oraclesqlTypesBase = {
|
|||||||
hasCheck: true,
|
hasCheck: true,
|
||||||
isSized: true,
|
isSized: true,
|
||||||
hasPrecision: false,
|
hasPrecision: false,
|
||||||
defaultSize: 4000,
|
defaultSize: 255,
|
||||||
hasQuotes: true,
|
hasQuotes: true,
|
||||||
},
|
},
|
||||||
NVARCHAR2: {
|
NVARCHAR2: {
|
||||||
@ -1870,7 +1870,7 @@ const oraclesqlTypesBase = {
|
|||||||
hasCheck: true,
|
hasCheck: true,
|
||||||
isSized: true,
|
isSized: true,
|
||||||
hasPrecision: false,
|
hasPrecision: false,
|
||||||
defaultSize: 4000,
|
defaultSize: 255,
|
||||||
hasQuotes: true,
|
hasQuotes: true,
|
||||||
},
|
},
|
||||||
CHAR: {
|
CHAR: {
|
||||||
@ -2008,7 +2008,7 @@ const oraclesqlTypesBase = {
|
|||||||
hasCheck: false,
|
hasCheck: false,
|
||||||
isSized: true,
|
isSized: true,
|
||||||
hasPrecision: false,
|
hasPrecision: false,
|
||||||
defaultSize: 2000,
|
defaultSize: 255,
|
||||||
hasQuotes: false,
|
hasQuotes: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -2,6 +2,7 @@ import { dbToTypes } from "../../data/datatypes";
|
|||||||
import { parseDefault } from "./shared";
|
import { parseDefault } from "./shared";
|
||||||
|
|
||||||
export function toOracleSQL(diagram) {
|
export function toOracleSQL(diagram) {
|
||||||
|
console.log(diagram);
|
||||||
return `${diagram.tables
|
return `${diagram.tables
|
||||||
.map(
|
.map(
|
||||||
(table) =>
|
(table) =>
|
||||||
@ -12,9 +13,11 @@ export function toOracleSQL(diagram) {
|
|||||||
(field) =>
|
(field) =>
|
||||||
`${field.comment === "" ? "" : `\t-- ${field.comment}\n`}\t"${
|
`${field.comment === "" ? "" : `\t-- ${field.comment}\n`}\t"${
|
||||||
field.name
|
field.name
|
||||||
}" ${field.type}${field.size && Boolean(field.size.trim()) ? "(" + field.size + ")" : ""}${
|
}" ${field.type}${
|
||||||
field.notNull ? " NOT NULL" : ""
|
field.size !== undefined && field.size !== ""
|
||||||
}${
|
? "(" + field.size + ")"
|
||||||
|
: ""
|
||||||
|
}${field.notNull ? " NOT NULL" : ""}${
|
||||||
field.increment ? " GENERATED ALWAYS AS IDENTITY" : ""
|
field.increment ? " GENERATED ALWAYS AS IDENTITY" : ""
|
||||||
}${field.unique ? " UNIQUE" : ""}${
|
}${field.unique ? " UNIQUE" : ""}${
|
||||||
field.default !== ""
|
field.default !== ""
|
||||||
|
Loading…
Reference in New Issue
Block a user