Skip to content

fix: adds optimize indexes (33) to migration runner#330

Merged
MattieTK merged 3 commits intomainfrom
fix/optimize-indexes-in-runner
Apr 7, 2026
Merged

fix: adds optimize indexes (33) to migration runner#330
MattieTK merged 3 commits intomainfrom
fix/optimize-indexes-in-runner

Conversation

@MattieTK
Copy link
Copy Markdown
Collaborator

@MattieTK MattieTK commented Apr 6, 2026

What does this PR do?

Registers migration 033_optimize_content_indexes in the static migration runner so it actually executes on startup.

The migration itself was already written but had been omitted from runner.ts, meaning the composite indexes and partial indexes it defines were never applied. This adds the static import and registers it in getMigrations().

Type of change

  • Bug fix
  • Feature (requires approved Discussion)
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm --silent lint:json | jq '.diagnostics | length' returns 0
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion: https://github.com/emdash-cms/emdash/discussions/...

AI-generated code disclosure

  • This PR includes AI-generated code

Copilot AI review requested due to automatic review settings April 6, 2026 21:40
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 6, 2026

🦋 Changeset detected

Latest commit: d4fd34e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/plugin-ai-moderation Patch
@emdash-cms/plugin-atproto Patch
@emdash-cms/plugin-audit-log Patch
@emdash-cms/plugin-color Patch
@emdash-cms/plugin-embeds Patch
@emdash-cms/plugin-forms Patch
@emdash-cms/plugin-webhook-notifier Patch

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

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 6, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-playground d4fd34e Apr 07 2026, 09:53 AM

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Registers the existing 033_optimize_content_indexes database migration in the static migration runner so it actually runs on startup and applies the intended composite/partial index optimizations.

Changes:

  • Statically imports 033_optimize_content_indexes and adds it to StaticMigrationProvider.getMigrations().
  • Adds a changeset to ship the fix as a patch release of emdash.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/core/src/database/migrations/runner.ts Adds migration 033 import and registration so it is executed by the Kysely migrator.
.changeset/fix-migration-033-runner-registration.md Documents the patch release for registering migration 033.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 6, 2026

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@330

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@330

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@330

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@330

emdash

npm i https://pkg.pr.new/emdash@330

create-emdash

npm i https://pkg.pr.new/create-emdash@330

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@330

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@330

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@330

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@330

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@330

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@330

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@330

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@330

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@330

commit: d4fd34e

@MattieTK MattieTK force-pushed the fix/optimize-indexes-in-runner branch from 2b2831a to 4ba5016 Compare April 6, 2026 21:47
@ascorbic
Copy link
Copy Markdown
Collaborator

ascorbic commented Apr 7, 2026

You'll need to update migrations.test.ts, which hs an expected number of migrations

@github-actions github-actions bot added size/S and removed size/XS labels Apr 7, 2026
@MattieTK
Copy link
Copy Markdown
Collaborator Author

MattieTK commented Apr 7, 2026

Fixed and also added #347 as optional that would make maintaining this number easier in the future

@MattieTK MattieTK merged commit 5b3e33c into main Apr 7, 2026
42 of 43 checks passed
@MattieTK MattieTK deleted the fix/optimize-indexes-in-runner branch April 7, 2026 10:52
@emdashbot emdashbot bot mentioned this pull request Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants