not working, needs fixes
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user