Subchapter 1.125
references/data-collection/LIFECYCLE.mdMarkdown4 KBView on GitHub
Declaring a collection is not the same as creating one. Releasing, updating the site, the CMS prerequisite, and what access the extension actually grants.
The data-collections extension gives your app read/write access to the items in its own
collections — items.query/insert/update work with no extra scope. It does not grant the
collection-management API: collections.listDataCollections() and friends answer 403 unless the
app holds a Data Collections management scope.
That asymmetry is worth knowing before you debug: a page whose table loads rows has proved its collection exists, because Wix Data errors on a missing collection rather than returning empty. If that same page cannot list collections, the app is missing a management scope — a separate fact about tooling, not evidence about the collection.
A page over a CMS collection uses the package’s CMS Collection and Entity Template, not the
hand-wired one — the CMS already owns the field list, so useCmsSchemaSource supplies fetch,
filters, columns and the entity form from it. See
DRAFT_TEMPLATE.md. Wiring
items.query() and hand-written columns by hand still compiles, and quietly gives up everything the
schema would have provided.
The installing site needs the CMS (Content Manager) app. Per the extension’s own docs: “Without it, collections added by the extension won’t appear after installation.” Nothing warns you — the release succeeds, the update succeeds, and the collection silently never exists. Bundle CMS as an app dependency (opens in a new tab) so installing your app brings it, and list “add CMS to the site” under Manual Steps Required for any site that may not have it.
This is the first thing to check when a collection is missing after a correct release and update.
Scaffolding the extension, compiling, and even releasing all leave the site’s CMS unchanged.
A collection appears only when the app is installed or updated on the site with a version that
contains the extension — and any change under data-collections/ needs a major version:
npx wix release --version-type major -c "<what changed>"Releasing is only half of it. Report both remaining browser steps under Manual Steps Required — they are the difference between a page that works and one that shows an empty table:
A dev server running a version override does not create collections either, so “I ran wix dev and
the collection isn’t in the CMS” is this step, not a bug.
Changes to your data collections extension require releasing a new major version of your app. When a user updates to the new major version, their collections are updated as follows:
Important notes:
initialData is ignored during updates.