From 93666cea974c77dd9500d4c2600102a68c904e2d Mon Sep 17 00:00:00 2001 From: alemi Date: Thu, 6 Jun 2024 02:29:13 +0200 Subject: [PATCH] fix(migrations): indexes get dropped with tables --- ...001_create_actor_activity_object_tables.rs | 55 ------------------- ...24_000002_create_relations_likes_shares.rs | 29 ---------- ...524_000003_create_users_auth_and_config.rs | 12 ---- ...524_000004_create_addressing_deliveries.rs | 20 ------- ...000005_create_attachments_tags_mentions.rs | 22 -------- .../src/m20240605_000001_add_jobs_table.rs | 12 ---- 6 files changed, 150 deletions(-) diff --git a/upub/migrations/src/m20240524_000001_create_actor_activity_object_tables.rs b/upub/migrations/src/m20240524_000001_create_actor_activity_object_tables.rs index d840c983..abe21fd2 100644 --- a/upub/migrations/src/m20240524_000001_create_actor_activity_object_tables.rs +++ b/upub/migrations/src/m20240524_000001_create_actor_activity_object_tables.rs @@ -321,73 +321,18 @@ impl MigrationTrait for Migration { .drop_table(Table::drop().table(Actors::Table).to_owned()) .await?; - manager - .drop_index(Index::drop().name("index-actors-id").table(Actors::Table).to_owned()) - .await?; - - manager - .drop_index(Index::drop().name("index-actors-preferred-username").table(Actors::Table).to_owned()) - .await?; - - manager - .drop_index(Index::drop().name("index-actors-domain").table(Actors::Table).to_owned()) - .await?; - - manager .drop_table(Table::drop().table(Activities::Table).to_owned()) .await?; - manager - .drop_index(Index::drop().name("index-activities-id").table(Activities::Table).to_owned()) - .await?; - - manager - .drop_index(Index::drop().name("index-activities-actor").table(Activities::Table).to_owned()) - .await?; - - manager - .drop_index(Index::drop().name("activities-object-index").table(Activities::Table).to_owned()) - .await?; - - manager - .drop_index(Index::drop().name("index-activities-published-descending").table(Activities::Table).to_owned()) - .await?; - - manager .drop_table(Table::drop().table(Objects::Table).to_owned()) .await?; - manager - .drop_index(Index::drop().name("index-objects-id").table(Objects::Table).to_owned()) - .await?; - - manager - .drop_index(Index::drop().name("index-objects-attributed-to").table(Objects::Table).to_owned()) - .await?; - - manager - .drop_index(Index::drop().name("index-objects-in-reply-to").table(Objects::Table).to_owned()) - .await?; - - manager - .drop_index(Index::drop().name("index-objects-content-text").table(Objects::Table).to_owned()) - .await?; - - manager - .drop_index(Index::drop().name("index-objects-context").table(Objects::Table).to_owned()) - .await?; - - manager .drop_table(Table::drop().table(Instances::Table).to_owned()) .await?; - manager - .drop_index(Index::drop().name("index-instances-domain").table(Instances::Table).to_owned()) - .await?; - Ok(()) } } diff --git a/upub/migrations/src/m20240524_000002_create_relations_likes_shares.rs b/upub/migrations/src/m20240524_000002_create_relations_likes_shares.rs index 4a139666..73ddd234 100644 --- a/upub/migrations/src/m20240524_000002_create_relations_likes_shares.rs +++ b/upub/migrations/src/m20240524_000002_create_relations_likes_shares.rs @@ -215,43 +215,14 @@ impl MigrationTrait for Migration { .drop_table(Table::drop().table(Relations::Table).to_owned()) .await?; - manager - .drop_index(Index::drop().name("index-relations-follower").table(Relations::Table).to_owned()) - .await?; - - manager - .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?; - manager - .drop_index(Index::drop().name("index-likes-actor").table(Likes::Table).to_owned()) - .await?; - manager - .drop_index(Index::drop().name("index-likes-object").table(Likes::Table).to_owned()) - .await?; - manager - .drop_index(Index::drop().name("index-likes-actor-object").table(Likes::Table).to_owned()) - .await?; - manager .drop_table(Table::drop().table(Announces::Table).to_owned()) .await?; - manager - .drop_index(Index::drop().name("index-announces-actor").table(Announces::Table).to_owned()) - .await?; - manager - .drop_index(Index::drop().name("index-announces-object").table(Announces::Table).to_owned()) - .await?; - Ok(()) } } diff --git a/upub/migrations/src/m20240524_000003_create_users_auth_and_config.rs b/upub/migrations/src/m20240524_000003_create_users_auth_and_config.rs index aeb48347..3e0b39c8 100644 --- a/upub/migrations/src/m20240524_000003_create_users_auth_and_config.rs +++ b/upub/migrations/src/m20240524_000003_create_users_auth_and_config.rs @@ -146,26 +146,14 @@ impl MigrationTrait for Migration { .drop_table(Table::drop().table(Configs::Table).to_owned()) .await?; - manager - .drop_index(Index::drop().name("index-configs-actor").table(Configs::Table).to_owned()) - .await?; - manager .drop_table(Table::drop().table(Credentials::Table).to_owned()) .await?; - manager - .drop_index(Index::drop().name("index-credentials-login").table(Credentials::Table).to_owned()) - .await?; - manager .drop_table(Table::drop().table(Sessions::Table).to_owned()) .await?; - manager - .drop_index(Index::drop().name("index-sessions-secret").table(Sessions::Table).to_owned()) - .await?; - Ok(()) } } diff --git a/upub/migrations/src/m20240524_000004_create_addressing_deliveries.rs b/upub/migrations/src/m20240524_000004_create_addressing_deliveries.rs index 50bfc0d6..6e59d0d2 100644 --- a/upub/migrations/src/m20240524_000004_create_addressing_deliveries.rs +++ b/upub/migrations/src/m20240524_000004_create_addressing_deliveries.rs @@ -166,30 +166,10 @@ impl MigrationTrait for Migration { .drop_table(Table::drop().table(Addressing::Table).to_owned()) .await?; - manager - .drop_index(Index::drop().name("index-addressing-actor").to_owned()) - .await?; - - manager - .drop_index(Index::drop().name("index-addressing-server").to_owned()) - .await?; - - manager - .drop_index(Index::drop().name("index-addressing-activity").to_owned()) - .await?; - - manager - .drop_index(Index::drop().name("index-addressing-object").to_owned()) - .await?; - manager .drop_table(Table::drop().table(Deliveries::Table).to_owned()) .await?; - manager - .drop_index(Index::drop().name("index-deliveries-not-before").to_owned()) - .await?; - Ok(()) } } diff --git a/upub/migrations/src/m20240524_000005_create_attachments_tags_mentions.rs b/upub/migrations/src/m20240524_000005_create_attachments_tags_mentions.rs index 863bcf51..3e98ad9b 100644 --- a/upub/migrations/src/m20240524_000005_create_attachments_tags_mentions.rs +++ b/upub/migrations/src/m20240524_000005_create_attachments_tags_mentions.rs @@ -172,36 +172,14 @@ impl MigrationTrait for Migration { .drop_table(Table::drop().table(Attachments::Table).to_owned()) .await?; - manager - .drop_index(Index::drop().name("index-attachment-object").to_owned()) - .await?; - - manager .drop_table(Table::drop().table(Mentions::Table).to_owned()) .await?; - manager - .drop_index(Index::drop().name("index-mentions-object").table(Mentions::Table).to_owned()) - .await?; - - manager - .drop_index(Index::drop().name("index-mentions-actor-published").table(Mentions::Table).to_owned()) - .await?; - - manager .drop_table(Table::drop().table(Hashtags::Table).to_owned()) .await?; - manager - .drop_index(Index::drop().name("index-hashtags-object").table(Hashtags::Table).to_owned()) - .await?; - - manager - .drop_index(Index::drop().name("index-hashtags-name-published").table(Hashtags::Table).to_owned()) - .await?; - Ok(()) } } diff --git a/upub/migrations/src/m20240605_000001_add_jobs_table.rs b/upub/migrations/src/m20240605_000001_add_jobs_table.rs index c5d7c7f0..112e65f0 100644 --- a/upub/migrations/src/m20240605_000001_add_jobs_table.rs +++ b/upub/migrations/src/m20240605_000001_add_jobs_table.rs @@ -28,10 +28,6 @@ impl MigrationTrait for Migration { .drop_table(Table::drop().table(Deliveries::Table).to_owned()) .await?; - manager - .drop_index(Index::drop().name("index-deliveries-not-before").table(Deliveries::Table).to_owned()) - .await?; - manager .create_table( Table::create() @@ -85,14 +81,6 @@ impl MigrationTrait for Migration { .drop_table(Table::drop().table(Jobs::Table).to_owned()) .await?; - manager - .drop_index(Index::drop().name("index-jobs-activity").table(Jobs::Table).to_owned()) - .await?; - - manager - .drop_index(Index::drop().name("index-jobs-not-before").table(Jobs::Table).to_owned()) - .await?; - manager .create_table( Table::create()