// Import week days and WeekDay
use diesel::{sql_query, PgConnection, RunQueryDsl};
use lemmy_db_schema::{source::activity::Activity, utils::DbPool};
-use lemmy_utils::LemmyError;
+use lemmy_utils::error::LemmyError;
use std::{thread, time::Duration};
use tracing::info;
active_counts(&conn);
update_banned_when_expired(&conn);
reindex_aggregates_tables(&conn, true);
+ drop_ccnew_indexes(&conn);
});
let conn = pool.get()?;
.execute(conn)
.expect("update banned when expires");
}
+
+/// Drops the phantom CCNEW indexes created by postgres
+/// https://github.com/LemmyNet/lemmy/issues/2431
+fn drop_ccnew_indexes(conn: &PgConnection) {
+ info!("Dropping phantom ccnew indexes...");
+ let drop_stmt = "select drop_ccnew_indexes()";
+ sql_query(drop_stmt)
+ .execute(conn)
+ .expect("drop ccnew indexes");
+}