feat(db): add vocabulary, term, and authority tables

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-02 08:43:23 +02:00
parent d5ed2a261f
commit 93d54d7783
2 changed files with 57 additions and 0 deletions
+23
View File
@@ -18,3 +18,26 @@ async fn migrate_is_idempotent_and_creates_audit_log(pool: PgPool) {
.unwrap();
assert_eq!(regclass.as_deref(), Some("audit_log"));
}
#[sqlx::test]
async fn migrate_creates_vocabulary_and_authority_tables(pool: PgPool) {
let db = Db::from_pool(pool);
for table in [
"vocabulary",
"term",
"term_label",
"authority",
"authority_label",
] {
let regclass: Option<String> =
sqlx::query_scalar(&format!("SELECT to_regclass('public.{table}')::text"))
.fetch_one(db.pool())
.await
.unwrap();
assert_eq!(
regclass.as_deref(),
Some(table),
"table {table} should exist"
);
}
}