Provide DB upgrade featrue

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Provide DB upgrade featrue

Matt
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
Reply | Threaded
Open this post in threaded view
|

RE: Provide DB upgrade featrue

junoyoon
Administrator

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


If you reply to this email, your message will be added to the discussion below:
http://ngrinder.642.n7.nabble.com/Provide-DB-upgrade-featrue-tp16.html
To start a new topic under ngrinder_dev, email [hidden email]
To unsubscribe from ngrinder_dev, click here.
NAML