Migração de banco de dados (flywaydb) baseada em um arquivo sql compactado (.zip)
Permite compactar scripts extensos e a execução do mesmo pelo https://flywaydb.org.
Na configuração do flyway (https://flywaydb.org/documentation/maven/migrate), definir o resolver
resolvers = com.github.nidorx.migration.ZipSqlMigrationResolver
O resolver irá descompactar o script sql em um diretório temporário e executar esse arquivo na tarefa de migração.
Conforme imagem em anexo, existem diversos arquivos para execução, e alguns deles estão compactados (Base de dados CEP que descompactado tem aproximadamente 80MB).
2017-02-06 INFO org.flywaydb.core.internal.util.VersionPrinter info - Flyway 4.0.3 by Boxfuse
2017-02-06 INFO org.flywaydb.core.internal.dbsupport.DbSupportFactory info - Database: jdbc:postgresql://127.0.0.1:5432/******* (PostgreSQL 9.6)
2017-02-06 INFO org.flywaydb.core.internal.command.DbValidate info - Successfully validated 20 migrations (execution time 00:04.278s)
2017-02-06 INFO org.flywaydb.core.internal.command.DbSchemas info - Creating schema "*******" ...
2017-02-06 INFO org.flywaydb.core.internal.metadatatable.MetaDataTableImpl info - Creating Metadata table: "*******"."historico_migracao"
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Current version of schema "*******": 0
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.00 - Versao Inicial
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.01 - Dados CBO Grande Grupo
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.02 - Dados CBO SubGrupo Principal
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.03 - Dados CBO SubGrupo
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.04 - Dados CBO Familias
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.05 - Dados CBO Ocupacao
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.06 - Dados CBO Sinonimos
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.07 - Tabelas Endereco CEP
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.08 - Dados CEP uf e bairro
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.09 - Dados CEP localidade
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.10 - Dados CEP logradouro PARTE 1
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.11 - Dados CEP logradouro PARTE 2
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.12 - Dados CEP logradouro PARTE 3
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.13 - Dados CEP logradouro PARTE 4
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.14 - Dados CEP logradouro PARTE 5
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.15 - Dados CEP logradouro PARTE 6
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.16 - Dados CEP logradouro PARTE 7
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.17 - Dados CEP logradouro PARTE 8
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.18 - Dados CEP logradouro PARTE 9
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Migrating schema "*******" to version 0.0.1.19 - Dados CEP logradouro PARTE 10
2017-02-06 INFO org.flywaydb.core.internal.command.DbMigrate info - Successfully applied 20 migrations to schema "*******" (execution time 02:16.004s).