How to send database updates?

I have a Java (generic) application that uses a database through sleep mode. I send it through the bank to customers. What is the best way to deliver database updates (schema and data) to clients? Please note that clients may have a different version of my application, and the update should be automatic, without user support. And if the application is written with a grail?

+3
source share
4 answers

You can do this by tracking the current version of the schema (i.e. version number), and then having a patch file to bring the schema to the next version. You can continue to apply the fixes gradually until you reach the new version of prod / update.

eg. Let's say the client is in revision 5. Since then, you sent patches 10 and 12, but it is updated only to the latest version - 15.

You can do:

foreach rev in [clientRev ... currentRev]:
   apply rev.patch

So, you will apply the patch to bring to version 10; then another one to bring it to version 12; then another one to bring it to version 15;

If the other client is already in rev 12, he will only need to apply the last patch.

+3
source

@user779, - . Grails , : LiquiBase DbMigrate.

+2

Ruby Active Record Migrations, .

0

Java- , tapestry5-db-migrations ( tapestry5 ioc)

https://github.com/spreadthesource/tapestry5-db-migrations/

0

Source: https://habr.com/ru/post/1765859/


All Articles