Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(call): enforce single join (#2832)

Will Hutchinson52e3a2213430
diff --git a/js/app/packages/core/service.ts b/js/app/packages/core/service.ts
index ec7af90de6..2ef349a0ea 100644
--- a/js/app/packages/core/service.ts
+++ b/js/app/packages/core/service.ts
@@ -293,6 +293,7 @@ export const fetchErrorsSvc = new Svc('Common fetch errors')
.err('NOT_FOUND', { description: 'Resource not found' })
.err('UNAUTHORIZED', { description: 'Unauthorized access' })
.err('FORBIDDEN', { description: 'Forbidden' })
+ .err('CONFLICT', { description: 'Resource conflict' })
.err('SERVER_ERROR', { description: 'Internal server error' })
.err('INVALID_JSON', { description: 'Invalid JSON in response' })
.err('UNKNOWN_ERROR', { description: 'An unknown error occurred' })
diff --git a/js/app/packages/core/util/safeFetch.ts b/js/app/packages/core/util/safeFetch.ts
index 1707484416..31981c59a2 100644
--- a/js/app/packages/core/util/safeFetch.ts
+++ b/js/app/packages/core/util/safeFetch.ts
@@ -17,6 +17,7 @@ export type BaseFetchErrorCode =
| 'NOT_FOUND'
| 'UNAUTHORIZED'
| 'FORBIDDEN'
+ | 'CONFLICT'
| 'SERVER_ERROR'
| 'INVALID_JSON'
| 'UNKNOWN_ERROR'
@@ -199,6 +200,8 @@ export async function safeFetch<
return err('UNAUTHORIZED', 'Unauthorized access');
case 403:
return err('FORBIDDEN', 'Forbidden');
+ case 409:
+ return err('CONFLICT', 'Resource conflict');
case 410:
return err('GONE', 'Resource deleted');
case 500:
diff --git a/js/app/packages/queries/call/call.ts b/js/app/packages/queries/call/call.ts
index fb8eebc873..545572fbce 100644
--- a/js/app/packages/queries/call/call.ts
+++ b/js/app/packages/queries/call/call.ts
@@ -1,4 +1,5 @@
-import { throwOnErr } from '@core/util/maybeResult';
+import { toast } from '@core/component/Toast/Toast';
+import { MaybeResultError, throwOnErr } from '@core/util/maybeResult';
import { callServiceClient } from '@service-call/client';
import { queryClient } from '@queries/client';
import { useMutation, useQuery } from '@tanstack/solid-query';
@@ -22,6 +23,17 @@ export function useJoinCallMutation() {
queryClient.invalidateQueries({ queryKey: ['call', 'active'] });
},
onError(error: Error) {
+ if (
+ error instanceof MaybeResultError &&
+ error.errors[0]?.code === 'CONFLICT'
+ ) {
+ toast.alert(
+ "You're already in another call",
+ 'Leave your current call before joining a new one.'
+ );
+ return;
+ }
+ toast.failure('Failed to join call');
console.error('failed to join call', error);
},
}));
diff --git a/js/app/packages/service-clients/service-auth/fetch.ts b/js/app/packages/service-clients/service-auth/fetch.ts
index 547afc3b5a..ac10014d61 100644
--- a/js/app/packages/service-clients/service-auth/fetch.ts
+++ b/js/app/packages/service-clients/service-auth/fetch.ts
@@ -120,6 +120,11 @@ export async function fetchWithAuth<
code: 'UNAUTHORIZED',
message: 'Unauthorized access',
};
+ case 409:
+ return {
+ code: 'CONFLICT',
+ message: 'Resource conflict',
+ };
case 410:
return {
code: 'GONE',
diff --git a/rust/cloud-storage/call/.sqlx/query-93e41cb92c91a9a26ffbff42116d4311ca4e2ed8e7ff939912a65e045a49c939.json b/rust/cloud-storage/call/.sqlx/query-93e41cb92c91a9a26ffbff42116d4311ca4e2ed8e7ff939912a65e045a49c939.json
new file mode 100644
index 0000000000..f40c6cda0a
--- /dev/null
+++ b/rust/cloud-storage/call/.sqlx/query-93e41cb92c91a9a26ffbff42116d4311ca4e2ed8e7ff939912a65e045a49c939.json
@@ -0,0 +1,28 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT c.id, c.channel_id\n FROM call_participants cp\n JOIN calls c ON c.id = cp.call_id\n WHERE cp.user_id = $1 AND cp.left_at IS NULL\n LIMIT 1\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 1,
+ "name": "channel_id",
+ "type_info": "Uuid"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Text"
+ ]
+ },
+ "nullable": [
+ false,
+ false
+ ]
+ },
+ "hash": "93e41cb92c91a9a26ffbff42116d4311ca4e2ed8e7ff939912a65e045a49c939"
+}
diff --git a/rust/cloud-storage/call/fixtures/call_repo.sql b/rust/cloud-storage/call/fixtures/call_repo.sql
index 23a2e6d9d3..6a62faefb5 100644
--- a/rust/cloud-storage/call/fixtures/call_repo.sql
+++ b/rust/cloud-storage/call/fixtures/call_repo.sql
@@ -4,7 +4,7 @@
-- Active call: call1 in ch1, created by user-a
-- Participants: user-a (creator), user-b
--
--- Channel: ch2 (public, no active call)
+-- Channel: ch2 (public, no active call — tests opt in via create_call)
-- channels
INSERT INTO comms_channels (id, name, channel_type, org_id, owner_id, created_at, updated_at) VALUES
diff --git a/rust/cloud-storage/call/src/domain/models.rs b/rust/cloud-storage/call/src/domain/models.rs
index f267def154..8af2fbeb01 100644
--- a/rust/cloud-storage/call/src/domain/models.rs
+++ b/rust/cloud-storage/call/src/domain/models.rs
@@ -233,6 +233,22 @@ pub struct GetCallRecordsRequest {
pub query: Query<Uuid, SimpleSortMethod, LiteralTree<CallLiteral>>,
}
+/// Errors that can occur when adding a participant to a call at the
+/// repository boundary. Splitting the "already-active-elsewhere" case into
+/// a typed variant lets the service handle it without looking at the
+/// underlying database error type.
+#[derive(Debug, thiserror::Error)]
+pub enum AddParticipantError {
+ /// The user is already an active participant in another call, as
+ /// enforced by the DB-level partial unique index on
+ /// `call_participants (user_id) WHERE left_at IS NULL`.
+ #[error("user is already an active participant in another call")]
+ UserAlreadyActive,
+ /// Any other repository/infrastructure error.
+ #[error(transparent)]
+ Repository(anyhow::Error),
+}
+
/// Errors that can occur during call operations.
#[derive(Debug, thiserror::Error)]
pub enum CallError {
@@ -242,6 +258,11 @@ pub enum CallError {
/// User is not in the call.
#[error("user not in call")]
NotInCall,
+ /// User is already an active participant in another call. The inner
+ /// string is the `channel_id` of that other call, so clients can show
+ /// a targeted message (and optionally deep-link to leave it).
+ #[error("user is already in a call in channel {0}")]
+ AlreadyInCall(String),
/// Authentication or signature validation failed.
#[error("authentication failed")]
Auth,
diff --git a/rust/cloud-storage/call/src/domain/ports.rs b/rust/cloud-storage/call/src/domain/ports.rs
index 70456b2f05..126119e3be 100644
--- a/rust/cloud-storage/call/src/domain/ports.rs
+++ b/rust/cloud-storage/call/src/domain/ports.rs
@@ -14,8 +14,8 @@ use item_filters::ast::{LiteralTree, call::CallLiteral};
use crate::domain::models::EditCallRecordRequest;
use super::models::{
- Call, CallActiveResponse, CallError, CallParticipant, CallRecord, CallTokenResponse,
- CallWebhookEvent, EgressS3Config, GetCallRecordsRequest, LeaveCallResponse,
+ AddParticipantError, Call, CallActiveResponse, CallError, CallParticipant, CallRecord,
+ CallTokenResponse, CallWebhookEvent, EgressS3Config, GetCallRecordsRequest, LeaveCallResponse,
TranscriptSegmentRequest,
};
@@ -54,11 +54,24 @@ pub trait CallRepository: Send + Sync + 'static {
) -> impl Future<Output = Result<Option<Call>, Self::Err>> + Send;
/// Add a participant to a call.
+ ///
+ /// Returns [`AddParticipantError::UserAlreadyActive`] if the DB-level
+ /// partial unique index rejects the insert because the user is already
+ /// an active participant in another call. Other failures are wrapped in
+ /// [`AddParticipantError::Repository`].
fn add_participant<'a>(
&self,
call_id: &Uuid,
user_id: MacroUserIdStr<'a>,
- ) -> impl Future<Output = Result<CallParticipant, Self::Err>> + Send;
+ ) -> impl Future<Output = Result<CallParticipant, AddParticipantError>> + Send;
+
+ /// Find the call the user is currently an active participant of, if any.
+ /// Scans globally across all channels and returns `(call_id, channel_id)`
+ /// for the first active participation row (`left_at IS NULL`).
+ fn find_active_call_for_user<'a>(
+ &self,
+ user_id: MacroUserIdStr<'a>,
+ ) -> impl Future<Output = Result<Option<(Uuid, Uuid)>, Self::Err>> + Send;
/// Remove a participant from a call.
fn remove_participant<'a>(
diff --git a/rust/cloud-storage/call/src/domain/service.rs b/rust/cloud-storage/call/src/domain/service.rs
index f009730142..4bf66b8586 100644
--- a/rust/cloud-storage/call/src/domain/service.rs
+++ b/rust/cloud-storage/call/src/domain/service.rs
@@ -24,8 +24,8 @@ use uuid::Uuid;
use crate::domain::models::EditCallRecordRequest;
use super::models::{
- CallActiveResponse, CallError, CallRecord, CallTokenResponse, EgressS3Config,
- GetCallRecordsRequest, LeaveCallResponse, TranscriptSegmentRequest,
+ AddParticipantError, CallActiveResponse, CallError, CallRecord, CallTokenResponse,
+ EgressS3Config, GetCallRecordsRequest, LeaveCallResponse, TranscriptSegmentRequest,
};
use super::ports::{
CallRecordQueryService, CallRepository, CallRtcClient, CallService, RecordingStorage,
@@ -392,11 +392,40 @@ impl<
}
};
- // Idempotent upsert — handles concurrent joins and rejoin after leave.
- self.repo
- .add_participant(&call.id, user_id.copied())
+ // Enforce: a user can only be active in one call at a time. If the
+ // user already has an active participation in a *different* call,
+ // reject before we add them here.
+ if let Some((other_call_id, other_channel_id)) = self
+ .repo
+ .find_active_call_for_user(user_id.copied())
.await
- .map_err(|e| CallError::Internal(e.into()))?;
+ .map_err(|e| CallError::Internal(e.into()))?
+ && other_call_id != call.id
+ {
+ return Err(CallError::AlreadyInCall(other_channel_id.to_string()));
+ }
+
+ // Idempotent upsert — handles concurrent joins and rejoin after leave.
+ // The DB-level partial unique index is the race-safe backstop: if a
+ // concurrent request slipped past the pre-flight above, the adapter
+ // returns AddParticipantError::UserAlreadyActive, which we translate
+ // to a typed CallError::AlreadyInCall.
+ match self.repo.add_participant(&call.id, user_id.copied()).await {
+ Ok(_) => {}
+ Err(AddParticipantError::UserAlreadyActive) => {
+ let channel = self
+ .repo
+ .find_active_call_for_user(user_id.copied())
+ .await
+ .map_err(|e| CallError::Internal(e.into()))?
+ .map(|(_, ch)| ch.to_string())
+ .unwrap_or_else(|| "unknown".to_string());
+ return Err(CallError::AlreadyInCall(channel));
+ }
+ Err(AddParticipantError::Repository(e)) => {
+ return Err(CallError::Internal(e));
+ }
+ }
// Always generate a fresh token (supports reconnection from different devices).
let token = self
@@ -514,15 +543,32 @@ impl<
};
// Reconcile: idempotent upsert (handles reconnect/race conditions).
- self.repo
+ // UserAlreadyActive means our DB has the user active in
+ // another call while LiveKit says they joined this one —
+ // state drift. Don't fail the whole webhook; log and move on.
+ match self
+ .repo
.add_participant(&call.id, participant_identity.copied())
.await
- .map_err(|e| CallError::Internal(e.into()))?;
- tracing::info!(
- call_id = %call.id,
- participant = participant_identity.as_ref(),
- "reconciled participant_joined via webhook"
- );
+ {
+ Ok(_) => {
+ tracing::info!(
+ call_id = %call.id,
+ participant = participant_identity.as_ref(),
+ "reconciled participant_joined via webhook"
+ );
+ }
+ Err(AddParticipantError::UserAlreadyActive) => {
+ tracing::warn!(
+ call_id = %call.id,
+ participant = participant_identity.as_ref(),
+ "participant_joined webhook: user already active in another call; ignoring reconcile"
+ );
+ }
+ Err(AddParticipantError::Repository(e)) => {
+ return Err(CallError::Internal(e));
+ }
+ }
}
"participant_left" => {
let (Some(room_name), Some(participant_identity)) =
diff --git a/rust/cloud-storage/call/src/inbound/axum_router.rs b/rust/cloud-storage/call/src/inbound/axum_router.rs
index c8f7c5b203..744cb21e03 100644
--- a/rust/cloud-storage/call/src/inbound/axum_router.rs
+++ b/rust/cloud-storage/call/src/inbound/axum_router.rs
@@ -530,6 +530,7 @@ impl IntoResponse for CallError {
let status_code = match &self {
CallError::NotFound(_) => StatusCode::NOT_FOUND,
CallError::NotInCall => StatusCode::BAD_REQUEST,
+ CallError::AlreadyInCall(_) => StatusCode::CONFLICT,
CallError::Auth => StatusCode::UNAUTHORIZED,
CallError::Internal(_) => {
tracing::error!(error=?self, "internal server error");
diff --git a/rust/cloud-storage/call/src/outbound/pg_call_repo.rs b/rust/cloud-storage/call/src/outbound/pg_call_repo.rs
index d0dd9e4432..4629cd4df3 100644
--- a/rust/cloud-storage/call/src/outbound/pg_call_repo.rs
+++ b/rust/cloud-storage/call/src/outbound/pg_call_repo.rs
@@ -19,11 +19,26 @@ use uuid::Uuid;
use crate::domain::channel_name::{NameLookup, display_name, resolve_channel_name};
use crate::domain::models::{
- Call, CallParticipant, CallRecord, CallRecordParticipant, CallRecordTranscriptSegment,
- EditCallRecordRequest, TranscriptSegmentRequest,
+ AddParticipantError, Call, CallParticipant, CallRecord, CallRecordParticipant,
+ CallRecordTranscriptSegment, EditCallRecordRequest, TranscriptSegmentRequest,
};
use crate::domain::ports::CallRepository;
+/// Name of the partial unique index enforcing one active call per user.
+const ACTIVE_CALL_UNIQUE_INDEX: &str = "call_participants_one_active_per_user";
+
+/// Translate a sqlx error from an `add_participant` insert into the domain
+/// [`AddParticipantError`]. A unique-violation on the
+/// `call_participants_one_active_per_user` partial index becomes
+/// [`AddParticipantError::UserAlreadyActive`]; everything else is wrapped.
+fn classify_add_participant_err(err: sqlx::Error) -> AddParticipantError {
+ if err.as_database_error().and_then(|db| db.constraint()) == Some(ACTIVE_CALL_UNIQUE_INDEX) {
+ AddParticipantError::UserAlreadyActive
+ } else {
+ AddParticipantError::Repository(err.into())
+ }
+}
+
/// Extract channel_id UUIDs from a call filter AST.
fn extract_channel_ids(filter: &LiteralTree<CallLiteral>) -> Vec<Uuid> {
let Some(expr) = filter else {
@@ -265,7 +280,7 @@ impl CallRepository for PgCallRepo {
&self,
call_id: &Uuid,
user_id: MacroUserIdStr<'_>,
- ) -> Result<CallParticipant, Self::Err> {
+ ) -> Result<CallParticipant, AddParticipantError> {
let row = sqlx::query!(
r#"
INSERT INTO call_participants (call_id, user_id)
@@ -277,7 +292,8 @@ impl CallRepository for PgCallRepo {
user_id.as_ref(),
)
.fetch_one(&self.pool)
- .await?;
+ .await
+ .map_err(classify_add_participant_err)?;
Ok(CallParticipant {
call_id: row.call_id,
@@ -286,6 +302,27 @@ impl CallRepository for PgCallRepo {
})
}
+ #[tracing::instrument(err, skip(self))]
+ async fn find_active_call_for_user(
+ &self,
+ user_id: MacroUserIdStr<'_>,
+ ) -> Result<Option<(Uuid, Uuid)>, Self::Err> {
+ let row = sqlx::query!(
+ r#"
+ SELECT c.id, c.channel_id
+ FROM call_participants cp
+ JOIN calls c ON c.id = cp.call_id
+ WHERE cp.user_id = $1 AND cp.left_at IS NULL
+ LIMIT 1
+ "#,
+ user_id.as_ref(),
+ )
+ .fetch_optional(&self.pool)
+ .await?;
+
+ Ok(row.map(|r| (r.id, r.channel_id)))
+ }
+
#[tracing::instrument(err, skip(self))]
async fn remove_participant(
&self,
diff --git a/rust/cloud-storage/call/src/outbound/pg_call_repo/test.rs b/rust/cloud-storage/call/src/outbound/pg_call_repo/test.rs
index 4bc1bcc341..3c92d310f4 100644
--- a/rust/cloud-storage/call/src/outbound/pg_call_repo/test.rs
+++ b/rust/cloud-storage/call/src/outbound/pg_call_repo/test.rs
@@ -1,6 +1,6 @@
use std::{ops::Deref, sync::Arc, sync::LazyLock};
-use crate::domain::models::{EditCallRecordRequest, TranscriptSegmentRequest};
+use crate::domain::models::{AddParticipantError, EditCallRecordRequest, TranscriptSegmentRequest};
use crate::domain::ports::CallRepository;
use crate::outbound::pg_call_repo::PgCallRepo;
use chrono::Utc;
@@ -23,6 +23,7 @@ fn attended_filter(b: bool) -> LiteralTree<CallLiteral> {
const CH1: Uuid = Uuid::from_u128(0x00000000_0000_0000_0000_000000000c01);
const CH2: Uuid = Uuid::from_u128(0x00000000_0000_0000_0000_000000000c02);
const CALL1: Uuid = Uuid::from_u128(0x00000000_0000_0000_0000_0000000ca110);
+const CALL2: Uuid = Uuid::from_u128(0x00000000_0000_0000_0000_0000000ca220);
const CALL_ARCHIVED: Uuid = Uuid::from_u128(0x00000000_0000_0000_0000_0000000ca2ed);
static USER_A: LazyLock<MacroUserIdStr<'static>> =
LazyLock::new(|| MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap());
@@ -164,6 +165,137 @@ async fn remove_participant_removes_from_db(pool: Pool<Postgres>) -> anyhow::Res
Ok(())
}
+// -- find_active_call_for_user ------------------------------------------------
+
+#[sqlx::test(
+ fixtures(path = "../../../fixtures", scripts("call_repo")),
+ migrator = "MACRO_DB_MIGRATIONS"
+)]
+async fn find_active_call_for_user_returns_current_participation(
+ pool: Pool<Postgres>,
+) -> anyhow::Result<()> {
+ let repo = repo(pool);
+
+ // user-a is an active participant in call1 (ch1) per the fixture.
+ let found = repo
+ .find_active_call_for_user(USER_A.deref().copied())
+ .await?;
+ assert_eq!(found, Some((CALL1, CH1)));
+ Ok(())
+}
+
+#[sqlx::test(
+ fixtures(path = "../../../fixtures", scripts("call_repo")),
+ migrator = "MACRO_DB_MIGRATIONS"
+)]
+async fn find_active_call_for_user_returns_none_when_never_joined(
+ pool: Pool<Postgres>,
+) -> anyhow::Result<()> {
+ let repo = repo(pool);
+
+ // user-c is a channel member but not a participant in any call.
+ let found = repo
+ .find_active_call_for_user(USER_C.deref().copied())
+ .await?;
+ assert!(found.is_none());
+ Ok(())
+}
+
+#[sqlx::test(
+ fixtures(path = "../../../fixtures", scripts("call_repo")),
+ migrator = "MACRO_DB_MIGRATIONS"
+)]
+async fn find_active_call_for_user_returns_none_after_leave(
+ pool: Pool<Postgres>,
+) -> anyhow::Result<()> {
+ let repo = repo(pool);
+
+ repo.remove_participant(&CALL1, USER_B.deref().copied())
+ .await?;
+
+ let found = repo
+ .find_active_call_for_user(USER_B.deref().copied())
+ .await?;
+ assert!(found.is_none());
+ Ok(())
+}
+
+// -- one-active-call-per-user invariant ---------------------------------------
+
+#[sqlx::test(
+ fixtures(path = "../../../fixtures", scripts("call_repo")),
+ migrator = "MACRO_DB_MIGRATIONS"
+)]
+async fn add_participant_rejects_user_already_active_in_other_call(
+ pool: Pool<Postgres>,
+) -> anyhow::Result<()> {
+ let repo = repo(pool);
+
+ // Seed a second active call in ch2 (the fixture leaves ch2 empty).
+ repo.create_call(&CALL2, &CH2, "room-ch2", USER_C.deref().copied())
+ .await?
+ .expect("should create call2 in ch2");
+
+ // user-a is already active in call1 (ch1) per the fixture. Trying to
+ // add them to call2 (ch2) must hit the partial unique index and surface
+ // as AddParticipantError::UserAlreadyActive.
+ let err = repo
+ .add_participant(&CALL2, USER_A.deref().copied())
+ .await
+ .expect_err("should reject user already active elsewhere");
+
+ assert!(
+ matches!(err, AddParticipantError::UserAlreadyActive),
+ "expected UserAlreadyActive, got {err:?}"
+ );
+ Ok(())
+}
+
+#[sqlx::test(
+ fixtures(path = "../../../fixtures", scripts("call_repo")),
+ migrator = "MACRO_DB_MIGRATIONS"
+)]
+async fn add_participant_same_call_rejoin_is_idempotent(
+ pool: Pool<Postgres>,
+) -> anyhow::Result<()> {
+ let repo = repo(pool);
+
+ // user-a is already active in call1. Re-adding to the same call must
+ // succeed (upsert no-op) — the partial unique index only rejects when
+ // the active row would be in a *different* call.
+ let participant = repo
+ .add_participant(&CALL1, USER_A.deref().copied())
+ .await?;
+ assert_eq!(participant.call_id, CALL1);
+ assert_eq!(participant.user_id, USER_A.as_ref());
+ Ok(())
+}
+
+#[sqlx::test(
+ fixtures(path = "../../../fixtures", scripts("call_repo")),
+ migrator = "MACRO_DB_MIGRATIONS"
+)]
+async fn add_participant_allows_join_other_call_after_leave(
+ pool: Pool<Postgres>,
+) -> anyhow::Result<()> {
+ let repo = repo(pool);
+
+ repo.create_call(&CALL2, &CH2, "room-ch2", USER_C.deref().copied())
+ .await?
+ .expect("should create call2 in ch2");
+
+ // user-a leaves call1, freeing them up to join call2.
+ repo.remove_participant(&CALL1, USER_A.deref().copied())
+ .await?;
+
+ let participant = repo
+ .add_participant(&CALL2, USER_A.deref().copied())
+ .await?;
+ assert_eq!(participant.call_id, CALL2);
+ assert_eq!(participant.user_id, USER_A.as_ref());
+ Ok(())
+}
+
// -- get_participants ---------------------------------------------------------
#[sqlx::test(
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-06a72bfcfbcc5f5bbed6cd093436309607f9375d2ba7b151e9dc1a8493f88e44.json b/rust/cloud-storage/macro_db_client/.sqlx/query-06a72bfcfbcc5f5bbed6cd093436309607f9375d2ba7b151e9dc1a8493f88e44.json
deleted file mode 100644
index 4c5afc274a..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-06a72bfcfbcc5f5bbed6cd093436309607f9375d2ba7b151e9dc1a8493f88e44.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n DELETE FROM notification_user_device_registration\n WHERE device_endpoint = $1\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "06a72bfcfbcc5f5bbed6cd093436309607f9375d2ba7b151e9dc1a8493f88e44"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-0c0d2d2d944ff26d1b60d890ffb5becd7ce6250a3becf484a65ecfa99a0c0d2d.json b/rust/cloud-storage/macro_db_client/.sqlx/query-0c0d2d2d944ff26d1b60d890ffb5becd7ce6250a3becf484a65ecfa99a0c0d2d.json
deleted file mode 100644
index 99a3b6f452..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-0c0d2d2d944ff26d1b60d890ffb5becd7ce6250a3becf484a65ecfa99a0c0d2d.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT user_id FROM (\n -- Direct user grants\n SELECT source_id as user_id FROM entity_access\n WHERE entity_id = $1 AND entity_type = $2 AND source_type = 'user'\n\n UNION ALL\n\n -- Channel Members\n SELECT cp.user_id FROM comms_channel_participants cp\n WHERE cp.left_at IS NULL AND cp.channel_id IN (\n SELECT source_id::uuid FROM entity_access\n WHERE entity_id = $1 AND entity_type = $2 AND source_type = 'channel'\n )\n\n UNION ALL\n\n -- Team Members\n SELECT tu.user_id FROM team_user tu\n WHERE tu.team_id IN (\n SELECT source_id::uuid FROM entity_access\n WHERE entity_id = $1 AND entity_type = $2 AND source_type = 'team'\n )\n )\n \n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "user_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "0c0d2d2d944ff26d1b60d890ffb5becd7ce6250a3becf484a65ecfa99a0c0d2d"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-1435acbba365796ddcb6ddbef86f4ebf664cffc44082996f6b60a60373c28f75.json b/rust/cloud-storage/macro_db_client/.sqlx/query-1435acbba365796ddcb6ddbef86f4ebf664cffc44082996f6b60a60373c28f75.json
deleted file mode 100644
index d2b084cf10..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-1435acbba365796ddcb6ddbef86f4ebf664cffc44082996f6b60a60373c28f75.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO entity_properties (id, entity_id, entity_type, property_definition_id, values)\n SELECT \n u.id,\n u.entity_id,\n 'TASK'::property_entity_type,\n u.property_definition_id,\n u.values\n FROM UNNEST(\n $1::UUID[],\n $2::TEXT[],\n $3::UUID[],\n $4::JSONB[]\n ) AS u(id, entity_id, property_definition_id, values)\n ON CONFLICT (entity_id, entity_type, property_definition_id)\n DO UPDATE SET \n values = EXCLUDED.values,\n updated_at = NOW()\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "UuidArray",
- "TextArray",
- "UuidArray",
- "JsonbArray"
- ]
- },
- "nullable": []
- },
- "hash": "1435acbba365796ddcb6ddbef86f4ebf664cffc44082996f6b60a60373c28f75"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-1b7983a9a8a54322fd63d2bf169f27b45f853652a757123e3508017861b5c7c6.json b/rust/cloud-storage/macro_db_client/.sqlx/query-1b7983a9a8a54322fd63d2bf169f27b45f853652a757123e3508017861b5c7c6.json
deleted file mode 100644
index f97907a55c..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-1b7983a9a8a54322fd63d2bf169f27b45f853652a757123e3508017861b5c7c6.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n \"publicAccessLevel\" as \"access_level!\"\n FROM \"SharePermission\"\n WHERE \"isPublic\" = true\n AND \"publicAccessLevel\" IS NOT NULL\n AND id IN (\n SELECT \"sharePermissionId\" FROM \"ProjectPermission\" WHERE \"projectId\" = $1\n )\n\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "access_level!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "1b7983a9a8a54322fd63d2bf169f27b45f853652a757123e3508017861b5c7c6"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-270cd8ae6b47508cb7e4e920bd76cb0f6177d685bddedb06f1892d0014af6f01.json b/rust/cloud-storage/macro_db_client/.sqlx/query-270cd8ae6b47508cb7e4e920bd76cb0f6177d685bddedb06f1892d0014af6f01.json
deleted file mode 100644
index 01cece9642..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-270cd8ae6b47508cb7e4e920bd76cb0f6177d685bddedb06f1892d0014af6f01.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n DELETE FROM notification_user_device_registration\n WHERE device_token = $1 AND device_type = $2\n RETURNING device_endpoint\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "device_endpoint",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- {
- "Custom": {
- "name": "notification_device_type_option",
- "kind": {
- "Enum": [
- "ios",
- "android"
- ]
- }
- }
- }
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "270cd8ae6b47508cb7e4e920bd76cb0f6177d685bddedb06f1892d0014af6f01"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-317f05707fdc73269f3017a3bb96d55b7327338bf5e52dfaad106b4b492cbb8e.json b/rust/cloud-storage/macro_db_client/.sqlx/query-317f05707fdc73269f3017a3bb96d55b7327338bf5e52dfaad106b4b492cbb8e.json
deleted file mode 100644
index b17b203167..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-317f05707fdc73269f3017a3bb96d55b7327338bf5e52dfaad106b4b492cbb8e.json
+++ /dev/null
@@ -1,98 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n un.user_id as owner_id,\n un.notification_id,\n n.event_item_id,\n n.event_item_type,\n un.sent,\n un.done,\n un.created_at::timestamptz as \"created_at!\",\n un.seen_at::timestamptz as viewed_at,\n un.created_at::timestamptz as \"updated_at!\",\n un.deleted_at::timestamptz,\n n.metadata as \"notification_metadata: serde_json::Value\",\n n.notification_event_type as notification_event_type,\n n.sender_id as sender_id\n FROM user_notification un\n JOIN notification n ON n.id = un.notification_id\n WHERE un.user_id = $1\n AND n.event_item_id = ANY($2)\n AND un.deleted_at IS NULL\n AND un.done = false\n AND (($4::timestamptz IS NULL)\n OR (un.created_at, un.notification_id) < ($4, $5))\n ORDER BY un.created_at DESC, un.notification_id DESC\n LIMIT $3\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "owner_id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "notification_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 2,
- "name": "event_item_id",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "event_item_type",
- "type_info": "Text"
- },
- {
- "ordinal": 4,
- "name": "sent",
- "type_info": "Bool"
- },
- {
- "ordinal": 5,
- "name": "done",
- "type_info": "Bool"
- },
- {
- "ordinal": 6,
- "name": "created_at!",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 7,
- "name": "viewed_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 8,
- "name": "updated_at!",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 9,
- "name": "deleted_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 10,
- "name": "notification_metadata: serde_json::Value",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 11,
- "name": "notification_event_type",
- "type_info": "Varchar"
- },
- {
- "ordinal": 12,
- "name": "sender_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "TextArray",
- "Int8",
- "Timestamptz",
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- false,
- false,
- false,
- null,
- null,
- null,
- null,
- false,
- false,
- true
- ]
- },
- "hash": "317f05707fdc73269f3017a3bb96d55b7327338bf5e52dfaad106b4b492cbb8e"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-3293eab63193f1b3822a59e9a6a9621520f26e6ec8248abed103985281ef7ff1.json b/rust/cloud-storage/macro_db_client/.sqlx/query-3293eab63193f1b3822a59e9a6a9621520f26e6ec8248abed103985281ef7ff1.json
deleted file mode 100644
index e4a18ac5f0..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-3293eab63193f1b3822a59e9a6a9621520f26e6ec8248abed103985281ef7ff1.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE user_notification\n SET done = $3\n WHERE user_id = $1 AND notification_id = ANY($2)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "UuidArray",
- "Bool"
- ]
- },
- "nullable": []
- },
- "hash": "3293eab63193f1b3822a59e9a6a9621520f26e6ec8248abed103985281ef7ff1"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-3357165799ff1f7bf1de3891174668e0ab16c64bd9dfc905213681e6021474fa.json b/rust/cloud-storage/macro_db_client/.sqlx/query-3357165799ff1f7bf1de3891174668e0ab16c64bd9dfc905213681e6021474fa.json
deleted file mode 100644
index 6696253445..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-3357165799ff1f7bf1de3891174668e0ab16c64bd9dfc905213681e6021474fa.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT EXISTS(\n SELECT 1 FROM notification_message_receipt\n WHERE user_id = $1\n AND notification_id = $2\n AND failed = false\n ) as \"exists!\"\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "exists!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "3357165799ff1f7bf1de3891174668e0ab16c64bd9dfc905213681e6021474fa"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-36dfcf982834f117d97d1ba332be6784c946f05120c7c228ff258389ceba97a1.json b/rust/cloud-storage/macro_db_client/.sqlx/query-36dfcf982834f117d97d1ba332be6784c946f05120c7c228ff258389ceba97a1.json
deleted file mode 100644
index c07ec0acbe..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-36dfcf982834f117d97d1ba332be6784c946f05120c7c228ff258389ceba97a1.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO user_notification_type_preference (user_id, notification_event_type)\n VALUES ($1, $2)\n ON CONFLICT (user_id, notification_event_type) DO NOTHING\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Varchar"
- ]
- },
- "nullable": []
- },
- "hash": "36dfcf982834f117d97d1ba332be6784c946f05120c7c228ff258389ceba97a1"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-377f7c130cc3d834870fa692f5ba36d070bce17512b9ab348d0cb40ebe4d1b08.json b/rust/cloud-storage/macro_db_client/.sqlx/query-377f7c130cc3d834870fa692f5ba36d070bce17512b9ab348d0cb40ebe4d1b08.json
deleted file mode 100644
index 9348d25315..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-377f7c130cc3d834870fa692f5ba36d070bce17512b9ab348d0cb40ebe4d1b08.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n \"publicAccessLevel\" as \"access_level!\"\n FROM \"SharePermission\"\n WHERE \"isPublic\" = true\n AND \"publicAccessLevel\" IS NOT NULL\n AND id IN (\n SELECT \"sharePermissionId\" FROM \"DocumentPermission\" WHERE \"documentId\" = $1\n )\n \n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "access_level!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "377f7c130cc3d834870fa692f5ba36d070bce17512b9ab348d0cb40ebe4d1b08"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-37b5168f739c490a3373c65eab35f247a34af0a8e659cbad61cb99e3094e5a60.json b/rust/cloud-storage/macro_db_client/.sqlx/query-37b5168f739c490a3373c65eab35f247a34af0a8e659cbad61cb99e3094e5a60.json
deleted file mode 100644
index 44d3a67e72..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-37b5168f739c490a3373c65eab35f247a34af0a8e659cbad61cb99e3094e5a60.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT EXISTS (\n SELECT 1\n FROM public.email_threads t\n JOIN public.email_links l ON l.id = t.link_id\n WHERE t.id = $1::uuid\n AND l.macro_id = $2\n ) AS \"exists!\"\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "exists!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "37b5168f739c490a3373c65eab35f247a34af0a8e659cbad61cb99e3094e5a60"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-41de07226ced9b95c7419c9e6d5d9bd9c5890cf1c144f0f8905664cd72c7f132.json b/rust/cloud-storage/macro_db_client/.sqlx/query-41de07226ced9b95c7419c9e6d5d9bd9c5890cf1c144f0f8905664cd72c7f132.json
deleted file mode 100644
index b75a3a2ff5..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-41de07226ced9b95c7419c9e6d5d9bd9c5890cf1c144f0f8905664cd72c7f132.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO entity_access (entity_id, entity_type, source_id, source_type, access_level)\n VALUES ($1, $2, $3, $4, $5)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text",
- {
- "Custom": {
- "name": "entity_access_source_type",
- "kind": {
- "Enum": [
- "channel",
- "team",
- "user"
- ]
- }
- }
- },
- {
- "Custom": {
- "name": "\"AccessLevel\"",
- "kind": {
- "Enum": [
- "view",
- "comment",
- "edit",
- "owner"
- ]
- }
- }
- }
- ]
- },
- "nullable": []
- },
- "hash": "41de07226ced9b95c7419c9e6d5d9bd9c5890cf1c144f0f8905664cd72c7f132"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-46ffaa1a906d49a47c765c9c03d89e50037adc4b72c364bdb4282ab0c8cf1237.json b/rust/cloud-storage/macro_db_client/.sqlx/query-46ffaa1a906d49a47c765c9c03d89e50037adc4b72c364bdb4282ab0c8cf1237.json
deleted file mode 100644
index c91a76ff52..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-46ffaa1a906d49a47c765c9c03d89e50037adc4b72c364bdb4282ab0c8cf1237.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n DELETE FROM entity_access\n WHERE entity_id = $1 AND entity_type = $2\n AND source_id = ANY($3) AND source_type = 'channel'\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "TextArray"
- ]
- },
- "nullable": []
- },
- "hash": "46ffaa1a906d49a47c765c9c03d89e50037adc4b72c364bdb4282ab0c8cf1237"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-48697f17a7121986cc770d6698fbca7bf107ae20dbadbf64a7799ab162b2feb4.json b/rust/cloud-storage/macro_db_client/.sqlx/query-48697f17a7121986cc770d6698fbca7bf107ae20dbadbf64a7799ab162b2feb4.json
deleted file mode 100644
index 3fdea7e232..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-48697f17a7121986cc770d6698fbca7bf107ae20dbadbf64a7799ab162b2feb4.json
+++ /dev/null
@@ -1,95 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n un.user_id as owner_id,\n un.notification_id,\n n.event_item_id,\n n.event_item_type,\n un.sent,\n un.done,\n un.created_at::timestamptz as \"created_at!\",\n un.seen_at::timestamptz as viewed_at,\n un.created_at::timestamptz as \"updated_at!\",\n un.deleted_at::timestamptz,\n n.metadata as \"notification_metadata: serde_json::Value\",\n n.notification_event_type as notification_event_type,\n n.sender_id as sender_id\n FROM user_notification un\n JOIN notification n ON n.id = un.notification_id\n WHERE un.user_id = $1\n AND un.notification_id = $2\n AND un.deleted_at IS NULL\n LIMIT 1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "owner_id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "notification_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 2,
- "name": "event_item_id",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "event_item_type",
- "type_info": "Text"
- },
- {
- "ordinal": 4,
- "name": "sent",
- "type_info": "Bool"
- },
- {
- "ordinal": 5,
- "name": "done",
- "type_info": "Bool"
- },
- {
- "ordinal": 6,
- "name": "created_at!",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 7,
- "name": "viewed_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 8,
- "name": "updated_at!",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 9,
- "name": "deleted_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 10,
- "name": "notification_metadata: serde_json::Value",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 11,
- "name": "notification_event_type",
- "type_info": "Varchar"
- },
- {
- "ordinal": 12,
- "name": "sender_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- false,
- false,
- false,
- null,
- null,
- null,
- null,
- false,
- false,
- true
- ]
- },
- "hash": "48697f17a7121986cc770d6698fbca7bf107ae20dbadbf64a7799ab162b2feb4"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-4e096eb7d3c507e3647685073fba7b3f36ef0e70c887db31f5cc5a8eb8ee1844.json b/rust/cloud-storage/macro_db_client/.sqlx/query-4e096eb7d3c507e3647685073fba7b3f36ef0e70c887db31f5cc5a8eb8ee1844.json
deleted file mode 100644
index 55fcda1121..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-4e096eb7d3c507e3647685073fba7b3f36ef0e70c887db31f5cc5a8eb8ee1844.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n DELETE FROM user_notification\n WHERE user_id = $1\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "4e096eb7d3c507e3647685073fba7b3f36ef0e70c887db31f5cc5a8eb8ee1844"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-5915728325fe5163ae5f18a99350e0cb5153d368eceb75d03b4cf1adfd1f58bf.json b/rust/cloud-storage/macro_db_client/.sqlx/query-5915728325fe5163ae5f18a99350e0cb5153d368eceb75d03b4cf1adfd1f58bf.json
deleted file mode 100644
index 514e8d9770..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-5915728325fe5163ae5f18a99350e0cb5153d368eceb75d03b4cf1adfd1f58bf.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n \"publicAccessLevel\" as \"access_level!\"\n FROM \"SharePermission\"\n WHERE \"isPublic\" = true\n AND \"publicAccessLevel\" IS NOT NULL\n AND id IN (\n SELECT \"sharePermissionId\" FROM \"ChatPermission\" WHERE \"chatId\" = $1\n )\n\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "access_level!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "5915728325fe5163ae5f18a99350e0cb5153d368eceb75d03b4cf1adfd1f58bf"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-5ffee439386fd24fee2bfa20caa76b882f5be1d44a2a06a71783418fc5ef381b.json b/rust/cloud-storage/macro_db_client/.sqlx/query-5ffee439386fd24fee2bfa20caa76b882f5be1d44a2a06a71783418fc5ef381b.json
deleted file mode 100644
index ac050656e7..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-5ffee439386fd24fee2bfa20caa76b882f5be1d44a2a06a71783418fc5ef381b.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO entity_access (entity_id, entity_type, source_id, source_type, access_level)\n SELECT $1, $2, u.user_id, 'user', $3\n FROM UNNEST($4::text[]) as u(user_id)\n ON CONFLICT (entity_id, entity_type, source_id, source_type)\n WHERE granted_from_project_id IS NULL\n AND access_level != 'owner' -- this prevents us from overriding the owner user\n DO UPDATE SET access_level = EXCLUDED.access_level, updated_at = NOW()\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- {
- "Custom": {
- "name": "\"AccessLevel\"",
- "kind": {
- "Enum": [
- "view",
- "comment",
- "edit",
- "owner"
- ]
- }
- }
- },
- "TextArray"
- ]
- },
- "nullable": []
- },
- "hash": "5ffee439386fd24fee2bfa20caa76b882f5be1d44a2a06a71783418fc5ef381b"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-621186dcec072b603a5f3d7b9e987a1638589d539c60d9dc5c2ab0865ff062d6.json b/rust/cloud-storage/macro_db_client/.sqlx/query-621186dcec072b603a5f3d7b9e987a1638589d539c60d9dc5c2ab0865ff062d6.json
deleted file mode 100644
index d0a749ebd2..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-621186dcec072b603a5f3d7b9e987a1638589d539c60d9dc5c2ab0865ff062d6.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT user_id FROM user_mute_notification\n WHERE user_id = ANY($1)\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "user_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "TextArray"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "621186dcec072b603a5f3d7b9e987a1638589d539c60d9dc5c2ab0865ff062d6"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-625ee33d48768e369ee1fe3abe27811ad04313b1aa31f4b51abe5fd3bf569674.json b/rust/cloud-storage/macro_db_client/.sqlx/query-625ee33d48768e369ee1fe3abe27811ad04313b1aa31f4b51abe5fd3bf569674.json
deleted file mode 100644
index d374c2f79f..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-625ee33d48768e369ee1fe3abe27811ad04313b1aa31f4b51abe5fd3bf569674.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n DELETE FROM user_notification_type_preference\n WHERE user_id = $1 AND notification_event_type = $2\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "625ee33d48768e369ee1fe3abe27811ad04313b1aa31f4b51abe5fd3bf569674"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-63492b018803ce26db5891964a0f52f37d2f54bd8243265c6561f4423af8617c.json b/rust/cloud-storage/macro_db_client/.sqlx/query-63492b018803ce26db5891964a0f52f37d2f54bd8243265c6561f4423af8617c.json
deleted file mode 100644
index 6d97183829..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-63492b018803ce26db5891964a0f52f37d2f54bd8243265c6561f4423af8617c.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO entity_properties (id, entity_id, entity_type, property_definition_id, values)\n SELECT \n u.id,\n u.entity_id,\n 'TASK'::property_entity_type,\n u.property_definition_id,\n NULL\n FROM UNNEST(\n $1::UUID[],\n $2::TEXT[],\n $3::UUID[]\n ) AS u(id, entity_id, property_definition_id)\n ON CONFLICT (entity_id, entity_type, property_definition_id)\n DO NOTHING\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "UuidArray",
- "TextArray",
- "UuidArray"
- ]
- },
- "nullable": []
- },
- "hash": "63492b018803ce26db5891964a0f52f37d2f54bd8243265c6561f4423af8617c"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-63ca13cc79c27b5267ebbf53491b657ca7671e1ab9d1a4691372693a9f9a4ff8.json b/rust/cloud-storage/macro_db_client/.sqlx/query-63ca13cc79c27b5267ebbf53491b657ca7671e1ab9d1a4691372693a9f9a4ff8.json
deleted file mode 100644
index a110bb67c6..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-63ca13cc79c27b5267ebbf53491b657ca7671e1ab9d1a4691372693a9f9a4ff8.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT DISTINCT cp.user_id\n FROM comms_channel_participants cp\n WHERE cp.channel_id = $1 AND cp.left_at IS NULL\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "user_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "63ca13cc79c27b5267ebbf53491b657ca7671e1ab9d1a4691372693a9f9a4ff8"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-7078d46dbcbe1c4201bcb4f63d98400d28bde0e2c3af5211a83a01165f751029.json b/rust/cloud-storage/macro_db_client/.sqlx/query-7078d46dbcbe1c4201bcb4f63d98400d28bde0e2c3af5211a83a01165f751029.json
deleted file mode 100644
index b7e5230b4c..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-7078d46dbcbe1c4201bcb4f63d98400d28bde0e2c3af5211a83a01165f751029.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n DELETE FROM entity_access\n WHERE (source_id = ANY($1) AND source_type = 'channel')\n AND (entity_id = ANY($2) OR granted_from_project_id = ANY($3))\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "TextArray",
- "UuidArray",
- "TextArray"
- ]
- },
- "nullable": []
- },
- "hash": "7078d46dbcbe1c4201bcb4f63d98400d28bde0e2c3af5211a83a01165f751029"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-73c67fbf678e1479d528adcc5bea7da3261d0a04e24cc16f96ec9f2dea3b2e98.json b/rust/cloud-storage/macro_db_client/.sqlx/query-73c67fbf678e1479d528adcc5bea7da3261d0a04e24cc16f96ec9f2dea3b2e98.json
deleted file mode 100644
index 65459bcefd..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-73c67fbf678e1479d528adcc5bea7da3261d0a04e24cc16f96ec9f2dea3b2e98.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT id\n FROM \"User\"\n WHERE email = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "73c67fbf678e1479d528adcc5bea7da3261d0a04e24cc16f96ec9f2dea3b2e98"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-74d33764e454fb9ab4f2775974462d6fdb092bffc720d929de5e7b50ecef5139.json b/rust/cloud-storage/macro_db_client/.sqlx/query-74d33764e454fb9ab4f2775974462d6fdb092bffc720d929de5e7b50ecef5139.json
deleted file mode 100644
index 34382e8725..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-74d33764e454fb9ab4f2775974462d6fdb092bffc720d929de5e7b50ecef5139.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT id, apns_collapse_key as \"apns_collapse_key!: String\"\n FROM notification\n WHERE id = ANY($1) AND apns_collapse_key IS NOT NULL\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "apns_collapse_key!: String",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "UuidArray"
- ]
- },
- "nullable": [
- false,
- true
- ]
- },
- "hash": "74d33764e454fb9ab4f2775974462d6fdb092bffc720d929de5e7b50ecef5139"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-7617f808df94ffe77c8195a911ee6b230a21fe9935e099d1310d244248ca253a.json b/rust/cloud-storage/macro_db_client/.sqlx/query-7617f808df94ffe77c8195a911ee6b230a21fe9935e099d1310d244248ca253a.json
deleted file mode 100644
index 655495fb29..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-7617f808df94ffe77c8195a911ee6b230a21fe9935e099d1310d244248ca253a.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT c.id\n FROM comms_channels c\n INNER JOIN comms_channel_participants cp ON cp.channel_id = c.id\n WHERE cp.user_id = $1 AND cp.left_at IS NULL\n AND c.id = ANY($2::uuid[])\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "UuidArray"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "7617f808df94ffe77c8195a911ee6b230a21fe9935e099d1310d244248ca253a"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-765650cab2b1a1d1abe6ca406438bf48968cebebc7316b87b192d649e096cd67.json b/rust/cloud-storage/macro_db_client/.sqlx/query-765650cab2b1a1d1abe6ca406438bf48968cebebc7316b87b192d649e096cd67.json
deleted file mode 100644
index a8e7326c35..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-765650cab2b1a1d1abe6ca406438bf48968cebebc7316b87b192d649e096cd67.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT user_id FROM user_notification_item_unsubscribe\n WHERE item_id = $1 AND user_id = ANY($2)\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "user_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "TextArray"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "765650cab2b1a1d1abe6ca406438bf48968cebebc7316b87b192d649e096cd67"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-78f1cf9da464937604c1a2d5115c014cab9de72bd88605ff47a316baa2c7acc2.json b/rust/cloud-storage/macro_db_client/.sqlx/query-78f1cf9da464937604c1a2d5115c014cab9de72bd88605ff47a316baa2c7acc2.json
deleted file mode 100644
index 9e6f7f8877..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-78f1cf9da464937604c1a2d5115c014cab9de72bd88605ff47a316baa2c7acc2.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT d.device_endpoint\n FROM notification_user_device_registration d\n WHERE d.device_token = $1\n LIMIT 1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "device_endpoint",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "78f1cf9da464937604c1a2d5115c014cab9de72bd88605ff47a316baa2c7acc2"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-7c0b9d645a85e30577377e4d8c8a8f976e86c6251e12517a2b1e14d525e09198.json b/rust/cloud-storage/macro_db_client/.sqlx/query-7c0b9d645a85e30577377e4d8c8a8f976e86c6251e12517a2b1e14d525e09198.json
deleted file mode 100644
index 721b0038f2..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-7c0b9d645a85e30577377e4d8c8a8f976e86c6251e12517a2b1e14d525e09198.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT user_id, notification_event_type\n FROM user_notification_type_preference\n WHERE user_id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "user_id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "notification_event_type",
- "type_info": "Varchar"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "7c0b9d645a85e30577377e4d8c8a8f976e86c6251e12517a2b1e14d525e09198"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-7ccdaab5873129437c98581ac37eb4148255b83e18fad15349d06c54040fd6cc.json b/rust/cloud-storage/macro_db_client/.sqlx/query-7ccdaab5873129437c98581ac37eb4148255b83e18fad15349d06c54040fd6cc.json
deleted file mode 100644
index a166680895..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-7ccdaab5873129437c98581ac37eb4148255b83e18fad15349d06c54040fd6cc.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO notification (id, notification_event_type, event_item_id, event_item_type, service_sender, metadata, sender_id, apns_collapse_key)\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8)\n ON CONFLICT (id) DO NOTHING\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Varchar",
- "Text",
- "Text",
- "Text",
- "Jsonb",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "7ccdaab5873129437c98581ac37eb4148255b83e18fad15349d06c54040fd6cc"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-86eee52e30e4168f4a7f319d1dcaa59144a5b3269120df892f161c74b5fe7436.json b/rust/cloud-storage/macro_db_client/.sqlx/query-86eee52e30e4168f4a7f319d1dcaa59144a5b3269120df892f161c74b5fe7436.json
deleted file mode 100644
index eab49b91f7..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-86eee52e30e4168f4a7f319d1dcaa59144a5b3269120df892f161c74b5fe7436.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE user_notification\n SET sent = true\n WHERE notification_id = $1 AND user_id = ANY($2)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "TextArray"
- ]
- },
- "nullable": []
- },
- "hash": "86eee52e30e4168f4a7f319d1dcaa59144a5b3269120df892f161c74b5fe7436"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-8d21bf0aa4c20589a55cf5777aa9c658fdacea4d0d0c7070aded12cccd373911.json b/rust/cloud-storage/macro_db_client/.sqlx/query-8d21bf0aa4c20589a55cf5777aa9c658fdacea4d0d0c7070aded12cccd373911.json
deleted file mode 100644
index 505a2bd912..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-8d21bf0aa4c20589a55cf5777aa9c658fdacea4d0d0c7070aded12cccd373911.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE entity_properties\n SET values = $2\n WHERE entity_id = $1\n AND property_definition_id = $3\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Jsonb",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "8d21bf0aa4c20589a55cf5777aa9c658fdacea4d0d0c7070aded12cccd373911"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-92edc80110af7b96f7f908989461a4abb11652671a95454969369a0484ed9239.json b/rust/cloud-storage/macro_db_client/.sqlx/query-92edc80110af7b96f7f908989461a4abb11652671a95454969369a0484ed9239.json
deleted file mode 100644
index a8520fdfd0..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-92edc80110af7b96f7f908989461a4abb11652671a95454969369a0484ed9239.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO notification_message_receipt (message_id, user_id, notification_id)\n VALUES ($1, $2, $3)\n ON CONFLICT (message_id) DO NOTHING\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "92edc80110af7b96f7f908989461a4abb11652671a95454969369a0484ed9239"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-94c019227741f6c4fe8411454cb7c0a3a97e5594c29f11fa893238656e161ff1.json b/rust/cloud-storage/macro_db_client/.sqlx/query-94c019227741f6c4fe8411454cb7c0a3a97e5594c29f11fa893238656e161ff1.json
deleted file mode 100644
index 4035617965..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-94c019227741f6c4fe8411454cb7c0a3a97e5594c29f11fa893238656e161ff1.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE user_notification\n SET deleted_at = NOW()\n WHERE user_id = $1 AND notification_id = $2\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "94c019227741f6c4fe8411454cb7c0a3a97e5594c29f11fa893238656e161ff1"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-9cd40fbb1ade51e9e0d49792839d1a363cada017252a6f653c2272608189bcc4.json b/rust/cloud-storage/macro_db_client/.sqlx/query-9cd40fbb1ade51e9e0d49792839d1a363cada017252a6f653c2272608189bcc4.json
deleted file mode 100644
index 9d717fa5f9..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-9cd40fbb1ade51e9e0d49792839d1a363cada017252a6f653c2272608189bcc4.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT property_definition_id, values\n FROM entity_properties\n WHERE entity_id = $1\n AND entity_type = 'TASK'\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "property_definition_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "values",
- "type_info": "Jsonb"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- true
- ]
- },
- "hash": "9cd40fbb1ade51e9e0d49792839d1a363cada017252a6f653c2272608189bcc4"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-a0046a263c572915a8e14a8ac70479f1ba89549f1930f571bf278fcfe259cfd1.json b/rust/cloud-storage/macro_db_client/.sqlx/query-a0046a263c572915a8e14a8ac70479f1ba89549f1930f571bf278fcfe259cfd1.json
deleted file mode 100644
index ad14cfedba..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-a0046a263c572915a8e14a8ac70479f1ba89549f1930f571bf278fcfe259cfd1.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT user_id, device_endpoint, device_type as \"device_type: DbDeviceType\"\n FROM notification_user_device_registration\n WHERE user_id = ANY($1)\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "user_id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "device_endpoint",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "device_type: DbDeviceType",
- "type_info": {
- "Custom": {
- "name": "notification_device_type_option",
- "kind": {
- "Enum": [
- "ios",
- "android"
- ]
- }
- }
- }
- }
- ],
- "parameters": {
- "Left": [
- "TextArray"
- ]
- },
- "nullable": [
- false,
- false,
- false
- ]
- },
- "hash": "a0046a263c572915a8e14a8ac70479f1ba89549f1930f571bf278fcfe259cfd1"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-a5d9f358b5382c0eaed918f903bc6aa328f527e6e47d649c37dfcf1c9f3a7139.json b/rust/cloud-storage/macro_db_client/.sqlx/query-a5d9f358b5382c0eaed918f903bc6aa328f527e6e47d649c37dfcf1c9f3a7139.json
deleted file mode 100644
index 7626c0a06b..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-a5d9f358b5382c0eaed918f903bc6aa328f527e6e47d649c37dfcf1c9f3a7139.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE user_notification\n SET seen_at = NOW()\n WHERE user_id = $1 AND notification_id = ANY($2)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "UuidArray"
- ]
- },
- "nullable": []
- },
- "hash": "a5d9f358b5382c0eaed918f903bc6aa328f527e6e47d649c37dfcf1c9f3a7139"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-a94e5ac730ba6bdb11e9b27b11babb1552e787c0920e1102882acc4381245f24.json b/rust/cloud-storage/macro_db_client/.sqlx/query-a94e5ac730ba6bdb11e9b27b11babb1552e787c0920e1102882acc4381245f24.json
deleted file mode 100644
index f214362a1f..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-a94e5ac730ba6bdb11e9b27b11babb1552e787c0920e1102882acc4381245f24.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT access_level FROM (\n -- Source 1: entity_access source_id match\n SELECT\n access_level::text FROM entity_access\n WHERE entity_id = $1\n AND entity_type = 'call'\n AND source_id = ANY($2)\n\n UNION ALL\n -- Source 2: items share permission\n SELECT\n \"publicAccessLevel\" as \"access_level!\"\n FROM \"SharePermission\"\n WHERE id in (\n SELECT share_permission_id\n FROM calls\n WHERE id = $1\n UNION ALL\n SELECT share_permission_id\n FROM call_records\n WHERE id = $1\n LIMIT 1\n )\n AND \"isPublic\" = true\n AND \"publicAccessLevel\" IS NOT NULL\n )\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "access_level",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "TextArray"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "a94e5ac730ba6bdb11e9b27b11babb1552e787c0920e1102882acc4381245f24"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-ac30668bed9f5d19db9e0a0cacda6ee156a13fae34c5ccb129794c9d16e95e10.json b/rust/cloud-storage/macro_db_client/.sqlx/query-ac30668bed9f5d19db9e0a0cacda6ee156a13fae34c5ccb129794c9d16e95e10.json
deleted file mode 100644
index b0fb258d2d..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-ac30668bed9f5d19db9e0a0cacda6ee156a13fae34c5ccb129794c9d16e95e10.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT l.macro_id\n FROM email_threads et\n JOIN email_links l ON et.link_id = l.id\n WHERE et.id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "macro_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "ac30668bed9f5d19db9e0a0cacda6ee156a13fae34c5ccb129794c9d16e95e10"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-b1ca353c3b2a80e3dadf3415cc79d4a08684a7a76ecaf47edfc5bedf5a0e1815.json b/rust/cloud-storage/macro_db_client/.sqlx/query-b1ca353c3b2a80e3dadf3415cc79d4a08684a7a76ecaf47edfc5bedf5a0e1815.json
deleted file mode 100644
index aa74e2b98b..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-b1ca353c3b2a80e3dadf3415cc79d4a08684a7a76ecaf47edfc5bedf5a0e1815.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT access_level FROM (\n -- Source 1: entity_access source_id match\n SELECT\n access_level::text FROM entity_access\n WHERE entity_id = $1\n AND entity_type = 'email_thread'\n AND source_id = ANY($2)\n\n UNION ALL\n -- Source 2: items share permission\n SELECT\n \"publicAccessLevel\" as \"access_level!\"\n FROM \"SharePermission\"\n WHERE \"isPublic\" = true\n AND \"publicAccessLevel\" IS NOT NULL\n AND id IN (\n SELECT \"sharePermissionId\" FROM \"EmailThreadPermission\" WHERE \"threadId\" = $3\n )\n )\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "access_level",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "TextArray",
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "b1ca353c3b2a80e3dadf3415cc79d4a08684a7a76ecaf47edfc5bedf5a0e1815"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-b3f9f3696438bd2ad8754650d87d7bbf32e70d3d173a748a07eacdb4e42841eb.json b/rust/cloud-storage/macro_db_client/.sqlx/query-b3f9f3696438bd2ad8754650d87d7bbf32e70d3d173a748a07eacdb4e42841eb.json
deleted file mode 100644
index e5d913399d..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-b3f9f3696438bd2ad8754650d87d7bbf32e70d3d173a748a07eacdb4e42841eb.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO notification_user_device_registration (id, user_id, device_token, device_endpoint, device_type)\n VALUES ($1, $2, $3, $4, $5)\n ON CONFLICT (device_endpoint) DO UPDATE SET user_id = $2, device_token = $3, device_type = $5, updated_at = NOW()\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text",
- "Text",
- {
- "Custom": {
- "name": "notification_device_type_option",
- "kind": {
- "Enum": [
- "ios",
- "android"
- ]
- }
- }
- }
- ]
- },
- "nullable": []
- },
- "hash": "b3f9f3696438bd2ad8754650d87d7bbf32e70d3d173a748a07eacdb4e42841eb"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-b56786cafd46e138a172ca008f6586c551794b50c95616b56b7c94ac7c2d4524.json b/rust/cloud-storage/macro_db_client/.sqlx/query-b56786cafd46e138a172ca008f6586c551794b50c95616b56b7c94ac7c2d4524.json
deleted file mode 100644
index be13d76b25..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-b56786cafd46e138a172ca008f6586c551794b50c95616b56b7c94ac7c2d4524.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT access_level FROM (\n -- Source 1: entity_access source_id match\n SELECT\n access_level::text FROM entity_access\n WHERE entity_id = $1\n AND entity_type = 'document'\n AND source_id = ANY($2)\n\n UNION ALL\n -- Source 2: items share permission\n SELECT\n \"publicAccessLevel\" as \"access_level!\"\n FROM \"SharePermission\"\n WHERE \"isPublic\" = true\n AND \"publicAccessLevel\" IS NOT NULL\n AND id IN (\n SELECT \"sharePermissionId\" FROM \"DocumentPermission\" WHERE \"documentId\" = $3\n ) \n )\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "access_level",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "TextArray",
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "b56786cafd46e138a172ca008f6586c551794b50c95616b56b7c94ac7c2d4524"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-b6705d3675950d0bbbd4a0ba10f7716a24694cfd98741fc0508d607684b1c8a9.json b/rust/cloud-storage/macro_db_client/.sqlx/query-b6705d3675950d0bbbd4a0ba10f7716a24694cfd98741fc0508d607684b1c8a9.json
deleted file mode 100644
index 1168d26a34..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-b6705d3675950d0bbbd4a0ba10f7716a24694cfd98741fc0508d607684b1c8a9.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE notification_message_receipt\n SET failed = true, failed_at = NOW()\n WHERE message_id = $1\n RETURNING user_id, notification_id\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "user_id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "notification_id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "b6705d3675950d0bbbd4a0ba10f7716a24694cfd98741fc0508d607684b1c8a9"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-b9fc3c761760c8e3d0013e064f23a9ad1f17396c8f5f91e9cc27e2ba9ba02157.json b/rust/cloud-storage/macro_db_client/.sqlx/query-b9fc3c761760c8e3d0013e064f23a9ad1f17396c8f5f91e9cc27e2ba9ba02157.json
deleted file mode 100644
index d560cb7eb3..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-b9fc3c761760c8e3d0013e064f23a9ad1f17396c8f5f91e9cc27e2ba9ba02157.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT access_level FROM (\n -- Source 1: entity_access source_id match\n SELECT\n access_level::text FROM entity_access\n WHERE entity_id = $1\n AND entity_type = 'chat'\n AND source_id = ANY($2)\n\n UNION ALL\n -- Source 2: items share permission\n SELECT\n \"publicAccessLevel\" as \"access_level!\"\n FROM \"SharePermission\"\n WHERE \"isPublic\" = true\n AND \"publicAccessLevel\" IS NOT NULL\n AND id IN (\n SELECT \"sharePermissionId\" FROM \"ChatPermission\" WHERE \"chatId\" = $3\n )\n )\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "access_level",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "TextArray",
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "b9fc3c761760c8e3d0013e064f23a9ad1f17396c8f5f91e9cc27e2ba9ba02157"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-bdb882d426cf81329dd6d824a5d945cfd0ea2fffa26b5324ef641dfe3e304682.json b/rust/cloud-storage/macro_db_client/.sqlx/query-bdb882d426cf81329dd6d824a5d945cfd0ea2fffa26b5324ef641dfe3e304682.json
deleted file mode 100644
index 3ed3f3db5e..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-bdb882d426cf81329dd6d824a5d945cfd0ea2fffa26b5324ef641dfe3e304682.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n \"publicAccessLevel\" as \"access_level!\"\n FROM \"SharePermission\"\n WHERE id in (SELECT share_permission_id\n FROM calls\n WHERE id = $1\n UNION ALL\n SELECT share_permission_id\n FROM call_records\n WHERE id = $1\n LIMIT 1)\n AND \"isPublic\" = true\n AND \"publicAccessLevel\" IS NOT NULL\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "access_level!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "bdb882d426cf81329dd6d824a5d945cfd0ea2fffa26b5324ef641dfe3e304682"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-c8f152fcf66d2a28cb74bd5e5bd00494b195ba6fa890f7ed840a04dc49088476.json b/rust/cloud-storage/macro_db_client/.sqlx/query-c8f152fcf66d2a28cb74bd5e5bd00494b195ba6fa890f7ed840a04dc49088476.json
deleted file mode 100644
index 1216b39a3c..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-c8f152fcf66d2a28cb74bd5e5bd00494b195ba6fa890f7ed840a04dc49088476.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT access_level FROM (\n -- Source 1: entity_access source_id match\n SELECT\n access_level::text FROM entity_access\n WHERE entity_id = $1\n AND entity_type = 'project'\n AND source_id = ANY($2)\n\n UNION ALL\n -- Source 2: items share permission\n SELECT\n \"publicAccessLevel\" as \"access_level!\"\n FROM \"SharePermission\"\n WHERE \"isPublic\" = true\n AND \"publicAccessLevel\" IS NOT NULL\n AND id IN (\n SELECT \"sharePermissionId\" FROM \"ProjectPermission\" WHERE \"projectId\" = $3\n )\n )\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "access_level",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "TextArray",
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "c8f152fcf66d2a28cb74bd5e5bd00494b195ba6fa890f7ed840a04dc49088476"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-cac5e246875c3539f7a03cee8271708be47a56582c2f0323716f206ab905a580.json b/rust/cloud-storage/macro_db_client/.sqlx/query-cac5e246875c3539f7a03cee8271708be47a56582c2f0323716f206ab905a580.json
deleted file mode 100644
index ddcaf87146..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-cac5e246875c3539f7a03cee8271708be47a56582c2f0323716f206ab905a580.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT cp.channel_id::text FROM comms_channel_participants cp\n WHERE cp.user_id = $1 AND cp.left_at IS NULL\n UNION ALL\n SELECT t.team_id::text FROM team_user t\n WHERE t.user_id = $1\n UNION ALL\n SELECT $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "channel_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "cac5e246875c3539f7a03cee8271708be47a56582c2f0323716f206ab905a580"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-d20bc5b5dfecf0a2ef4b7d77b9090ad28584cd0a1fd24460096b6a5097a870ac.json b/rust/cloud-storage/macro_db_client/.sqlx/query-d20bc5b5dfecf0a2ef4b7d77b9090ad28584cd0a1fd24460096b6a5097a870ac.json
deleted file mode 100644
index f3780614e0..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-d20bc5b5dfecf0a2ef4b7d77b9090ad28584cd0a1fd24460096b6a5097a870ac.json
+++ /dev/null
@@ -1,97 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n un.user_id as owner_id,\n un.notification_id,\n n.event_item_id,\n n.event_item_type,\n un.sent,\n un.done,\n un.created_at::timestamptz as \"created_at!\",\n un.seen_at::timestamptz as viewed_at,\n un.created_at::timestamptz as \"updated_at!\",\n un.deleted_at::timestamptz,\n n.metadata as \"notification_metadata: serde_json::Value\",\n n.notification_event_type as notification_event_type,\n n.sender_id as sender_id\n FROM user_notification un\n JOIN notification n ON n.id = un.notification_id\n WHERE un.user_id = $1\n AND un.deleted_at IS NULL\n AND un.done = false\n AND (($3::timestamptz IS NULL)\n OR (un.created_at, un.notification_id) < ($3, $4))\n ORDER BY un.created_at DESC, un.notification_id DESC\n LIMIT $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "owner_id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "notification_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 2,
- "name": "event_item_id",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "event_item_type",
- "type_info": "Text"
- },
- {
- "ordinal": 4,
- "name": "sent",
- "type_info": "Bool"
- },
- {
- "ordinal": 5,
- "name": "done",
- "type_info": "Bool"
- },
- {
- "ordinal": 6,
- "name": "created_at!",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 7,
- "name": "viewed_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 8,
- "name": "updated_at!",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 9,
- "name": "deleted_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 10,
- "name": "notification_metadata: serde_json::Value",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 11,
- "name": "notification_event_type",
- "type_info": "Varchar"
- },
- {
- "ordinal": 12,
- "name": "sender_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Int8",
- "Timestamptz",
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- false,
- false,
- false,
- null,
- null,
- null,
- null,
- false,
- false,
- true
- ]
- },
- "hash": "d20bc5b5dfecf0a2ef4b7d77b9090ad28584cd0a1fd24460096b6a5097a870ac"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-db297e24e3ed1e94c27121977d81813bbe4cde5e5b7bec42e424c72db0e27e73.json b/rust/cloud-storage/macro_db_client/.sqlx/query-db297e24e3ed1e94c27121977d81813bbe4cde5e5b7bec42e424c72db0e27e73.json
deleted file mode 100644
index d197caf563..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-db297e24e3ed1e94c27121977d81813bbe4cde5e5b7bec42e424c72db0e27e73.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT user_id FROM user_notification_type_preference\n WHERE notification_event_type = $1 AND user_id = ANY($2)\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "user_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "TextArray"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "db297e24e3ed1e94c27121977d81813bbe4cde5e5b7bec42e424c72db0e27e73"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-e08bcee71072e0e693b1b3f2df39a2b9574f45847919251446878f32b9febbc2.json b/rust/cloud-storage/macro_db_client/.sqlx/query-e08bcee71072e0e693b1b3f2df39a2b9574f45847919251446878f32b9febbc2.json
deleted file mode 100644
index f47413e3dc..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-e08bcee71072e0e693b1b3f2df39a2b9574f45847919251446878f32b9febbc2.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n WITH RECURSIVE parent_projects AS (\n -- Base case: the project itself\n SELECT id, name, \"parentId\"\n FROM \"Project\"\n WHERE id = $1\n\n UNION ALL\n\n -- Recursive case: walk up to the parent\n SELECT p.id, p.name, p.\"parentId\"\n FROM \"Project\" p\n INNER JOIN parent_projects pp ON p.id = pp.\"parentId\"\n )\n SELECT id as \"id!\"\n FROM parent_projects\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "e08bcee71072e0e693b1b3f2df39a2b9574f45847919251446878f32b9febbc2"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-e35594f0b886c9eaba037a0b13ccb3baf21cd37b638190889fb5383180a8e437.json b/rust/cloud-storage/macro_db_client/.sqlx/query-e35594f0b886c9eaba037a0b13ccb3baf21cd37b638190889fb5383180a8e437.json
deleted file mode 100644
index 3ac1b029f6..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-e35594f0b886c9eaba037a0b13ccb3baf21cd37b638190889fb5383180a8e437.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n \"publicAccessLevel\" as \"access_level!\"\n FROM \"SharePermission\"\n WHERE \"isPublic\" = true\n AND \"publicAccessLevel\" IS NOT NULL\n AND id IN (\n SELECT \"sharePermissionId\" FROM \"EmailThreadPermission\" WHERE \"threadId\" = $1\n )\n\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "access_level!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "e35594f0b886c9eaba037a0b13ccb3baf21cd37b638190889fb5383180a8e437"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-efc740cd935fb67ef5c2a75b3c37cf16bf09d6e52e5f6e5c5b107ef8244a141d.json b/rust/cloud-storage/macro_db_client/.sqlx/query-efc740cd935fb67ef5c2a75b3c37cf16bf09d6e52e5f6e5c5b107ef8244a141d.json
deleted file mode 100644
index 1cbb49a96b..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-efc740cd935fb67ef5c2a75b3c37cf16bf09d6e52e5f6e5c5b107ef8244a141d.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO user_notification (notification_id, user_id)\n SELECT $1, user_id\n FROM UNNEST($2::text[]) as user_id\n RETURNING created_at::timestamptz as \"created_at!\"\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "created_at!",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "TextArray"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "efc740cd935fb67ef5c2a75b3c37cf16bf09d6e52e5f6e5c5b107ef8244a141d"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-f2d5d7aea9918978cd69c14f8afe24156c2fa387e001ee8eaf57e4a70a106069.json b/rust/cloud-storage/macro_db_client/.sqlx/query-f2d5d7aea9918978cd69c14f8afe24156c2fa387e001ee8eaf57e4a70a106069.json
deleted file mode 100644
index 182e0858ba..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-f2d5d7aea9918978cd69c14f8afe24156c2fa387e001ee8eaf57e4a70a106069.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO entity_properties (id, entity_id, entity_type, property_definition_id, values)\n SELECT \n u.id,\n u.entity_id,\n u.entity_type::property_entity_type,\n u.property_definition_id,\n u.values\n FROM UNNEST(\n $1::UUID[],\n $2::TEXT[],\n $3::TEXT[],\n $4::UUID[],\n $5::JSONB[]\n ) AS u(id, entity_id, entity_type, property_definition_id, values)\n ON CONFLICT (entity_id, entity_type, property_definition_id)\n DO UPDATE SET \n values = EXCLUDED.values,\n updated_at = NOW()\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "UuidArray",
- "TextArray",
- "TextArray",
- "UuidArray",
- "JsonbArray"
- ]
- },
- "nullable": []
- },
- "hash": "f2d5d7aea9918978cd69c14f8afe24156c2fa387e001ee8eaf57e4a70a106069"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-f3e53dd531be738b881df199783a2beded3bd378038cbd6f012080ac77c5291b.json b/rust/cloud-storage/macro_db_client/.sqlx/query-f3e53dd531be738b881df199783a2beded3bd378038cbd6f012080ac77c5291b.json
deleted file mode 100644
index 39180b3b0f..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-f3e53dd531be738b881df199783a2beded3bd378038cbd6f012080ac77c5291b.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE user_notification\n SET deleted_at = NOW()\n WHERE user_id = $1 AND notification_id = ANY($2)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "UuidArray"
- ]
- },
- "nullable": []
- },
- "hash": "f3e53dd531be738b881df199783a2beded3bd378038cbd6f012080ac77c5291b"
-}
diff --git a/rust/cloud-storage/macro_db_client/.sqlx/query-f6a7499d3079d346afe5d866734ffc5d4ac3f9f1a8c2a5714ef130e53d11145f.json b/rust/cloud-storage/macro_db_client/.sqlx/query-f6a7499d3079d346afe5d866734ffc5d4ac3f9f1a8c2a5714ef130e53d11145f.json
deleted file mode 100644
index c718076a09..0000000000
--- a/rust/cloud-storage/macro_db_client/.sqlx/query-f6a7499d3079d346afe5d866734ffc5d4ac3f9f1a8c2a5714ef130e53d11145f.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n WITH RECURSIVE child_projects AS (\n SELECT id FROM \"Project\" WHERE id = $1\n\n UNION ALL\n\n SELECT p.id FROM \"Project\" p\n INNER JOIN child_projects cp ON p.\"parentId\" = cp.id\n )\n SELECT id as \"entity_id!\", 'project' as \"entity_type!\" FROM child_projects\n\n UNION ALL\n\n SELECT d.id as \"entity_id!\", 'document' as \"entity_type!\" FROM \"Document\" d\n WHERE d.\"projectId\" IN (SELECT id FROM child_projects)\n\n UNION ALL\n\n SELECT c.id as \"entity_id!\", 'chat' as \"entity_type!\" FROM \"Chat\" c\n WHERE c.\"projectId\" IN (SELECT id FROM child_projects)\n\n UNION ALL\n\n SELECT et.id::text as \"entity_id!\", 'email_thread' as \"entity_type!\" FROM email_threads et\n WHERE et.project_id IN (SELECT id FROM child_projects)\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "entity_id!",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "entity_type!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null,
- null
- ]
- },
- "hash": "f6a7499d3079d346afe5d866734ffc5d4ac3f9f1a8c2a5714ef130e53d11145f"
-}
diff --git a/rust/cloud-storage/macro_db_client/migrations/20260424120000_call_participants_one_active_per_user.sql b/rust/cloud-storage/macro_db_client/migrations/20260424120000_call_participants_one_active_per_user.sql
new file mode 100644
index 0000000000..0d7ae5ff5d
--- /dev/null
+++ b/rust/cloud-storage/macro_db_client/migrations/20260424120000_call_participants_one_active_per_user.sql
@@ -0,0 +1,7 @@
+-- Enforce that a user can only be an active participant in one call at a time.
+-- Historical rows (left_at IS NOT NULL) are excluded, so users can freely
+-- leave one call and join another.
+
+CREATE UNIQUE INDEX IF NOT EXISTS call_participants_one_active_per_user
+ ON call_participants (user_id)
+ WHERE left_at IS NULL;