I\'m trying to use Flyway to version the database of a modular application. Each module has its own separate set of tables, and migration scripts that will control the versi
An ideal solution for you would be to split your modules into schemas. This gives you an effective unit of isolation per module and is also a natural fit for modular applications (modules completely isolated and self managing), rather than dumping everything into a single schema (especially public). eg
application_database
├── public
├── module_1
│ ├── schema_version
│ ├── m1_t1
│ └── m1_t2
├── module_2
│ ├── schema_version
│ ├── m2_t1
│ └── m2_t2
...
Your second option is to remain using the public schema to host all tables, but use an individual schema for each schema_version
. This is less refactoring effort but certainly a less elegant design than that mentioned above. eg
application_database
├── public
│ ├── m1_t1
│ ├── m1_t2
│ ├── m2_t1
│ └── m2_t2
├── module_1
│ └── schema_version
│
├── module_2
│ └── schema_version
...