In order to make the migration scripts littler in size - just write the comment one time or when changed

This commit is contained in:
Carlos Ruiz 2013-11-07 17:03:39 -05:00
parent f9007d168c
commit 5447f06c0f
1 changed files with 10 additions and 4 deletions

View File

@ -566,6 +566,8 @@ public abstract class Convert
return false; return false;
} }
private static String m_oldprm_COMMENT = "";
private static void writeLogMigrationScript(Writer w, String statement) throws IOException private static void writeLogMigrationScript(Writer w, String statement) throws IOException
{ {
boolean isUseCentralizedID = "Y".equals(MSysConfig.getValue(MSysConfig.DICTIONARY_ID_USE_CENTRALIZED_ID, "Y")); // defaults to Y boolean isUseCentralizedID = "Y".equals(MSysConfig.getValue(MSysConfig.DICTIONARY_ID_USE_CENTRALIZED_ID, "Y")); // defaults to Y
@ -581,10 +583,14 @@ public abstract class Convert
w.append("-- "); w.append("-- ");
w.append(dateTimeText); w.append(dateTimeText);
w.append("\n"); w.append("\n");
if (prm_COMMENT != null && ! m_oldprm_COMMENT.equals(prm_COMMENT)) {
// log sysconfig comment // log sysconfig comment
w.append("-- "); w.append("-- ");
w.append(prm_COMMENT); w.append(prm_COMMENT);
w.append("\n"); w.append("\n");
if (w == writerPg)
m_oldprm_COMMENT = prm_COMMENT;
}
// log statement // log statement
w.append(statement); w.append(statement);
// close statement // close statement