Files
warmbly/cmd/migrate/main.go
Matthew Meszaros a04d7450bc feat: guard warmup reconciliation by access
Make the warmup task reconciler re-check account state and org warmup access before scheduling replacement tasks. Remove pool membership for accounts whose org can no longer use warmup to avoid repeated no-access task churn.
2026-06-01 11:19:44 +02:00

28 lines
791 B
Go

// Command migrate applies all pending database migrations and exits.
//
// It runs the same embedded migrations the backend applies on boot, but
// without starting the API — handy after `make db-wipe` / `make db-reset`
// and in CI. The database URL comes from PRIMARY_DB (the make dev targets
// already export it).
package main
import (
"log"
"os"
"github.com/warmbly/warmbly/internal/infrastructure/db"
)
func main() {
url := os.Getenv("PRIMARY_DB")
if url == "" {
log.Fatal("PRIMARY_DB is not set (e.g. postgres://warmbly:warmbly@localhost:15432/warmbly_dev?sslmode=disable)")
}
log.Println("Running database migrations...")
if err := db.RunMigrations(url); err != nil {
log.Fatal("Failed to run migrations: ", err)
}
log.Println("Database migrations completed")
}