extract-mysql-schema 0.7.2 → 0.7.4

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.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/package.json +1 -1
  3. package/run.js +3 -3
package/index.js CHANGED
@@ -53,7 +53,7 @@ const extractSchemas = async function (connection, options) {
53
53
  queryProcedures=queryProcedures[0];
54
54
 
55
55
  let queryParameters = await adapter.query(`
56
- SELECT p.* FROM INFORMATION_SCHEMA.PARAMETERS as p join INFORMATION_SCHEMA.ROUTINES as r on p.SPECIFIC_NAME=r.SPECIFIC_NAME
56
+ SELECT p.* FROM INFORMATION_SCHEMA.PARAMETERS as p join INFORMATION_SCHEMA.ROUTINES as r on p.SPECIFIC_NAME=r.SPECIFIC_NAME and p.SPECIFIC_SCHEMA=r.ROUTINE_SCHEMA
57
57
  WHERE ROUTINE_SCHEMA='${schemaName}'
58
58
  ORDER BY p.SPECIFIC_NAME,p.ORDINAL_POSITION
59
59
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "extract-mysql-schema",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": "./run.js",
package/run.js CHANGED
@@ -26,8 +26,8 @@ async function main(options) {
26
26
  }
27
27
  };
28
28
 
29
- tableContent.push(`USE ${config.connection.database};`);
30
29
  const tablesPath=path.join(process.cwd(),"tables");
30
+ tableContent.push(`USE ${config.connection.database};`);
31
31
  if(result[config.connection.database].tables.length>0) {
32
32
  // write table sql
33
33
  if (!fs.existsSync(tablesPath)){
@@ -49,7 +49,7 @@ async function main(options) {
49
49
  processFolder(tablesPath,tableContent); // add files not in the database
50
50
 
51
51
  const proceduresPath=path.join(process.cwd(),"procedures");
52
- proceduresPath.push(`USE ${config.connection.database};`);
52
+ sprocContent.push(`USE ${config.connection.database};`);
53
53
  if(result[config.connection.database].procedures.length>0) {
54
54
  // write routines
55
55
  if (!fs.existsSync(proceduresPath)){
@@ -66,7 +66,7 @@ async function main(options) {
66
66
  processFolder(proceduresPath,sprocContent); // add files not in the database
67
67
 
68
68
  const seedPath = path.join(process.cwd(),"seed");
69
- proceduresPath.push(`USE ${config.connection.database};`);
69
+ seedContent.push(`USE ${config.connection.database};`);
70
70
  if(fs.existsSync(seedPath)) {
71
71
  result[config.connection.database].tableOrder.forEach(table => {
72
72
  let seedfile = path.join(seedPath,table+'.sql');