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,
|
||||
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,
|
||||
},
|
||||
};
|
||||
|
@ -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 !== ""
|
||||
|
Loading…
Reference in New Issue
Block a user