chore(storage): drop dictionary table (v7) + retire unused storage fns — profile_terms is sole surface

This commit is contained in:
2026-04-19 21:04:13 +01:00
parent c0308306ae
commit 86228cd517
3 changed files with 36 additions and 65 deletions

View File

@@ -179,6 +179,14 @@ const MIGRATIONS: &[(i64, &str, &str)] = &[
END;
"#,
),
(
7,
"drop_dictionary",
r#"
DROP INDEX IF EXISTS idx_dictionary_term;
DROP TABLE IF EXISTS dictionary;
"#,
),
];
/// Split SQL into individual statements, respecting BEGIN...END trigger blocks.
@@ -279,7 +287,7 @@ mod tests {
.fetch_one(&pool)
.await
.unwrap();
assert_eq!(count, 6);
assert_eq!(count, 7);
sqlx::query("INSERT INTO settings (key, value) VALUES ('test', 'value')")
.execute(&pool)
@@ -301,7 +309,7 @@ mod tests {
.fetch_one(&pool)
.await
.unwrap();
assert_eq!(count, 6);
assert_eq!(count, 7);
}
#[tokio::test]
@@ -522,4 +530,23 @@ mod tests {
assert!(result.is_err(), "trigger must block Default rename");
}
#[tokio::test]
async fn migration_v7_drops_dictionary_table() {
let pool = SqlitePoolOptions::new()
.max_connections(1)
.connect("sqlite::memory:")
.await
.expect("pool");
run_migrations(&pool).await.expect("migrate");
// dictionary table should not exist after v7.
let result: std::result::Result<i64, sqlx::Error> =
sqlx::query_scalar("SELECT COUNT(*) FROM dictionary")
.fetch_one(&pool)
.await;
assert!(result.is_err(), "dictionary table must be gone after v7");
let err = result.unwrap_err().to_string().to_lowercase();
assert!(err.contains("no such table"), "got: {err}");
}
}