Skip to content

Add v9.sql migration: missing index on nostr_federations(federation_id) - #1

Draft
bansalayush247 with Copilot wants to merge 2 commits into
masterfrom
copilot/check-modifications-in-v9-sql
Draft

Add v9.sql migration: missing index on nostr_federations(federation_id)#1
bansalayush247 with Copilot wants to merge 2 commits into
masterfrom
copilot/check-modifications-in-v9-sql

Conversation

Copilot AI commented Mar 24, 2026

Copy link
Copy Markdown

v7.sql created the nostr_federations table but omitted the index on federation_id, which is used in group-by queries. No existing tables are modified.

Changes

  • fmo_server/schema/v9.sql — new migration that adds the missing index using CREATE INDEX IF NOT EXISTS wrapped in BEGIN/COMMIT
  • fmo_server/src/federation/observer.rs — registers v9 as a migration!() entry (not schema_setup!(), so it applies safely to existing populated databases)

Production safety

Operation Present
ALTER TABLE
DROP TABLE / COLUMN
UPDATE (data mutation)
Idempotent (IF NOT EXISTS)
Transactional (BEGIN/COMMIT)

The migration is fully additive and rolls back atomically on failure.


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

@changeset-bot

changeset-bot Bot commented Mar 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7a3d387

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Mar 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fedimint-observer Ready Ready Preview, Comment Mar 24, 2026 6:43am

Copilot AI changed the title [WIP] Check v9.sql for modifications affecting production Add v9.sql migration: missing index on nostr_federations(federation_id) Mar 24, 2026
Copilot AI requested a review from bansalayush247 March 24, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants