[Play-2.5 +] ApplicationEvolutions.runEvolutions should be protected rather than private

29 views
Skip to first unread message

Rajendra Prasad Gujja

unread,
Apr 12, 2017, 5:11:36 PM4/12/17
to Play framework dev
The evolutions and DBApi are so constrained with multi-tenant applications where "Database" and "EvolutionConfig" is dynamic. We use schema-per-tenant model, every tenant will have its own database and tenant can be created dynamically (from a Super Admin UI). 

At the start of the server, we would like to get all the tenants and apply evolutions onto all the tenants. Another complexity we have is, there is one single common database along with multiple tenant databases and there could be evolutions to that "common" db as well.

What we are doing currently is, we took an easy approach using "Evolutions.applyEvolutions" by providing custom "EvolutionsReader", but the limitation with this approach is we are missing all the configurable properties like "lock evolutions table" and "Don't apply Downs" etc. 

We are trying to override "ApplicationEvolutions" and pass our own "Database" to "runEvolutions", unfortunately it is not "overridable".

Anyone disagree with me or any other approach you suggest?

Thanks!


Will Sargent

unread,
Apr 13, 2017, 2:18:45 PM4/13/17
to Rajendra Prasad Gujja, Play framework dev
Evolutions has multiple issues, and doesn't deal well with complex situations like repeatable or conditional schema evolutions.  If you're planning on doing a schema per tenant and have multiple databases, I'd suggest using Flyways to do your evolutions in scope -- see this example:


--
Will Sargent
Engineer, Lightbend, Inc.


--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-dev+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages