# Apply database schema changes for Spring Boot

## Summary
Schema changes for a Spring Boot app on Ample. Verified on Spring Boot: a --release-command migration ran before activation and its marker was readable by the live app (migrated=release-ok). Build and start: `./mvnw -q -DskipTests package` (or the Gradle wrapper) producing one application jar, then `java -jar` on the jvm-21 template (Temurin JDK 21) with server.port read from PORT.

## Representative Queries
- Apply database schema changes for Spring Boot
- Where can I host Apply database schema changes built with Spring Boot?
- I need a framework-specific schema migration and rollback procedure; no managed migration service is assumed.

## Prerequisites
- A Spring Boot project (`./mvnw -q -DskipTests package` (or the Gradle wrapper) producing one application jar, then `java -jar` on the jvm-21 template (Temurin JDK 21) with server.port read from PORT)
- A PostgreSQL driver reading DATABASE_URL at runtime
- An Ample account token with `servers:write`, `databases:read`

## Workflow Steps
1. ### Build and start  
   `./mvnw -q -DskipTests package` (or the Gradle wrapper) producing one application jar, then `java -jar` on the jvm-21 template (Temurin JDK 21) with server.port read from PORT; the server must bind `0.0.0.0` on PORT.

2. ### Run migrations as the release command  
   Ample runs the command before activation and fails the release if it exits non-zero; keep migrations idempotent.  
   Command: `ample deploy . --name --public --release-command "python3 migrate.py"`

3. ### Verify  
   Fetch the live URL and `/p/migrated` on the example; on failure, read the build and runtime logs.  
   Command: `ample logs --kind build`

## Success Checks
- App responds on its public URL
- Migrated check from the example

## Limitations
- Verified on the jvm-21 template at s-1vcpu-2gb; other sizes and Spring Boot major versions are not verified.
- Region, compliance attestations, and request-duration limits are unknown and not claimed.
- Managed PostgreSQL 16 only; extensions, connection limits, and backup or restore procedures are not verified.

## Cost Estimate
- Currency: USD  
- Monthly Amount: $10.00  
- Basis: size prices from pricing.toml (loaded by the API)
  
### Components
- **App server**: s-1vcpu-1gb (1.0) - $5.00
- **Managed PostgreSQL database**: s-1vcpu-1gb (1.0) - $5.00

## Next Actions
1. **Browse the catalog index** - GET /v1/catalog
2. **Search published recipes** - POST /v1/catalog/search
3. **Prepare a deployment plan** - POST /v1/catalog/plan
4. **Read existing agent authentication setup** - GET /mcp/setup

## Examples
- **Spring Boot pattern fixture**  
  Verified schema changes on Spring Boot. Source: `tests/deploy-canaries/spring-boot-patterns`
