@@ -162,7 +162,7 @@ fn test_migration_idempotent() {
162162 row. get ( 0 )
163163 } )
164164 . unwrap ( ) ;
165- assert_eq ! ( version, 13 ) ;
165+ assert_eq ! ( version, 14 ) ;
166166}
167167
168168#[ test]
@@ -602,6 +602,7 @@ fn test_migration_v6_injects_builtin_models_for_existing_router_configs() {
602602
603603fn run_migrations_to_v5 ( conn : & Connection ) {
604604 run_migrations ( conn) . unwrap ( ) ;
605+ revert_v14 ( conn) ;
605606 conn. execute_batch (
606607 "DROP TABLE skill_security_migration_items;
607608 DROP TABLE skill_security_migration;
@@ -639,6 +640,7 @@ fn run_migrations_to_v5(conn: &Connection) {
639640
640641fn run_migrations_to_v10 ( conn : & Connection ) {
641642 run_migrations ( conn) . unwrap ( ) ;
643+ revert_v14 ( conn) ;
642644 revert_v13 ( conn) ;
643645 conn. execute_batch (
644646 "DROP TABLE skill_approvals;
@@ -667,6 +669,7 @@ fn run_migrations_to_v10(conn: &Connection) {
667669
668670fn run_migrations_to_v11 ( conn : & Connection ) {
669671 run_migrations ( conn) . unwrap ( ) ;
672+ revert_v14 ( conn) ;
670673 revert_v13 ( conn) ;
671674 conn. execute_batch (
672675 "DROP TABLE skill_approvals;
@@ -682,9 +685,23 @@ fn run_migrations_to_v11(conn: &Connection) {
682685
683686fn run_migrations_to_v12 ( conn : & Connection ) {
684687 run_migrations ( conn) . unwrap ( ) ;
688+ revert_v14 ( conn) ;
685689 revert_v13 ( conn) ;
686690}
687691
692+ fn revert_v14 ( conn : & Connection ) {
693+ conn. execute_batch (
694+ "DROP INDEX IF EXISTS idx_artifacts_sha256;
695+ DROP INDEX IF EXISTS idx_artifacts_origin_message;
696+ DROP INDEX IF EXISTS idx_artifacts_session_retention;
697+ DROP TABLE IF EXISTS artifacts;
698+ DROP INDEX IF EXISTS idx_message_blocks_message_position;
699+ DROP TABLE IF EXISTS message_blocks;
700+ DELETE FROM _schema_version WHERE version = 14;" ,
701+ )
702+ . unwrap ( ) ;
703+ }
704+
688705fn revert_v13 ( conn : & Connection ) {
689706 conn. execute_batch (
690707 "DROP TABLE skill_security_migration_items;
0 commit comments