summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-12-09 15:53:56 +0100
committerLibravatar GitHub <noreply@github.com>2024-12-09 15:53:56 +0100
commitacdd495c70806bcef464107555564dc673760397 (patch)
tree76f65af9f0badd7624621b3d4ba53a64af627af2 /internal
parent[chore]: Bump golang.org/x/net from 0.31.0 to 0.32.0 (#3610) (diff)
downloadgotosocial-acdd495c70806bcef464107555564dc673760397.tar.xz
[chore] Log during potentially long migrations (#3613)
* [chore] Log during potentially long migrations * remove unneeded log lines
Diffstat (limited to 'internal')
-rw-r--r--internal/db/bundb/migrations/20241113151042_remove_mention_updated_at.go2
-rw-r--r--internal/db/bundb/migrations/20241113152126_add_status_edits.go2
-rw-r--r--internal/db/bundb/migrations/20241121121623_enum_strings_to_ints.go5
-rw-r--r--internal/db/bundb/migrations/20241203124608_remove_media_attachment_updated_at.go2
4 files changed, 11 insertions, 0 deletions
diff --git a/internal/db/bundb/migrations/20241113151042_remove_mention_updated_at.go b/internal/db/bundb/migrations/20241113151042_remove_mention_updated_at.go
index bd72dc109..ba6e0bd3a 100644
--- a/internal/db/bundb/migrations/20241113151042_remove_mention_updated_at.go
+++ b/internal/db/bundb/migrations/20241113151042_remove_mention_updated_at.go
@@ -21,6 +21,7 @@ import (
"context"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
+ "github.com/superseriousbusiness/gotosocial/internal/log"
"github.com/uptrace/bun"
)
@@ -37,6 +38,7 @@ func init() {
}
// Remove 'updated_at' column.
+ log.Info(ctx, "removing unused updated_at column from mentions to save space, please wait...")
_, err = tx.NewDropColumn().
Model((*gtsmodel.Mention)(nil)).
Column("updated_at").
diff --git a/internal/db/bundb/migrations/20241113152126_add_status_edits.go b/internal/db/bundb/migrations/20241113152126_add_status_edits.go
index aa0b0d4b9..5d4fb7b3e 100644
--- a/internal/db/bundb/migrations/20241113152126_add_status_edits.go
+++ b/internal/db/bundb/migrations/20241113152126_add_status_edits.go
@@ -22,6 +22,7 @@ import (
"reflect"
gtsmodel "github.com/superseriousbusiness/gotosocial/internal/db/bundb/migrations/20241113152126_add_status_edits"
+ "github.com/superseriousbusiness/gotosocial/internal/log"
"github.com/uptrace/bun"
)
@@ -38,6 +39,7 @@ func init() {
}
// Add EditIDs column to Status table.
+ log.Info(ctx, "adding edits column to statuses table...")
_, err = tx.NewAddColumn().
Model((*gtsmodel.Status)(nil)).
ColumnExpr(colDef).
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 7621ddc6c..6767c6809 100644
--- a/internal/db/bundb/migrations/20241121121623_enum_strings_to_ints.go
+++ b/internal/db/bundb/migrations/20241121121623_enum_strings_to_ints.go
@@ -22,6 +22,7 @@ import (
old_gtsmodel "github.com/superseriousbusiness/gotosocial/internal/db/bundb/migrations/20241121121623_enum_strings_to_ints"
new_gtsmodel "github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
+ "github.com/superseriousbusiness/gotosocial/internal/log"
"github.com/superseriousbusiness/gotosocial/internal/util"
"github.com/uptrace/bun"
@@ -68,7 +69,9 @@ func init() {
// Before making changes to the visibility col
// we must drop all indices that rely on it.
+ log.Info(ctx, "dropping old visibility indexes...")
for _, index := range visIndices {
+ log.Info(ctx, "dropping old index %s...", index.name)
if _, err := tx.NewDropIndex().
Index(index.name).
Exec(ctx); err != nil {
@@ -88,7 +91,9 @@ func init() {
}
// Recreate the visibility indices.
+ log.Info(ctx, "creating new visibility indexes...")
for _, index := range visIndices {
+ log.Info(ctx, "creating new index %s...", index.name)
q := tx.NewCreateIndex().
Table("statuses").
Index(index.name).
diff --git a/internal/db/bundb/migrations/20241203124608_remove_media_attachment_updated_at.go b/internal/db/bundb/migrations/20241203124608_remove_media_attachment_updated_at.go
index 344168b38..63e5d5f90 100644
--- a/internal/db/bundb/migrations/20241203124608_remove_media_attachment_updated_at.go
+++ b/internal/db/bundb/migrations/20241203124608_remove_media_attachment_updated_at.go
@@ -21,6 +21,7 @@ import (
"context"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
+ "github.com/superseriousbusiness/gotosocial/internal/log"
"github.com/uptrace/bun"
)
@@ -37,6 +38,7 @@ func init() {
}
// Remove 'updated_at' column.
+ log.Info(ctx, "removing unused updated_at column from media attachments to save space, please wait...")
_, err = tx.NewDropColumn().
Model((*gtsmodel.MediaAttachment)(nil)).
Column("updated_at").