TextExpressionMethods,
};
use diesel_async::RunQueryDsl;
-use lemmy_api_common::lemmy_db_views::structs::SiteView;
-use lemmy_apub::{
+use lemmy_api_common::{
generate_followers_url,
generate_inbox_url,
generate_local_apub_endpoint,
generate_shared_inbox_url,
generate_site_inbox_url,
+ lemmy_db_views::structs::SiteView,
EndpointType,
};
use lemmy_db_schema::{
pool: &DbPool,
protocol_and_hostname: &str,
) -> Result<(), LemmyError> {
- use lemmy_db_schema::schema::person::dsl::*;
+ use lemmy_db_schema::schema::person::dsl::{actor_id, local, person};
let conn = &mut get_conn(pool).await?;
info!("Running user_updates_2020_04_02");
pool: &DbPool,
protocol_and_hostname: &str,
) -> Result<(), LemmyError> {
- use lemmy_db_schema::schema::community::dsl::*;
+ use lemmy_db_schema::schema::community::dsl::{actor_id, community, local};
let conn = &mut get_conn(pool).await?;
info!("Running community_updates_2020_04_02");
)?;
let form = CommunityUpdateForm::builder()
- .actor_id(Some(community_actor_id.to_owned()))
+ .actor_id(Some(community_actor_id.clone()))
.private_key(Some(Some(keypair.private_key)))
.public_key(Some(keypair.public_key))
.last_refreshed_at(Some(naive_now()))
pool: &DbPool,
protocol_and_hostname: &str,
) -> Result<(), LemmyError> {
- use lemmy_db_schema::schema::post::dsl::*;
+ use lemmy_db_schema::schema::post::dsl::{ap_id, local, post};
let conn = &mut get_conn(pool).await?;
info!("Running post_updates_2020_04_03");
pool: &DbPool,
protocol_and_hostname: &str,
) -> Result<(), LemmyError> {
- use lemmy_db_schema::schema::comment::dsl::*;
+ use lemmy_db_schema::schema::comment::dsl::{ap_id, comment, local};
let conn = &mut get_conn(pool).await?;
info!("Running comment_updates_2020_04_03");
pool: &DbPool,
protocol_and_hostname: &str,
) -> Result<(), LemmyError> {
- use lemmy_db_schema::schema::private_message::dsl::*;
+ use lemmy_db_schema::schema::private_message::dsl::{ap_id, local, private_message};
let conn = &mut get_conn(pool).await?;
info!("Running private_message_updates_2020_05_05");
pool: &DbPool,
protocol_and_hostname: &str,
) -> Result<(), LemmyError> {
- use lemmy_db_schema::schema::post::dsl::*;
+ use lemmy_db_schema::schema::post::dsl::{post, thumbnail_url};
let conn = &mut get_conn(pool).await?;
info!("Running post_thumbnail_url_updates_2020_07_27");
let conn = &mut get_conn(pool).await?;
info!("Running apub_columns_2021_02_02");
{
- use lemmy_db_schema::schema::person::dsl::*;
+ use lemmy_db_schema::schema::person::dsl::{inbox_url, person, shared_inbox_url};
let persons = person
.filter(inbox_url.like("http://changeme%"))
.load::<Person>(conn)
}
{
- use lemmy_db_schema::schema::community::dsl::*;
+ use lemmy_db_schema::schema::community::dsl::{
+ community,
+ followers_url,
+ inbox_url,
+ shared_inbox_url,
+ };
let communities = community
.filter(inbox_url.like("http://changeme%"))
.load::<Community>(conn)
{
// update communities with empty pubkey
- use lemmy_db_schema::schema::community::dsl::*;
+ use lemmy_db_schema::schema::community::dsl::{community, local, public_key};
let communities: Vec<Community> = community
.filter(local.eq(true))
.filter(public_key.eq(""))
{
// update persons with empty pubkey
- use lemmy_db_schema::schema::person::dsl::*;
+ use lemmy_db_schema::schema::person::dsl::{local, person, public_key};
let persons = person
.filter(local.eq(true))
.filter(public_key.eq(""))
// Register the user if there's a site setup
let person_form = PersonInsertForm::builder()
- .name(setup.admin_username.to_owned())
+ .name(setup.admin_username.clone())
.admin(Some(true))
.instance_id(instance.id)
.actor_id(Some(person_actor_id.clone()))
let local_user_form = LocalUserInsertForm::builder()
.person_id(person_inserted.id)
- .password_encrypted(setup.admin_password.to_owned())
- .email(setup.admin_email.to_owned())
+ .password_encrypted(setup.admin_password.clone())
+ .email(setup.admin_email.clone())
.build();
LocalUser::create(pool, &local_user_form).await?;
};
.name(
settings
.setup
- .to_owned()
+ .clone()
.map(|s| s.site_name)
.unwrap_or_else(|| "New Site".to_string()),
)