# Apply Database Schema Changes for Quarkus

Schema changes for a Quarkus app on Ample. Verified on Quarkus: 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` producing one uber-jar (quarkus.package.jar.type=uber-jar), then `java -jar` on the jvm-21 template (Temurin JDK 21) with `quarkus.http.port` read from PORT.

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

## Resource Requirements
- primitive:compute
- primitive:postgres

## Infrastructure Requirements
- **Compute**:  Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes.
- **Postgres**: Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned when an app needs a database and no `DATABASE_URL` is supplied.

## Prerequisites
- A Quarkus project (`./mvnw -q -DskipTests package` producing one uber-jar (quarkus.package.jar.type=uber-jar), then `java -jar` on the jvm-21 template (Temurin JDK 21) with `quarkus.http.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 producing one uber-jar (quarkus.package.jar.type=uber-jar), then java -jar on the jvm-21 template (Temurin JDK 21) with quarkus.http.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`

## Tested Configuration
- **Template**: jvm-21
- **Runtime**: java
- **Size**: s-1vcpu-2gb
- **Build**: `./mvnw -q -DskipTests package`
- **Start**: `java -jar $(ls target/*.jar | grep -v -- '-plain' | head -n 1)`

## Limitations
- Verified on the jvm-21 template at s-1vcpu-2gb; other sizes and Quarkus 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.0
  - Basis: size prices from pricing.toml (loaded by the API) at build revision 1ac5595375130d45290090e82ed0f554ccd45405-dirty
  - Components:
    - **app server**: size s-1vcpu-1gb, quantity 1.0, monthly amount 5.0
    - **managed PostgreSQL database**: size s-1vcpu-1gb, quantity 1.0, monthly amount 5.0
- Note: Always-on monthly price of the tested sizes; apps auto-pause when idle. Buckets are allocation-priced per quota and not included.

## Evidence Summary
- **Kind**: canary_run
- **Summary**: Quarkus pattern fixture deployed on Ample.
- **Observed At**: 2026-09-21T00:35:31Z
- **Implementation Revision**: c6c81daa9272c95c5ce381005ba7347a341e578f-dirty (CLI 0.1.21)
- **Exires At**: 2027-03-20T00:35:31Z
- **Scope**: checks: ['/p/migrated'], template: 'jvm-21'

## Next Actions
- **Browse the catalog index** 
  - Operation: `GET /v1/catalog`
- **Search published recipes** 
  - Operation: `POST /v1/catalog/search` with query **Apply database schema changes for Quarkus**
- **Prepare a deployment plan** 
  - Operation: `POST /v1/catalog/plan` with recipeId `page:guides:quarkus:schema-changes`
