Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/greyproxy/crud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,8 @@ func TestMigrations(t *testing.T) {
// Verify migration versions were recorded
var count int
_ = db.ReadDB().QueryRow("SELECT COUNT(*) FROM schema_migrations").Scan(&count)
if count != 14 {
t.Errorf("expected 14 migration versions, got %d", count)
if count != 15 {
t.Errorf("expected 15 migration versions, got %d", count)
}
}

Expand Down
6 changes: 6 additions & 0 deletions internal/greyproxy/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ var migrations = []string{
// returned by the middleware in its hello response. NULL for middlewares
// that did not declare a name; the UI falls back to middleware_url.
`ALTER TABLE middleware_events ADD COLUMN middleware_name TEXT;`,

// Migration 15: Index http_transactions.container_name to speed up the
// container filter on the pending page. Without it, the DISTINCT
// container_name lookup full-scans http_transactions (BLOB-heavy), which
// made GET /pending take ~30s on large databases.
`CREATE INDEX IF NOT EXISTS idx_http_transactions_container ON http_transactions(container_name);`,
}

func runMigrations(db *sql.DB) error {
Expand Down