Backup restore copies tables by column position

Open
#2,044 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@Wikid82 is already working on this.

Since Nov 25, 2026.

Assessment

This issue has not been assessed yet.

Description

backend database

What: RehydrateLiveDatabase restores each table with INSERT INTO t SELECT * FROM restore_src.t, which matches columns by position. When a table's column order differs between the live database and the backup (for example a fresh install versus a database upgraded by adding a column, which appends it at the end), values can shift into the wrong columns without an error.

Where: backend/internal/services/backup_service.go:1600-1625.

Severity: medium.

Suggested approach: copy using the explicit list of column names that both schemas share, and add a test with differing column order.

Found during plan review of the encryption key work.

Dominant language
Go
Stars
17
Forks
2
Avg merge
1h 42m
Merged PRs (30d)
173

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Wikid82/Charon

All issues in Wikid82/Charon

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.