Commit 83384d9b by Johannes Edmeier

Revisit liquibase and flyway legacy conversion

parent 393d3da5
......@@ -208,11 +208,14 @@ public class LegacyEndpointConverters {
@SuppressWarnings("unchecked")
private static Map<String, Object> convertLiquibase(List<Map<String, Object>> reports) {
return reports.stream()
.sequential()
.collect(toMap(r -> (String) r.get("name"), r -> singletonMap("changeSets",
LegacyEndpointConverters.convertLiquibaseChangesets(
(List<Map<String, Object>>) r.get("changeLogs")))));
Map<String, Object> liquibaseBeans = reports.stream()
.sequential()
.collect(toMap(r -> (String) r.get("name"),
r -> singletonMap("changeSets",
LegacyEndpointConverters.convertLiquibaseChangesets(
(List<Map<String, Object>>) r.get("changeLogs")))));
return singletonMap("contexts", singletonMap("application", singletonMap("liquibaseBeans", liquibaseBeans)));
}
private static List<Map<String, Object>> convertLiquibaseChangesets(List<Map<String, Object>> changeSets) {
......@@ -243,11 +246,13 @@ public class LegacyEndpointConverters {
@SuppressWarnings("unchecked")
private static Map<String, Object> convertFlyway(List<Map<String, Object>> reports) {
return reports.stream()
.sequential()
.collect(toMap(r -> (String) r.get("name"), r -> singletonMap("migrations",
LegacyEndpointConverters.convertFlywayMigrations(
(List<Map<String, Object>>) r.get("migrations")))));
Map<String, Object> flywayBeans = reports.stream()
.sequential()
.collect(toMap(r -> (String) r.get("name"),
r -> singletonMap("migrations",
LegacyEndpointConverters.convertFlywayMigrations(
(List<Map<String, Object>>) r.get("migrations")))));
return singletonMap("contexts", singletonMap("application", singletonMap("flywayBeans", flywayBeans)));
}
private static List<Map<String, Object>> convertFlywayMigrations(List<Map<String, Object>> migrations) {
......
{
"flyway": {
"migrations": [
{
"type": "SQL",
"checksum": 710039845,
"version": "1",
"description": "init",
"script": "V1__init.sql",
"state": "SUCCESS",
"installedOn": "2017-12-30T11:12:18.544+0000",
"executionTime": 10
"contexts": {
"application": {
"flywayBeans": {
"flyway": {
"migrations": [
{
"type": "SQL",
"checksum": 710039845,
"version": "1",
"description": "init",
"script": "V1__init.sql",
"state": "SUCCESS",
"installedOn": "2017-12-30T11:12:18.544+0000",
"executionTime": 10
}
]
},
"secondary": {
"migrations": [
{
"type": "SQL",
"checksum": 710039845,
"version": "1",
"description": "init",
"script": "V1__init.sql",
"state": "SUCCESS",
"installedOn": "2017-12-30T11:12:18.544+0000",
"executionTime": 10
}
]
}
}
]
},
"secondary": {
"migrations": [
{
"type": "SQL",
"checksum": 710039845,
"version": "1",
"description": "init",
"script": "V1__init.sql",
"state": "SUCCESS",
"installedOn": "2017-12-30T11:12:18.544+0000",
"executionTime": 10
}
]
}
}
}
\ No newline at end of file
}
{
"liquibase": {
"changeSets": [
{
"author": "marceloverdijk",
"changeLog": "classpath:/db/changelog/db.changelog-master.yaml",
"comments": "",
"contexts": [],
"dateExecuted": "2017-12-29T23:05:35.890+0000",
"deploymentId": "4588735849",
"description": "createTable tableName=person",
"execType": "EXECUTED",
"id": "1",
"labels": [],
"checksum": "7:b8f2ae9c88deabd32666dff9bc5d7f5d",
"orderExecuted": 1,
"tag": null
},
{
"author": "marceloverdijk",
"changeLog": "classpath:/db/changelog/db.changelog-master.yaml",
"comments": "",
"contexts": [
"dev",
"db2"
],
"dateExecuted": "2017-12-29T23:05:35.899+0000",
"deploymentId": "4588735849",
"description": "insert tableName=person",
"execType": "EXECUTED",
"id": "2",
"labels": [
"hard",
"core"
],
"checksum": "7:a8006415097ebb8b3334a23347847322",
"orderExecuted": 2,
"tag": null
"contexts": {
"application": {
"liquibaseBeans": {
"liquibase": {
"changeSets": [
{
"author": "marceloverdijk",
"changeLog": "classpath:/db/changelog/db.changelog-master.yaml",
"comments": "",
"contexts": [],
"dateExecuted": "2017-12-29T23:05:35.890+0000",
"deploymentId": "4588735849",
"description": "createTable tableName=person",
"execType": "EXECUTED",
"id": "1",
"labels": [],
"checksum": "7:b8f2ae9c88deabd32666dff9bc5d7f5d",
"orderExecuted": 1,
"tag": null
},
{
"author": "marceloverdijk",
"changeLog": "classpath:/db/changelog/db.changelog-master.yaml",
"comments": "",
"contexts": [
"dev",
"db2"
],
"dateExecuted": "2017-12-29T23:05:35.899+0000",
"deploymentId": "4588735849",
"description": "insert tableName=person",
"execType": "EXECUTED",
"id": "2",
"labels": [
"hard",
"core"
],
"checksum": "7:a8006415097ebb8b3334a23347847322",
"orderExecuted": 2,
"tag": null
}
]
},
"secondary": {
"changeSets": [
{
"author": "marceloverdijk",
"changeLog": "classpath:/db/changelog/db.changelog-master.yaml",
"comments": "",
"contexts": [],
"dateExecuted": "2017-12-29T23:05:35.890+0000",
"deploymentId": "4588735849",
"description": "createTable tableName=person",
"execType": "EXECUTED",
"id": "1",
"labels": [],
"checksum": "7:b8f2ae9c88deabd32666dff9bc5d7f5d",
"orderExecuted": 1,
"tag": null
}
]
}
}
]
},
"secondary": {
"changeSets": [
{
"author": "marceloverdijk",
"changeLog": "classpath:/db/changelog/db.changelog-master.yaml",
"comments": "",
"contexts": [],
"dateExecuted": "2017-12-29T23:05:35.890+0000",
"deploymentId": "4588735849",
"description": "createTable tableName=person",
"execType": "EXECUTED",
"id": "1",
"labels": [],
"checksum": "7:b8f2ae9c88deabd32666dff9bc5d7f5d",
"orderExecuted": 1,
"tag": null
}
]
}
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment