#25760·directus

v11.10.0 snapshot changes makes schema apply try to add an existing table/existing columns

Author: gla23Created Aug 27, 2025Updated Sep 23, 2026
LabelsBugRegressionData ModelingEngineMed ImpactMed Reach

Describe the Bug

v11.10.0 changed the way the schema snapshot and apply routes work. When I now apply a schema diff I get the following error:

Invalid payload. Collection \"profiles\" already exists.

Our workflow is the following:

  • Add a new table to our web app using our normal local dev flow (migrations etc)
  • Still locally, use the Directus UI to upgrade the table from DB only by adding the Diretus fields, relations, display templates and default layouts, ready for our support team to use the Directus magic.
  • Apply the same migrations to our shared dev env
  • Use the Directus schema apply functions to port all the Directus DB fields/changes into the dev env too so support functionality can be transfered and tested
  • Repeat for the live env

This workflow now breaks because the table "doesn't exist" on the target instance as no row exists in directus_collections. It tries to create the table even though we've taken care of that. I believe that when the diff below is applied it should instead check if the table actually exists on import and if so just sync all the directus_ collections rather than trying to create the table again.

{
  "collection": "profiles",
  "diff": [
    {
      "kind": "N",
      "rhs": {...}
    }
  ]
}

Previously the generated diff was as below, which makes sense both in terms of updating it from being a DB only table that was previously included in the snapshot, and in terms of why the code for "applying N type collections" and "applying N type fields" would never have had to check if the table exists.

{
  "collection": "profiles",
  "diff": [
    {
      "kind": "E",
      "path": [
        "meta"
      ],
      "lhs": null,
      "rhs": {...}
    }
  ],
}

As a workaround I tried simply adding a relevant row into directus_collections so that it would skip creating it and just sync. This revealed that the same issue is happening for new fields/columns. I did the same for a bunch of columns, but had issues with the relations. At that point I thought I'd just revert to the release before 11.10.0 and wait for the proper fix to upgrade any further.

To Reproduce

  • Add a new table to two instances of Directus from the DB
  • Upgrade it from DB only with some nice Directus magic
  • Use the snapshot and apply process to port this table

Directus Version

v11.0.3 (latest right now)

Hosting Strategy

Self-Hosted (Docker Image)

Database

PostgreSQL 16