fix(store): surface invalid schema_version; split migration test assertion
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -59,7 +59,11 @@ func (s *Store) migrate() error {
|
||||
// Fresh database: schemaSQL created all columns already.
|
||||
return s.SetSetting("schema_version", strconv.Itoa(schemaVersion))
|
||||
}
|
||||
ver, _ := strconv.Atoi(v)
|
||||
var ver int
|
||||
ver, err = strconv.Atoi(v)
|
||||
if err != nil {
|
||||
return fmt.Errorf("invalid schema_version %q: %w", v, err)
|
||||
}
|
||||
if ver < 2 {
|
||||
if _, err := s.db.Exec(`ALTER TABLE accounts ADD COLUMN from_address TEXT`); err != nil {
|
||||
return fmt.Errorf("migrate to v2: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user