()
| 648 | /// migrate from v3 (has complexity columns, no safety columns) to v5. |
| 649 | #[tokio::test] |
| 650 | async 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] |
nothing calls this directly
no test coverage detected