Conversation
🦋 Changeset detectedLatest commit: 63fa42a The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/blocks
@emdash-cms/cloudflare
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
There was a problem hiding this comment.
Pull request overview
This PR fixes the SchemaRegistry ↔ FTS5 lifecycle wiring so that FTS tables/triggers are created/rebuilt/disabled automatically when collections toggle "search" support and when searchable fields are added/removed/changed.
Changes:
- Add
SchemaRegistry.syncSearchState()and invoke it when collection"search"support is toggled and when searchable fields are created/updated/deleted. - Reorder searchable-field deletion to remove FTS trigger dependencies before dropping the content-table column.
- Add unit tests covering FTS table creation, rebuild, and disable scenarios.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
packages/core/src/schema/registry.ts |
Adds syncSearchState and calls it from collection/field lifecycle operations; reorders searchable-field deletion to avoid trigger/DDL conflicts. |
packages/core/tests/unit/schema/registry.test.ts |
Adds integration-style unit tests validating FTS table lifecycle behavior through SchemaRegistry operations. |
.changeset/polite-cameras-dance.md |
Publishes a patch changeset documenting the FTS lifecycle bug fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Opus review: To my knowledge, D1 doesn't support transactions. |
What does this PR do?
It fixes a bug where creating a searchable collection and a searchable field does not spin up FTS5 tables as expected. Now the lifecycle is wired correctly.
Type of change
Checklist
pnpm typecheckpassespnpm --silent lint:json | jq '.diagnostics | length'returns 0pnpm testpasses (or targeted tests for my change)pnpm formathas been runAI-generated code disclosure
Screenshots / test output