extract-mysql-schema 0.6.3 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +1 -1
- package/run.js +5 -3
package/index.js
CHANGED
|
@@ -207,7 +207,7 @@ const extractSchemas = async function (connection, options) {
|
|
|
207
207
|
if(column.generated==="STORED") def = `${column.expression} STORED`;
|
|
208
208
|
let notNull = column.isNullable?"NULL":"NOT NULL";
|
|
209
209
|
if(column.generated==="STORED") {
|
|
210
|
-
def = `(${column.expression}) STORED`;
|
|
210
|
+
def = ` AS (${column.expression}) STORED`;
|
|
211
211
|
notNull=""
|
|
212
212
|
}
|
|
213
213
|
definition.push(`${name}\t${column.sqltype}\t${column.isAutoNumber && column.isPrimaryKey ?" auto_increment":""}${def}\t${notNull}${column.isPrimaryKey && !column.isCompoundKey?" PRIMARY KEY":""}${extra}`);
|
package/package.json
CHANGED
package/run.js
CHANGED
|
@@ -88,6 +88,7 @@ async function main(options) {
|
|
|
88
88
|
let options = {
|
|
89
89
|
configFile:"",
|
|
90
90
|
outputFile:"",
|
|
91
|
+
debug:false,
|
|
91
92
|
columnISV:true,
|
|
92
93
|
tableISV:false,
|
|
93
94
|
procedureISV:false,
|
|
@@ -102,6 +103,7 @@ let argv = process.argv;
|
|
|
102
103
|
|
|
103
104
|
for(let i=2;i<argv.length;i++) {
|
|
104
105
|
if(argv[i]==="--columnISV") options.columnISV=true;
|
|
106
|
+
else if(argv[i]==="--debug") options.debug=true;
|
|
105
107
|
else if(argv[i]==="--tableISV") options.tableISV=true;
|
|
106
108
|
else if(argv[i]==="--procedureISV") options.procedureISV=true;
|
|
107
109
|
else if(argv[i]==="--writeSql") options.writeSql=true;
|
|
@@ -125,11 +127,11 @@ try {
|
|
|
125
127
|
main(options).then(()=>{
|
|
126
128
|
if(options.debug) console.log("DONE");
|
|
127
129
|
process.exit(0);
|
|
128
|
-
},()=>{
|
|
129
|
-
|
|
130
|
+
},(e)=>{
|
|
131
|
+
console.log("ERROR",e);
|
|
130
132
|
process.exit(1);
|
|
131
133
|
})
|
|
132
134
|
} catch (e) {
|
|
133
135
|
process.exit(1);
|
|
134
136
|
}
|
|
135
|
-
})();
|
|
137
|
+
})();
|