It's quite acceptable except follows. Please go on.
- Instead of nGrinderLiquibaseUpdater, I think DatabaseUpdater is a better name.
- You'd better to use @DependsOn annotation to control the execution
* You can provide @DependsOn("dataSource") on DatabaseUpdater and provide followings on DatabseConfig to control execution order.
class DataBaseConfig {
@Bean(name = "emf")
@DependsOn("databaseUpdater")
public LocalContainerEntityManagerFactoryBean emf() {
}
}
Regards.
-----Original Message-----
From: "Matt [via ngrinder]"<[hidden email]>
To: "junoyoon"<[hidden email]>;
Cc:
Sent: 2012-10-09 (화) 10:45:32
Subject: Provide DB upgrade featrue
This is my idea for adding liquibase into nGrinder at ngrinder_dev
Create nGrinderLiquibaseUpdater.class
it is implement org.springframework.context.ResourceLoaderAware
its method afterPropertiesSet() will be invoked after nGrinder has set all bean properties. Liquibase will be initialized and will execute its update() method to change DB.
Create datachange log file under folder name is "ngrinder_datachange_logfile".
this log file has saved change items about DB when new nGrinder version published.
Each <changeSet> has its id and author,i think author maybe uses ngrinder version as value.
Liguibase will scan every <changeSet> and then check its log table "TableBaseChangeLog" to verify this <changeSet> whether has existed in this table,otherwise add new item in table "TableBaseChangeLog" and apply its changes into DB.
Above this is fundamental functions about Liquibase
|