File tree 2 files changed +9
-6
lines changed
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -1856,7 +1856,7 @@ const oraclesqlTypesBase = {
1856
1856
hasCheck : true ,
1857
1857
isSized : true ,
1858
1858
hasPrecision : false ,
1859
- defaultSize : 4000 ,
1859
+ defaultSize : 255 ,
1860
1860
hasQuotes : true ,
1861
1861
} ,
1862
1862
NVARCHAR2 : {
@@ -1870,7 +1870,7 @@ const oraclesqlTypesBase = {
1870
1870
hasCheck : true ,
1871
1871
isSized : true ,
1872
1872
hasPrecision : false ,
1873
- defaultSize : 4000 ,
1873
+ defaultSize : 255 ,
1874
1874
hasQuotes : true ,
1875
1875
} ,
1876
1876
CHAR : {
@@ -2008,7 +2008,7 @@ const oraclesqlTypesBase = {
2008
2008
hasCheck : false ,
2009
2009
isSized : true ,
2010
2010
hasPrecision : false ,
2011
- defaultSize : 2000 ,
2011
+ defaultSize : 255 ,
2012
2012
hasQuotes : false ,
2013
2013
} ,
2014
2014
} ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { dbToTypes } from "../../data/datatypes";
2
2
import { parseDefault } from "./shared" ;
3
3
4
4
export function toOracleSQL ( diagram ) {
5
+ console . log ( diagram ) ;
5
6
return `${ diagram . tables
6
7
. map (
7
8
( table ) =>
@@ -12,9 +13,11 @@ export function toOracleSQL(diagram) {
12
13
( field ) =>
13
14
`${ field . comment === "" ? "" : `\t-- ${ field . comment } \n` } \t"${
14
15
field . name
15
- } " ${ field . type } ${ field . size && Boolean ( field . size . trim ( ) ) ? "(" + field . size + ")" : "" } ${
16
- field . notNull ? " NOT NULL" : ""
17
- } ${
16
+ } " ${ field . type } ${
17
+ field . size !== undefined && field . size !== ""
18
+ ? "(" + field . size + ")"
19
+ : ""
20
+ } ${ field . notNull ? " NOT NULL" : "" } ${
18
21
field . increment ? " GENERATED ALWAYS AS IDENTITY" : ""
19
22
} ${ field . unique ? " UNIQUE" : "" } ${
20
23
field . default !== ""
You can’t perform that action at this time.
0 commit comments