Skip to content

Clarify migration semantics and harden v9 additive-schema guardrails - #2

Draft
bansalayush247 with Copilot wants to merge 4 commits into
feature/gatewaysfrom
copilot/check-v9-sql-modifications
Draft

Clarify migration semantics and harden v9 additive-schema guardrails#2
bansalayush247 with Copilot wants to merge 4 commits into
feature/gatewaysfrom
copilot/check-v9-sql-modifications

Conversation

Copilot AI commented Mar 24, 2026

Copy link
Copy Markdown

The issue asked what migrations actually do in this repository and whether v9 is modifying existing schema vs creating new schema. This PR makes migration behavior explicit in docs and tightens the v9 migration assertions to reflect additive-only intent.

  • Migration behavior documentation

    • Added a focused README section describing startup migration flow:
      • version detection via schema_version
      • ordered transactional execution of newer migrations
      • optional Rust backfill execution before commit
    • Documented migration categories (schema_setup, migration, migration_backfill) and current mapping (v0-v6 setup-only, v7-v9 upgrade-capable).
  • v9 migration intent made explicit

    • Clarified that v9 is additive and limited to creating the gateways table + indexes (no alter/drop of existing tables).
  • v9 test strengthened

    • Updated v9_schema_is_additive_only to:
      • assert expected table/index creation statements
      • assert absence of destructive/shape-changing statements
      • use case-insensitive matching for resilience.
assert!(migration.contains("create table gateways"));
assert!(migration.contains("create index if not exists gateways_federation_id"));
assert!(migration.contains("create index if not exists gateways_node_pub_key"));
assert!(!migration.contains("alter table"));
assert!(!migration.contains("drop table"));

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

@changeset-bot

changeset-bot Bot commented Mar 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c60d04f

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 10:44am

Copilot AI changed the title [WIP] Check v9.sql for table modifications or new creations Make schema v9 explicitly additive and fail-fast on drift Mar 24, 2026
Copilot AI requested a review from bansalayush247 March 24, 2026 07:00
Co-authored-by: bansalayush247 <116891199+bansalayush247@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bansalayush247/fedimint-observer/sessions/bc082a67-d8ae-4d0f-bc30-17fdcc417538
Copilot AI changed the title Make schema v9 explicitly additive and fail-fast on drift Clarify migration semantics and harden v9 additive-schema guardrails Mar 24, 2026
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