Revision: 3318
Author: [email protected]
Date: Sun Feb 21 05:01:40 2010
Log: Necessary changes to the formatter for Liquibase output now that
Liquibase is not listed in the DDL Generator DropDown anymore
http://code.google.com/p/power-architect/source/detail?r=3318
Modified:
/trunk/src/ca/sqlpower/architect/swingui/CompareDMFormatter.java
=======================================
--- /trunk/src/ca/sqlpower/architect/swingui/CompareDMFormatter.java Wed
Feb 17 12:26:45 2010
+++ /trunk/src/ca/sqlpower/architect/swingui/CompareDMFormatter.java Sun
Feb 21 05:01:40 2010
@@ -33,10 +33,12 @@
import javax.swing.text.MutableAttributeSet;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.StyleConstants;
+import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import ca.sqlpower.architect.ddl.DDLGenerator;
+import ca.sqlpower.architect.ddl.LiquibaseDDLGenerator;
import ca.sqlpower.architect.diff.ArchitectDiffException;
import ca.sqlpower.architect.swingui.CompareDMPanel.SourceOrTargetStuff;
import
ca.sqlpower.architect.swingui.CompareDMSettings.SourceOrTargetSettings;
@@ -113,9 +115,11 @@
SQLSchema sch = (SQLSchema)
dmSetting.getSourceSettings().getSchemaObject();
gen.setTargetCatalog(cat == null ? null :
cat.getPhysicalName());
gen.setTargetSchema(sch == null ? null :
sch.getPhysicalName());
- }
-
- if
(dmSetting.getOutputFormat().equals(CompareDMSettings.OutputFormat.SQL)) {
+ } else if
(dmSetting.getOutputFormat().equals(CompareDMSettings.OutputFormat.LIQUIBASE))
{
+ gen = new LiquibaseDDLGenerator();
+ }
+
+ if (gen != null) {
List<DiffChunk<SQLObject>> addRelationships = new
ArrayList<DiffChunk<SQLObject>>();
List<DiffChunk<SQLObject>> dropRelationships = new
ArrayList<DiffChunk<SQLObject>>();
@@ -250,7 +254,7 @@
}
} else if (chunk.getType() == DiffType.SAME) {
//do nothing when they're the same
- } else {
+ } else {
throw new IllegalStateException("DiffChunk is an invalid
type.");
}
}