mirror of
https://github.com/warmbly/warmbly.git
synced 2026-08-18 16:01:18 +00:00
a04d7450bc
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.
28 lines
791 B
Go
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")
|
|
}
|