chore(db): squash migrations into a single baseline - #1543
Merged
Merged
Conversation
MCP clients now authenticate with OAuth access tokens only. - Backend: drop the iw_proj_ key auth path, the X-API-Key header, the legacy MCP context type, the /api/v1/mcp-keys routes and service, the LEGACY_MCP_ENABLED setting and the legacyMcpEnabled feature flag. The permission constants move to mcp/mcp-permissions.ts. Migration 0039 drops the mcp_access_keys table. - MCP tools no longer accept 'xml' as an alias for 'prosemirror_xml'. - Frontend: remove the legacy key section in project settings, the create key dialog, the admin toggle and their translations; regenerate the API client. - E2E: the MCP suite authorizes through the OAuth flow (viewer grant for the read-only test); the legacy key spec is gone. - Docs: drop the legacy API key instructions.
Replace the 39 incremental Drizzle migrations with one baseline generated from src/db/schema. Its statements use IF NOT EXISTS, so the preview D1 (built by the old migrations) records it as a no-op on the next deploy and fresh databases get the full schema. - Add the indexes that only existed in hand-written migrations to the schema (passkey_recovery_tokens token_hash/user_id, project_slug_aliases user_id, published_files plan_id) so the baseline keeps them. - Drop the length on auto_review_rejections.document_id so the column matches the existing TEXT column. - Remove applySchemaPatches, which re-added migration columns at startup, and the two migration-upgrade tests. - Point docs and the wrangler example at 'd1 migrations apply'.
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository: bobbyquantum/inkweld/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…egacy-mcp-keys # Conflicts: # backend/src/routes/mcp-keys.routes.ts
…squash-migrations
Base automatically changed from
bobbyquantum/remove-legacy-mcp-keys
to
main
September 29, 2026 23:50
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Stacked on #1542. Merge that first; this PR targets its branch. It replaces the 39 incremental Drizzle migrations with a single
0000_baseline.sqlgenerated fromsrc/db/schema/.Why it's safe for the preview deployment
Merging to
mainrunsd1 migrations apply inkweld_preview. Preview was built by the old migrations and keeps its data, so the baseline usesCREATE TABLE/INDEX IF NOT EXISTSthroughout. D1 sees a new file name, runs it as a no-op, and records it. No manuald1_migrationssurgery is needed.Verified against the live preview schema (read-only
sqlite_masterdump):user_passkeys.backed_up DEFAULT falsevs0, which SQLite stores identically.Changes
passkey_recovery_tokens:token_hashunique index anduser_idindexproject_slug_aliases:user_idindexpublished_files:plan_idindexauto_review_rejections.document_idloses itslength: 500(SQLite ignores it) so it matches the existing column.applySchemaPatches(startupALTER TABLEs for columns from 0026/0030/0031) is removed, along with the two*-migration-upgradetests.wrangler.toml.examplepoint atd1 migrations applyinstead of a specific SQL file. AGENTS.md explains the baseline.Testing
bun test: 1,748 pass.