after using the Liquibase generator for a while, I'd like to enhance
it a bit.
Especially for DBMS that have non-transactional DDL (e.g. Oracle) it
is very useful to put every DDL statement into a separate "changeset"
in Liquibase (because it's easier to fix if something goes wrong which
cannot be rolled back).
Although that is the general recommendation from the Liquibase team,
I'd like to give the user the choice whether all statements should go
into a single changeset (as today) or if each DDL statement should be
enclosed into a separate changeset.
Currently the Compare Model dialog does not have a real concept of
selecting generator specific options (I could imagine generator
options for "pure" DDL as well)
Are there any plans to have unified options?
If yes, I'd simply adjust the Liquibase generator to emit a changeset
for each DDL (because that is the more general approach, and wouldn't
harm when used agains a DDL transaction capable DBMS) without an
option to choose this and wait for the "unified option" handling.
If there is no such, plan I'd simply add a new checkbox (similar to
"include indexes" or "Supress similarities") that would only be
enabled for Liquibase for the compare dialog and the "Forward
Engineer" dialog.
Any opinions?
Regards
Thomas
--
You received this message because you are subscribed to the Google Groups "Architect Developers" group.
To post to this group, send email to architect-...@googlegroups.com.
To unsubscribe from this group, send email to architect-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/architect-developers?hl=en.
Hi Jonathan,
I finally have the time to tackle this....
Currently I'm thinking of a generic approach along the following
lines:
change DDLGenerator interface to include a new method
setGeneratorOptions(Map<String, Object> options)
create an empty implementation in GenericDDLGenerator
define a base DDLGeneratorOptionsPanel that returns a Map<String,
Object>
and pass those options to the instance of DDLGenerator used in the
Diff and forward engineer dialogs
For the integration into the UI I'm thinking of a OptionsPanelFactory
that creates a DDLGeneratorOptionsPanel based on the generator
instance passed to it.
Does this sound OK for you?
Hi Jonathan,
Can you point me to an example in the code doing that?
> But we already have a pretty easy mechanism for persisting JavaBeans
> properties in the project file (the old-school Jakarta Digester--ancient but
> still quite effective).
Is that essentially what CompareDMSettings is about?
I'm not sure how those settings actually make it into the project
file, so if you can briefly outline how I can persist the Liquibase
options that would be nice.
> So I guess my suggestion would be to just code it "normally" (with BeansAfter starting with the DDLExportPanel I did feel the generic approach
> properties and custom-made DataEntryPanels). That will save you the time of
> building the framework, and (hopefully) give a higher-quality final result.
might actually be a bit of an overkill, so I implemented a regular
DataEntryPanel and pass it the instance of the generator. Once more
generators have options, this can be changed to an interface on the
panel (similar to DataEntryPanel), then it's not necessary to pass
Maps back and forth.
I'm currently struggling with getting my panel into the
CompareDMPanel. Mainly because I have no experience with the
FormLayout and hiding and showing the panel depending on the radio
button is a bit more complex there compared to the DDLExportPanel
Btw: I wonder if the "English Description" Checkbox would be the next
candidator for such an option panel...
As far as I can tell, I need to add this in two places:
> Right now, we only persist information about which type of DDL generator you
> last used, and what you typed in for Catalog and Schema name. We will
> probably want to enhance that by being able to remember separate preferences
> for each type of DDL generator. It's definitely doable. We're here to help!
- CompareDMSettings should have an instance of my LiqubaseSettings
- a "global" LiquibaseSettings that is used for forward engineering a
model.
For the latter I need to add this to ArchitectSwingSession if I'm not
mistaken. Would that be OK?
So in the config file, you'd get something like:
<ddl-generator type="ca.sqlpower.architect.ddl.PostgresDDLGenerator">
<property name="usingUnlimitedLengthVarchar">true</property>
<property name="usingQuotedIdentifiers">false</property>
</ddl-generator>
<ddl-generator type="ca.sqlpower.architect.ddl.SQLServerDDLGenerator">
<property name="usingQuotedIdentifiers">false</property>
</ddl-generator>
<ddl-generator type="ca.sqlpower.architect.ddl.LiquibaseDDLGenerator">
<property name="updateMode">INCREMENTAL</property>
</ddl-generator>