diff --git a/crates/collab/src/db.rs b/crates/collab/src/db.rs index c05152fe7a..1ae85559e0 100644 --- a/crates/collab/src/db.rs +++ b/crates/collab/src/db.rs @@ -23,17 +23,6 @@ macro_rules! test_support { #[async_trait] pub trait Db: Send + Sync { - async fn create_signup( - &self, - github_login: &str, - email_address: &str, - about: &str, - wants_releases: bool, - wants_updates: bool, - wants_community: bool, - ) -> Result; - async fn get_all_signups(&self) -> Result>; - async fn destroy_signup(&self, id: SignupId) -> Result<()>; async fn create_user(&self, github_login: &str, admin: bool) -> Result; async fn get_all_users(&self) -> Result>; async fn get_user_by_id(&self, id: UserId) -> Result>; @@ -107,60 +96,6 @@ impl PostgresDb { #[async_trait] impl Db for PostgresDb { - // signups - async fn create_signup( - &self, - github_login: &str, - email_address: &str, - about: &str, - wants_releases: bool, - wants_updates: bool, - wants_community: bool, - ) -> Result { - test_support!(self, { - let query = " - INSERT INTO signups ( - github_login, - email_address, - about, - wants_releases, - wants_updates, - wants_community - ) - VALUES ($1, $2, $3, $4, $5, $6) - RETURNING id - "; - Ok(sqlx::query_scalar(query) - .bind(github_login) - .bind(email_address) - .bind(about) - .bind(wants_releases) - .bind(wants_updates) - .bind(wants_community) - .fetch_one(&self.pool) - .await - .map(SignupId)?) - }) - } - - async fn get_all_signups(&self) -> Result> { - test_support!(self, { - let query = "SELECT * FROM signups ORDER BY github_login ASC"; - Ok(sqlx::query_as(query).fetch_all(&self.pool).await?) - }) - } - - async fn destroy_signup(&self, id: SignupId) -> Result<()> { - test_support!(self, { - let query = "DELETE FROM signups WHERE id = $1"; - Ok(sqlx::query(query) - .bind(id.0) - .execute(&self.pool) - .await - .map(drop)?) - }) - } - // users async fn create_user(&self, github_login: &str, admin: bool) -> Result { @@ -577,18 +512,6 @@ pub struct Org { pub slug: String, } -id_type!(SignupId); -#[derive(Debug, FromRow, Serialize)] -pub struct Signup { - pub id: SignupId, - pub github_login: String, - pub email_address: String, - pub about: String, - pub wants_releases: Option, - pub wants_updates: Option, - pub wants_community: Option, -} - id_type!(ChannelId); #[derive(Clone, Debug, FromRow, Serialize)] pub struct Channel { @@ -853,26 +776,6 @@ pub mod tests { #[async_trait] impl Db for FakeDb { - async fn create_signup( - &self, - _github_login: &str, - _email_address: &str, - _about: &str, - _wants_releases: bool, - _wants_updates: bool, - _wants_community: bool, - ) -> Result { - unimplemented!() - } - - async fn get_all_signups(&self) -> Result> { - unimplemented!() - } - - async fn destroy_signup(&self, _id: SignupId) -> Result<()> { - unimplemented!() - } - async fn create_user(&self, github_login: &str, admin: bool) -> Result { self.background.simulate_random_delay().await;