FR [ 1829798 ] Easy generation of migration scripts

Generate different names for different sessions
This commit is contained in:
Carlos Ruiz 2008-07-25 16:06:32 +00:00
parent 609c0e2023
commit 79d3469f72
1 changed files with 3 additions and 6 deletions

View File

@ -17,6 +17,7 @@
package org.compiere.dbPort;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.sql.Connection;
@ -422,9 +423,7 @@ public abstract class Convert
// migration_script_oracle.sql and migration_script_postgresql.sql
try {
if (tempFileOr == null) {
String fileNameOr = System.getProperty("java.io.tmpdir")
+ System.getProperty("file.separator")
+ "migration_script_oracle.sql";
File fileNameOr = File.createTempFile("migration_script_", "_oracle.sql");
tempFileOr = new FileOutputStream(fileNameOr, true);
osOr = new DataOutputStream(tempFileOr);
}
@ -440,9 +439,7 @@ public abstract class Convert
pgStatement = r[0];
}
if (tempFilePg == null) {
String fileNamePg = System.getProperty("java.io.tmpdir")
+ System.getProperty("file.separator")
+ "migration_script_postgresql.sql";
File fileNamePg = File.createTempFile("migration_script_", "_postgresql.sql");
tempFilePg = new FileOutputStream(fileNamePg, true);
osPg = new DataOutputStream(tempFilePg);
}