Skip to content

Commit

Permalink
ci: drop tables in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Randoooom committed Nov 27, 2023
1 parent 12a1571 commit 9a683c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/database/drop.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP TABLE IF EXISTS totp_challenge;
DROP TABLE IF EXISTS account;

3 changes: 3 additions & 0 deletions src/database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ macro_rules! database_configuration {
let url = config.to_url($scheme);
connection.init($driver {}, url.as_str())?;

#[cfg(test)]
connection.exec(include_str!("drop.sql"), vec![]).await?;

// perform migrations
let last: Option<Migration> = Migration::select_latest(&connection).await.unwrap_or_default();
if let Some(last) = last {
Expand Down

0 comments on commit 9a683c9

Please sign in to comment.