Hello Karthik,

I don't think to enable flyway per default is a good idea.

It has been disabled to take away control of flyway when the migration is
happing(normally on startup of the service). Each service is tenant aware
and so is the migration logic. When a service starts up it does not create
any tables until its told by the provisioner to do so for a certain tenant.
Each tenant has its own database and therefore each database needs to
migrate their tables into that database.

Place where the migration is triggered(office only but it is the same for
any other service which needs db access):
https://github.com/apache/fineract-cn-office/blob/develop/service/src/main/java/org/apache/fineract/cn/office/internal/command/handler/MigrationAggregate.java

Datasource Flyway is using to decide which database to choose:
https://github.com/apache/fineract-cn-mariadb/blob/develop/src/main/java/org/apache/fineract/cn/mariadb/domain/ContextAwareRoutingDataSource.java


Mark

On Fri, Jan 18, 2019 at 12:21 AM Isaac Kamga <[email protected]> wrote:

> Hello Karthik,
>
> Thanks for that observation.
>
> The link you shared doesn't seem to work...anyway the flyway setting can be
> viewed in
>
> https://github.com/apache/fineract-cn-customer/blob/develop/service/src/main/resources/application.yml
> for customer and is similar for other services.
>
> Next steps could be to ;
> 1. Enable flyway throughout these repositories and
> 2. Either a ) Write a wiki on how to manually create servers from scratch
> to create baseline tables OR
>               b) Write code which does that automatically.
>
> What do you think?
>
> Cheers,
> Isaac Kamga.
>
> On Thu, Jan 17, 2019 at 8:19 AM Karthik Ananthakrishnan
> <[email protected]> wrote:
>
> > Hello all,
> >
> > Currently flyway is by default disabled in Fineract CN. So, additional
> > script will not get executed and we need to clean DB and run the server
> > with provisioner true.
> >
> > To enable flyway,
> > Open application.yml in service/src/main/resources/application.yml
> > <
> >
> https://github.com/OakNorthAI/fineract-cn-office/pull/6/files#diff-cd5a6dcc05a167315084bee31280665a
> > >
> > in
> > all repos and change flyway enabled to true.
> >
> > After this change, we need to create run the server from scratch so that
> > flyway baseline tables are created and populated.
> >
> > Regards,
> > Karthik
> >
>
-- 

*Mark van Veen*
Solutions Architect
Kuelap GmbH | Pappelallee 78/79 | 10437 Berlin | Germany
<https://maps.google.com/?q=Pappelallee+78/79+%7C+10437+Berlin+%7C+Germany&entry=gmail&source=g>

[email protected] | https://kuelap.io <http://kuelap.io/>



Geschäftsführer: Markus Geiss | Registergericht: Amtsgericht Charlottenburg
(Berlin) | HBR 201125 B



Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der genannte Adressat sind oder diese E-Mail
irrtümlich empfangen haben, informieren Sie bitte sofort den Absender und
löschen Sie diese Nachricht. Das unautorisierte Kopieren sowie die
unbefugte Weitergabe dieser E-Mail sind nicht gestattet.

Reply via email to