mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-24 07:36:15 -06:00
rename to status vis indices just to indicate they're only used in the statuses hook func
This commit is contained in:
parent
3686279b89
commit
c9370a2da9
1 changed files with 6 additions and 7 deletions
|
|
@ -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").
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue