Back to Flyway

Diff Text

documentation/Reference/Commands/Diff Text.md

latest2.4 KB
Original Source

{% include enterprise.html %}

Description

The diffText commands prints out the object level differences from the differences generated by the diff command.

Usage examples

Selective changes

bash
flyway diff -source=dev -target=schemaModel
flyway diffText -changes="id1,id2"

Diff and diffText chained

bash
flyway diff -source=dev -target=schemaModel diffText

Parameters

Optional

ParameterNamespaceDescription
artifactFilenamediffTextThe path to the diff artifact.
changesdiffTextA comma separated list of change ids.

Universal commandline parameters are listed here.

JSON output format

json
{
  "differences" : [ {
    "id" : "MQuXdkRAEhEyd5TIPzVoCStUucA",
    "differenceType" : "Add",
    "objectType" : "Table",
    "from" : {
      "schema" : "Schema",
      "name" : "table2",
      "definition" : "CREATE TABLE Schema.table2 (\n    id int NULL,\n    name varchar(10) NULL\n);"
    },
    "to" : null
  }, {
    "id" : "exY9fOdORvbrXOYNPoqMmifWlEA",
    "differenceType" : "Add",
    "objectType" : "View",
    "from" : {
      "schema" : "Schema",
      "name" : "view1",
      "definition" : "CREATE VIEW Schema.view1 AS select `Schema`.`table1`.`id` AS `id`,`Schema`.`table1`.`name` AS `name` from `Schema`.`table1`;"
    },
    "to" : null
  }, {
    "id" : "K5GPl1kQtgirPltRFC265Oni42M",
    "differenceType" : "Delete",
    "objectType" : "Table",
    "from" : null,
    "to" : {
      "schema" : "Schema",
      "name" : "table3",
      "definition" : "CREATE TABLE Schema.table3 (\n    id int NULL,\n    name varchar(15) NULL\n);"
    }
  } ]
}

Error codes

This command can produce the following error codes: