db: CREATE INDEX IF NOT EXISTS

This commit is contained in:
Astro 2022-12-20 00:37:16 +01:00
parent 6693a7a10e
commit 74017d3176
2 changed files with 1 additions and 2 deletions

View file

@ -35,7 +35,6 @@ impl Actor {
actor_type: "Service".to_string(), actor_type: "Service".to_string(),
id: self.uri(), id: self.uri(),
inbox: self.uri(), inbox: self.uri(),
// outbox: "https://relay.fedi.buzz/outbox".to_string(),
public_key: activitypub::ActorPublicKey { public_key: activitypub::ActorPublicKey {
id: self.key_id(), id: self.key_id(),
owner: Some(self.uri()), owner: Some(self.uri()),

View file

@ -5,7 +5,7 @@ use tokio_postgres::{Client, Error, NoTls, Statement};
const CREATE_SCHEMA_COMMANDS: &[&str] = &[ const CREATE_SCHEMA_COMMANDS: &[&str] = &[
"CREATE TABLE IF NOT EXISTS follows (id TEXT, inbox TEXT, actor TEXT, UNIQUE (inbox, actor))", "CREATE TABLE IF NOT EXISTS follows (id TEXT, inbox TEXT, actor TEXT, UNIQUE (inbox, actor))",
"CREATE INDEX ON follows (actor) INCLUDE (inbox)", "CREATE INDEX IF NOT EXISTS ON follows (actor) INCLUDE (inbox)",
]; ];
#[derive(Clone)] #[derive(Clone)]