MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / test_migrate_from_v3

Function test_migrate_from_v3

tests/storage_suite/migration_test.rs:650–674  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

648/// migrate from v3 (has complexity columns, no safety columns) to v5.
649#[tokio::test]
650async fn test_migrate_from_v3() {
651 let (conn, _db, _dir) = create_raw_db().await;
652 create_v1_schema(&conn).await;
653 apply_v2(&conn).await;
654 apply_v3(&conn).await;
655
656 assert_eq!(get_user_version(&conn).await, 3);
657 assert!(column_exists(&conn, "nodes", "branches").await);
658 assert!(!column_exists(&conn, "nodes", "unsafe_blocks").await);
659
660 let migrated = migrate(&conn)
661 .await
662 .expect("migrate from v3 should succeed");
663
664 assert!(migrated);
665 assert_eq!(get_user_version(&conn).await, 15);
666
667 // V4 columns
668 assert!(column_exists(&conn, "nodes", "unsafe_blocks").await);
669 assert!(column_exists(&conn, "nodes", "unchecked_calls").await);
670 assert!(column_exists(&conn, "nodes", "assertions").await);
671
672 // V5 unique index
673 assert!(index_exists(&conn, "idx_edges_unique").await);
674}
675
676/// migrate from v4 (has all columns, no edge dedup) to v5.
677#[tokio::test]

Callers

nothing calls this directly

Calls 5

create_raw_dbFunction · 0.85
create_v1_schemaFunction · 0.85
apply_v2Function · 0.85
apply_v3Function · 0.85
migrateFunction · 0.85

Tested by

no test coverage detected