From 6225a706c6c56132838340265e355021bd9332e7 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 17 Oct 2022 13:23:50 +0100 Subject: [PATCH] Tweak logging --- .../deltas/2022101711000000_rename_tables.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/userapi/storage/postgres/deltas/2022101711000000_rename_tables.go b/userapi/storage/postgres/deltas/2022101711000000_rename_tables.go index 509a3e9e9..35832076c 100644 --- a/userapi/storage/postgres/deltas/2022101711000000_rename_tables.go +++ b/userapi/storage/postgres/deltas/2022101711000000_rename_tables.go @@ -35,17 +35,17 @@ var renameIndicesMappings = map[string]string{ func UpRenameTables(ctx context.Context, tx *sql.Tx) error { for old, new := range renameTableMappings { if _, err := tx.ExecContext(ctx, "ALTER TABLE IF EXISTS $1 RENAME TO $2;", old, new); err != nil { - return fmt.Errorf("rename %q to %q error: %w", old, new, err) + return fmt.Errorf("rename table %q to %q error: %w", old, new, err) } } for old, new := range renameSequenceMappings { if _, err := tx.ExecContext(ctx, "ALTER SEQUENCE IF EXISTS $1 RENAME TO $2;", old, new); err != nil { - return fmt.Errorf("rename %q to %q error: %w", old, new, err) + return fmt.Errorf("rename sequence %q to %q error: %w", old, new, err) } } for old, new := range renameIndicesMappings { if _, err := tx.ExecContext(ctx, "ALTER INDEX IF EXISTS $1 RENAME TO $2;", old, new); err != nil { - return fmt.Errorf("rename %q to %q error: %w", old, new, err) + return fmt.Errorf("rename index %q to %q error: %w", old, new, err) } } return nil @@ -54,17 +54,17 @@ func UpRenameTables(ctx context.Context, tx *sql.Tx) error { func DownRenameTables(ctx context.Context, tx *sql.Tx) error { for old, new := range renameTableMappings { if _, err := tx.ExecContext(ctx, "ALTER TABLE IF EXISTS $1 RENAME TO $2;", new, old); err != nil { - return fmt.Errorf("rename %q to %q error: %w", new, old, err) + return fmt.Errorf("rename table %q to %q error: %w", new, old, err) } } for old, new := range renameSequenceMappings { if _, err := tx.ExecContext(ctx, "ALTER SEQUENCE IF EXISTS $1 RENAME TO $2;", new, old); err != nil { - return fmt.Errorf("rename %q to %q error: %w", new, old, err) + return fmt.Errorf("rename sequence %q to %q error: %w", new, old, err) } } for old, new := range renameIndicesMappings { if _, err := tx.ExecContext(ctx, "ALTER INDEX IF EXISTS $1 RENAME TO $2;", new, old); err != nil { - return fmt.Errorf("rename %q to %q error: %w", new, old, err) + return fmt.Errorf("rename index %q to %q error: %w", new, old, err) } } return nil