fix: align webhook regenerate route with frontend path

This commit is contained in:
2026-03-28 13:58:53 +03:00
parent 52eec11d16
commit 77251c540b
4 changed files with 30 additions and 11 deletions
+21 -3
View File
@@ -56,10 +56,28 @@ func (s *Store) DB() *sql.DB {
return s.db
}
// migrate creates all tables if they do not already exist.
// migrate creates all tables if they do not already exist, then runs
// incremental migrations for schema changes added after initial release.
func (s *Store) migrate() error {
_, err := s.db.Exec(schema)
return err
if _, err := s.db.Exec(schema); err != nil {
return err
}
return s.runMigrations()
}
// runMigrations applies additive schema changes that cannot be expressed
// with CREATE TABLE IF NOT EXISTS.
func (s *Store) runMigrations() error {
migrations := []string{
// Add owner column to registries (2026-03-28).
`ALTER TABLE registries ADD COLUMN owner TEXT NOT NULL DEFAULT ''`,
}
for _, m := range migrations {
// Ignore errors from already-applied migrations (duplicate column).
_, _ = s.db.Exec(m)
}
return nil
}
const schema = `