From 81d5992bb188301629d920eb38d2af0d4beee63a Mon Sep 17 00:00:00 2001 From: Hayt <9e1c23a3fd83f61da34420e4e88ff1b16e45cafcc0cd9019eb07d4ecfa8ca9b0@buzz.block.builderlab.xyz> Date: Fri, 28 Aug 2026 18:09:54 -0400 Subject: [PATCH] =?UTF-8?q?chore(buzz-db):=20renumber=20NIP-FI=20migration?= =?UTF-8?q?s=200040/0041=20=E2=86=92=200041/0042?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit main landed 0040_push_message_kinds.sql (#6269) which collides with the previous NIP-FI numbering. Renumber: 0040_nip_fi_identity_foundation.sql → 0041 0041_nip_fi_authorization_foundation.sql → 0042 Update all test references, run_to() calls, and schema.sql comments to match. The push_match_trigger test (migrations[39].version == 40) is unchanged — it covers the push-notification migration at 0040, not NIP-FI. Signed-off-by: Will Pfleger Signed-off-by: Hayt <9e1c23a3fd83f61da34420e4e88ff1b16e45cafcc0cd9019eb07d4ecfa8ca9b0@buzz.block.builderlab.xyz> --- crates/buzz-db/src/runtime/migration.rs | 8 ++++---- migrations/0042_nip_fi_authorization_foundation.sql | 4 ++-- schema/schema.sql | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/buzz-db/src/runtime/migration.rs b/crates/buzz-db/src/runtime/migration.rs index 77afeb5754..10f66bfb22 100644 --- a/crates/buzz-db/src/runtime/migration.rs +++ b/crates/buzz-db/src/runtime/migration.rs @@ -2852,9 +2852,9 @@ mod tests { let pool = connect_test_pool().await; reset_public_schema(&pool).await; MIGRATOR - .run_to(41, &pool) + .run_to(42, &pool) .await - .expect("apply migrations 1-41"); + .expect("apply migrations 1-42"); let community_id = uuid::Uuid::new_v4(); sqlx::query("INSERT INTO communities (id, host) VALUES ($1, $2)") @@ -2984,9 +2984,9 @@ mod tests { let pool = connect_test_pool().await; reset_public_schema(&pool).await; MIGRATOR - .run_to(40, &pool) + .run_to(41, &pool) .await - .expect("apply migrations 1-40"); + .expect("apply migrations 1-41"); let community_id = uuid::Uuid::new_v4(); sqlx::query("INSERT INTO communities (id, host) VALUES ($1, $2)") diff --git a/migrations/0042_nip_fi_authorization_foundation.sql b/migrations/0042_nip_fi_authorization_foundation.sql index 586b34d9e9..633d115070 100644 --- a/migrations/0042_nip_fi_authorization_foundation.sql +++ b/migrations/0042_nip_fi_authorization_foundation.sql @@ -4,7 +4,7 @@ -- audio admission ledger, 30382 projection, delivery queue, exporter claim, -- acknowledgement, retry scheduler, or online retention/compaction workflow. -- --- This migration applies to migration 0040's resulting state. Its scope is the +-- This migration applies to migration 0041's resulting state. Its scope is the -- NIP-FI *final-admission* surface: replay/receipt, audit events, invalidation, -- capacity, protected-object authority, restore version deltas, and the closed -- admission result. Closed vocabularies below carry only the core subset; @@ -716,7 +716,7 @@ CREATE CONSTRAINT TRIGGER authorization_event_receipt_cardinality DEFERRABLE INITIALLY DEFERRED FOR EACH ROW EXECUTE FUNCTION authorization_operation_receipt_event_guard_v1(); --- Same ledger posture as migration 0040's identity relations: the admission, +-- Same ledger posture as migration 0041's identity relations: the admission, -- replay, audit, and invalidation relations below are append-only denial and -- authority facts protected by immutable no_delete/no_truncate triggers, so -- they carry community_id as provenance rather than deletable ownership. Widen diff --git a/schema/schema.sql b/schema/schema.sql index c6c5c4edb8..537ea283e4 100644 --- a/schema/schema.sql +++ b/schema/schema.sql @@ -1904,7 +1904,7 @@ INSERT INTO _operator_global_tables (table_name, reason) VALUES -- ============================================================================ --- NIP-FI core identity + base-lifecycle foundation (mirror of migration 0040). +-- NIP-FI core identity + base-lifecycle foundation (mirror of migration 0041). -- The community_write_fence_excluded_table definition above already folds in -- the NIP-FI ledger relations; the per-migration CREATE OR REPLACE bodies are -- intentionally omitted here (desired state keeps one consolidated definition). @@ -2751,7 +2751,7 @@ CREATE TRIGGER identity_lifecycle_selectors_no_truncate -- ============================================================================ --- NIP-FI final-admission foundation (mirror of migration 0041). +-- NIP-FI final-admission foundation (mirror of migration 0042). -- ============================================================================ CREATE TABLE authorization_invalidation_domains ( @@ -2906,7 +2906,7 @@ CREATE TABLE authorization_event_capacity ( -- 10 protected allowed, 11 protected denied, 14 invalidation advanced. -- The extended-lifecycle audit kinds (4 recovered, 5 principal enabled, -- 7 principal disabled, 8 admission lost) are deferred to the FI-LIFECYCLE --- migration, matching 0040's core lifecycle carve. Kinds 12 and 13 are +-- migration, matching 0041's core lifecycle carve. Kinds 12 and 13 are -- retired: kind 24244 publication/withdrawal is ephemeral connection state and -- never a durable authorization event. CREATE TABLE authorization_events (