younifyd
Menu

Schema Diff

Retrieve Schema Difference

POST/schema/diff

Use it in a workflow

  1. Add a step and choose the Directus connector.
  2. Pick the Schema Diff action (under Schema).
  3. Fill in the fields below, then reference the result from later steps as {{schemaDiff.response.data}}.

Request

Query parameters

forceboolean

Bypass version and database vendor restrictions.

modestring

`mirror` (default) returns all operations. `merge` returns an additive diff that excludes deletions.

One ofmergemirrorDefault "mirror"

Request body

Enter the body as JSON in the step's Body field.

versioninteger

`1` for a full snapshot, `2` for a partial snapshot.

One of12

directusstring
vendorstring
collectionsarray<object>
collectionstring

Name of the collection. This matches the table name in the database.

iconstring

Icon displayed in the Data Studio when working with this collection.

notestring

Short description displayed in the Data Studio.

display_templatestring

How items in this collection should be displayed when viewed relationally in the Data Studio.

hiddenboolean

Whether or not this collection is hidden in the Data Studio.

singletonboolean

Whether or not this collection is treated as a singleton.

translationsarray<any>

How this collection's name is displayed in the different languages in the Data Studio.

archive_fieldstring

What field in the collection holds the archived state.

archive_app_filterboolean
archive_valuestring

What value the archive field should be set to when archiving an item.

unarchive_valuestring

What value the archive field should be set to when unarchiving an item.

sort_fieldstring

What field holds the sort value on the collection. The Data Studio uses this to allow drag-and-drop manual sorting.

accountabilitystring

What data is tracked. One of `all`, `activity`.

item_duplication_fieldsarray<any>

What fields are duplicated during "Save as copy" action of an item in this collection.

sortinteger

What sort order of the collection relative to other collections of the same level.

groupstring

The name of the parent collection.

collapsestring

What is the default behavior of this collection or "folder" collection when it has nested collections. One of `open`, `closed`, `locked`.

versioningboolean

Whether or not Content Versioning is enabled for this collection.

fieldsarray<object>
idinteger
collectionstring

Unique name of the collection this field is in.

fieldstring

Unique name of the field. Field name is unique within the collection.

specialarray<string>

Any special transform flags that apply to this field.

interfacestring

The interface used for this field.

optionsobject

The interface options configured for this field. The structure is based on the interface used.

displaystring

The display used for this field.

display_optionsstring

The configured options for the used display.

readonlyboolean

If the field is considered readonly in the Data Studio.

hiddenboolean

If the field is hidden from the edit page in the Data Studio.

sortinteger

Where this field is shown on the edit page in the Data Studio.

widthstring

How wide the interface is rendered on the edit page in the Data Studio. One of `half`, `half-left`, `half-right`, `half-space`, `full`, `fill`.

translationsarray<any>

How this field's name is displayed in the different languages in the Data Studio.

notestring

Short description displayed in the Data Studio.

requiredboolean
groupinteger
validation_messagestring
systemFieldsarray<object>

Indexes defined on system fields.

collectionstring
fieldstring
schemaobject1 fields
relationsarray<object>
idinteger

Unique identifier for the relation.

many_collectionstring

Collection that has the field that holds the foreign key.

many_fieldstring

Foreign key. Field that holds the primary key of the related collection.

one_collectionstring

Collection on the _one_ side of the relationship.

one_fieldstring

Alias column that serves as the _one_ side of the relationship.

one_collection_fieldstring
one_allowed_collectionsarray<string>
junction_fieldstring

Field on the junction table that holds the many field of the related relation.

sort_fieldstring
one_deselect_actionstring
json
{
  "version": 1,
  "directus": "string",
  "vendor": "string",
  "collections": [
    {
      "collection": "customers",
      "icon": "string",
      "note": "string",
      "display_template": "string",
      "hidden": false,
      "singleton": false,
      "translations": [
        null
      ],
      "archive_field": "string",
      "archive_app_filter": false,
      "archive_value": "string",
      "unarchive_value": "string",
      "sort_field": "string"
    }
  ],
  "fields": [
    {
      "id": 0,
      "collection": "about_us",
      "field": "id",
      "special": [
        "string"
      ],
      "interface": "string",
      "options": {},
      "display": "string",
      "display_options": "string",
      "readonly": false,
      "hidden": false,
      "sort": 0,
      "width": "string"
    }
  ],
  "systemFields": [
    {
      "collection": "string",
      "field": "string",
      "schema": {
        "is_indexed": false
      }
    }
  ],
  "relations": [
    {
      "id": 1,
      "many_collection": "directus_activity",
      "many_field": "user",
      "one_collection": "directus_users",
      "one_field": null,
      "one_collection_field": "string",
      "one_allowed_collections": [
        "string"
      ],
      "junction_field": null,
      "sort_field": "string",
      "one_deselect_action": "string"
    }
  ]
}

Response

Returns 200 with an object. Read it in later steps with {{schemaDiff.response.data.<field>}}.

hashstring
diffobject
collectionsarray<object>2 fields
fieldsarray<object>3 fields
systemFieldsarray<object>3 fields
relationsarray<object>4 fields
json
{
  "hash": "string",
  "diff": {
    "collections": [
      {
        "collection": "string",
        "diff": [
          {}
        ]
      }
    ],
    "fields": [
      {
        "collection": "string",
        "field": "string",
        "diff": [
          {}
        ]
      }
    ],
    "systemFields": [
      {
        "collection": "string",
        "field": "string",
        "diff": [
          {}
        ]
      }
    ],
    "relations": [
      {
        "collection": "string",
        "field": "string",
        "related_collection": "string",
        "diff": [
          {}
        ]
      }
    ]
  }
}

Need more? See the Directus guide for connection setup and behaviour shared by every action.

Was this page helpful?