fix: align webhook regenerate route with frontend path
This commit is contained in:
+21
-3
@@ -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 = `
|
||||
|
||||
Reference in New Issue
Block a user