H2 Database – Alter multiple databases

alter-tableh2

I need to alter a table in H2 db. But we have millions of databases with the same same table. What may be the feasible way to alter such databases?

Best Answer

Database migration

Database migration or schema migration are the evolving terms for the process of managing and deploying changes to the structure of your database.

The idea is that you never make ad-hoc changes to your database. Instead, you make a disciplined practice of accumulating scripts (SQL, XML, etc.), and optionally executable code, to implement each stage of your database’s evolution: adding tables, adding columns, altering columns, etc.

Tools such as Flyway and Liquibase automate the process of managing and executing your collection of scripts and optional code. If you deploy such a tool along with your database or app, the tool can automatically detect which scripts and/or executables need to be run to update the currently-used database to the latest and greatest.