check / check (push) Successful in 3m58s
Each webhook's event database keeps one row of running totals: events, deliveries and failures, and how many of each retention removed. Storing an event, creating a delivery, a delivery becoming failed and the retention sweep each update it in the transaction that writes or deletes the rows it counts. Deliveries get a finished_at column, the last column of the status index, so the last-10-minutes and last-24-hours figures are index-range counts. The pane is its own template, included at the top of the page. The schema changes in place with nothing back-filled, so an existing database must be recreated. Model: opus-5-5
17 lines
441 B
Go
17 lines
441 B
Go
package database
|
|
|
|
// Migrate runs database migrations for the main application database.
|
|
// Only configuration-tier models are stored in the main database.
|
|
// Event-tier models (Event, Delivery, DeliveryResult, Totals) live in
|
|
// per-webhook dedicated databases managed by WebhookDBManager.
|
|
func (d *Database) Migrate() error {
|
|
return d.db.AutoMigrate(
|
|
&Setting{},
|
|
&User{},
|
|
&APIKey{},
|
|
&Webhook{},
|
|
&Entrypoint{},
|
|
&Target{},
|
|
)
|
|
}
|