From c9370a2da999ca5fe3d4dcd327650b5e31625447 Mon Sep 17 00:00:00 2001 From: kim Date: Fri, 14 Feb 2025 11:52:53 +0000 Subject: [PATCH] rename to status vis indices just to indicate they're only used in the statuses hook func --- .../20241121121623_enum_strings_to_ints.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/internal/db/bundb/migrations/20241121121623_enum_strings_to_ints.go b/internal/db/bundb/migrations/20241121121623_enum_strings_to_ints.go index 7962fccff..ef292fcb9 100644 --- a/internal/db/bundb/migrations/20241121121623_enum_strings_to_ints.go +++ b/internal/db/bundb/migrations/20241121121623_enum_strings_to_ints.go @@ -32,8 +32,8 @@ func init() { up := func(ctx context.Context, db *bun.DB) error { return db.RunInTx(ctx, nil, func(ctx context.Context, tx bun.Tx) error { - // Visibility type indices. - var visIndices = []struct { + // Status visibility type indices. + var statusVisIndices = []struct { name string cols []string order string @@ -66,10 +66,9 @@ func init() { Table: "statuses", Column: "visibility", IndexCleanupCallback: func(ctx context.Context, tx bun.Tx) error { - // After new column has been - // created and populated, drop - // indices relying on old column. - for _, index := range visIndices { + // After new column has been created and + // populated, drop indices relying on old column. + for _, index := range statusVisIndices { log.Infof(ctx, "dropping old index %s...", index.name) if _, err := tx.NewDropIndex(). Index(index.name). @@ -107,7 +106,7 @@ func init() { // Recreate the visibility indices. log.Info(ctx, "creating new visibility indexes...") - for _, index := range visIndices { + for _, index := range statusVisIndices { log.Infof(ctx, "creating new index %s...", index.name) q := tx.NewCreateIndex(). Table("statuses").