You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Dan Haywood (JIRA)" <ji...@apache.org> on 2016/07/19 11:25:20 UTC

[jira] [Comment Edited] (ISIS-1471) Integrate Flyway or Liquibase or something similar

    [ https://issues.apache.org/jira/browse/ISIS-1471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15383976#comment-15383976 ] 

Dan Haywood edited comment on ISIS-1471 at 7/19/16 11:25 AM:
-------------------------------------------------------------

Jeroen wrote:

Hi Oscar,

We're dropping the constraints because it makes it easier to handle migrations and were then 100% sure that no retired constraint stays behind. I've not seen the error that you are referring to. We're also running some other Apache Isis applications on PostgreSQL so it might be something else that is causing your issue.

Cheers,

Jeroen 



was (Author: danhaywood):
Jeroen:

Hi Oscar,

We're dropping the constraints because it makes it easier to handle migrations and were then 100% sure that no retired constraint stays behind. I've not seen the error that you are referring to. We're also running some other Apache Isis applications on PostgreSQL so it might be something else that is causing your issue.

Cheers,

Jeroen 


> Integrate Flyway or Liquibase or something similar
> --------------------------------------------------
>
>                 Key: ISIS-1471
>                 URL: https://issues.apache.org/jira/browse/ISIS-1471
>             Project: Isis
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 1.13.0
>            Reporter: Dan Haywood
>            Assignee: Dan Haywood
>             Fix For: 1.14.0
>
>
> from Kambiz:
> Hi,
> in our non-Isis projects, we use FlyWay [1] for DB migrations and I
> would like to integrate it into our Isis workflow. The simplest path to
> do so would be a DomainService with a PostConstruct annotated init
> method:
> @PostConstruct
> public void init(final Map<String, String> properties) {
>     Flyway flyway = new Flyway();
>     // Point it to the database
>     String jdbcUrl = properties.get("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL");
>     String user = properties.get("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName");
>     String password = properties.get("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword");
>     flyway.setDataSource(jdbcUrl, user, password);
>     flyway.setLocations("classpath:db/migrations");
>     // Start the migration
>     flyway.migrate();
> }
> but this isn't a viable solution, as IsisSessionFactoryBuilder's
> buildSessionFactory() method initialises the DataNucleus (DN)
> PersistenceSessionFactory before the services are constructed [2].
> So DN has already found the mismatch between the JDO annotations and the
> database before we enter the init method of our DB migration
> bootstrap/seed service.
> I could contribute a patch, if someone could hint on the preferred way
> of implementing the functionality.
> Thank you
> Kambiz
> [1] https://flywaydb.org/
> [2] https://github.com/apache/isis/blob/master/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java#L184



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)