From bcfd71eb0666bd7bb8bb2691f8e4bac43787ade2 Mon Sep 17 00:00:00 2001 From: alemi Date: Sun, 26 May 2024 18:41:27 +0200 Subject: [PATCH] fix: index relations by activity too since the only way to find them is via the activity that generated them --- .../m20240524_000002_create_relations_likes_shares.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/migrations/m20240524_000002_create_relations_likes_shares.rs b/src/migrations/m20240524_000002_create_relations_likes_shares.rs index fbd8504..36a8bdc 100644 --- a/src/migrations/m20240524_000002_create_relations_likes_shares.rs +++ b/src/migrations/m20240524_000002_create_relations_likes_shares.rs @@ -96,6 +96,10 @@ impl MigrationTrait for Migration { .create_index(Index::create().name("index-relations-following").table(Relations::Table).col(Relations::Following).to_owned()) .await?; + manager + .create_index(Index::create().name("index-relations-activity").table(Relations::Table).col(Relations::Activity).to_owned()) + .await?; + manager .create_table( Table::create() @@ -209,6 +213,10 @@ impl MigrationTrait for Migration { .drop_index(Index::drop().name("index-relations-following").table(Relations::Table).to_owned()) .await?; + manager + .drop_index(Index::drop().name("index-relations-activity").table(Relations::Table).to_owned()) + .await?; + manager .drop_table(Table::drop().table(Likes::Table).to_owned()) .await?;