not working, needs fixes

This commit is contained in:
filipriec
2025-02-24 21:44:41 +01:00
parent c612409808
commit 160a5e488c
2 changed files with 6 additions and 20 deletions

View File

@@ -29,22 +29,8 @@ pub async fn setup_test_db() -> PgPool {
pool
}
// Add this to tests/common/mod.rs
pub async fn clear_all_tables(pool: &PgPool) {
// Clear tables in the correct order to respect foreign key constraints
clear_uctovnictvo_table(pool).await;
clear_adresar_table(pool).await;
}
pub async fn clear_uctovnictvo_table(pool: &PgPool) {
sqlx::query!("DELETE FROM uctovnictvo")
.execute(pool)
.await
.expect("Failed to clear uctovnictvo table");
}
pub async fn clear_adresar_table(pool: &PgPool) {
sqlx::query!("DELETE FROM adresar")
sqlx::query("TRUNCATE adresar RESTART IDENTITY CASCADE")
.execute(pool)
.await
.expect("Failed to clear adresar table");