# DEMOTE_PLUGIN_COLLECTION

`db:sync --demote` names a collection a plugin contributes, which stays the plugin's.

## Cause

`db:sync --demote` names a collection a plugin contributes, which stays the plugin's.

`nextly db:sync --demote <slug>` hands a collection the app's own `nextly.config.ts` defines to the Schema Builder. A plugin registers its collections again at every start, so a collection a plugin contributes is never handed over, even when the configuration or the Schema Builder also has one under the same slug.

## Fix

* Leave the collection to the plugin, and change it through that plugin's options.

## Example

```text
✗ Collection 'posts' is contributed by the plugin '@acme/forms', so it cannot be demoted.
  Why:  `--demote` hands a collection the app's own `nextly.config.ts` defines to the Schema Builder. A plugin registers its collections again at every start, so a plugin's collection stays the plugin's.
  Next: Leave 'posts' to '@acme/forms', and change it through that plugin's options.
  Docs: https://nextlyhq.com/docs/cli/errors/demote-plugin-collection  (DEMOTE_PLUGIN_COLLECTION)
```
