mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-26 21:01:34 +00:00
make column mandatory
This commit is contained in:
parent
1e9cb61002
commit
fb7782ce12
5 changed files with 11 additions and 9 deletions
|
@ -877,7 +877,7 @@ diesel::table! {
|
||||||
send_community_followers_of -> Nullable<Int4>,
|
send_community_followers_of -> Nullable<Int4>,
|
||||||
send_all_instances -> Bool,
|
send_all_instances -> Bool,
|
||||||
actor_type -> ActorTypeEnum,
|
actor_type -> ActorTypeEnum,
|
||||||
actor_apub_id -> Nullable<Text>,
|
actor_apub_id -> Text,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ pub struct SentActivity {
|
||||||
pub send_community_followers_of: Option<CommunityId>,
|
pub send_community_followers_of: Option<CommunityId>,
|
||||||
pub send_all_instances: bool,
|
pub send_all_instances: bool,
|
||||||
pub actor_type: ActorType,
|
pub actor_type: ActorType,
|
||||||
pub actor_apub_id: Option<DbUrl>,
|
pub actor_apub_id: DbUrl,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "full", derive(Insertable))]
|
#[cfg_attr(feature = "full", derive(Insertable))]
|
||||||
|
|
|
@ -188,13 +188,13 @@ impl InstanceWorker {
|
||||||
self.state.last_successful_published_time = Some(activity.published);
|
self.state.last_successful_published_time = Some(activity.published);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
// TODO: make db column not null
|
let actor = get_actor_cached(
|
||||||
let Some(actor_apub_id) = &activity.actor_apub_id else {
|
&mut self.context.pool(),
|
||||||
return Ok(()); // activity was inserted before persistent queue was activated
|
activity.actor_type,
|
||||||
};
|
&activity.actor_apub_id,
|
||||||
let actor = get_actor_cached(&mut self.context.pool(), activity.actor_type, actor_apub_id)
|
)
|
||||||
.await
|
.await
|
||||||
.context("failed getting actor instance (was it marked deleted / removed?)")?;
|
.context("failed getting actor instance (was it marked deleted / removed?)")?;
|
||||||
|
|
||||||
let object = WithContext::new(object.clone(), FEDERATION_CONTEXT.deref().clone());
|
let object = WithContext::new(object.clone(), FEDERATION_CONTEXT.deref().clone());
|
||||||
let inbox_urls = inbox_urls.into_iter().collect();
|
let inbox_urls = inbox_urls.into_iter().collect();
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
ALTER TABLE sent_activity ALTER COLUMN actor_apub_id DROP NOT NULL;
|
|
@ -0,0 +1 @@
|
||||||
|
ALTER TABLE sent_activity ALTER COLUMN actor_apub_id SET NOT NULL;
|
Loading…
Reference in a new issue