# Apply database schema changes for Hono

### Summary
Schema changes for a Hono app on Ample. Verified on Hono: a --release-command migration ran before activation and its marker was readable by the live app (migrated=release-ok). Build and start: `npm install` and `npm run start` with `@hono/node-server` on the node-22 template.

### Representative Queries
- Apply database schema changes for Hono
- Where can I host Apply database schema changes built with Hono?
- 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
- **ID:** `primitive:compute`
- **Status:** Verified
- **Summary:** Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes.

#### Postgres
- **ID:** `primitive:postgres`
- **Status:** Verified
- **Summary:** 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 Hono project (npm install and npm run start with @hono/node-server on the node-22 template)
- A PostgreSQL driver reading DATABASE_URL at runtime
- An Ample account token with servers:write, databases:read

### Workflow Steps
1. **Build and start**  
   `npm install` and `npm run start` with `@hono/node-server` on the node-22 template; 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 "node migrate.cjs"`

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`

### Examples
- **Hono pattern fixture**  
  Verified schema changes on Hono.  
  Source Ref: `tests/deploy-canaries/hono-patterns`

### Success Checks
- **App responds on its public URL**  
   - Kind: `http_get`
   - Path: `/`
   - Expect: `ample canary hono patterns`

- **Migrated check from the example**  
   - Kind: `http_get`
   - Path: `/p/migrated`
   - Expect: `see the pattern fixture checks`

### Limitations
- Verified on the node-22 template at `s-1vcpu-1gb`; other sizes and Hono 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
- **Authoritative:** true
- **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.00
  - **Managed PostgreSQL database**  
    Size: `s-1vcpu-1gb`, Quantity: 1.0, Monthly Amount: $5.00
- **Note:** Always-on monthly price of the tested sizes; apps auto-pause when idle.

### Evidence Summary
- **Kind:** Canary Run  
  Summary: Hono pattern fixture deployed on Ample (npm install and npm run start with @hono/node-server on the node-22 template); for this guide: a --release-command migration ran before activation and its marker was readable by the live app (migrated=release-ok).  
  Observed At: `2026-09-21T01:14:18Z`
  Implementation Revision: `50dbac567d2c5cc8e55e6c748a646be0025d9cfb-dirty (CLI 0.1.21)`
  Expires At: `2027-03-20T01:14:18Z`
  Scope: 
   - Checks: `/p/migrated`
   - Template: `node-22`

### Unknowns
- Region availability is unknown until a verified region fact is recorded.
- Compliance attestations are unknown; none are claimed.

### Formats
- **HTML:** [ample.computer/guides/hono/schema-changes](/content/guides/hono/schema-changes/index.html)
- **Markdown:** [ample.computer/guides/hono/schema-changes.md](/content/guides/hono/schema-changes.md)
- **JSON:** [api.ample.computer/v1/catalog/recipes/page%3Aguides%3Ahono%3Aschema-changes](https://api.ample.computer/v1/catalog/recipes/page%3Aguides%3Ahono%3Aschema-changes)

### Next Actions
- **Browse the catalog index**  
  Action ID: `browse-catalog`
  Operation ID: `catalog_index`
  Method: `GET`
  Relative Path: `/v1/catalog`

- **Search published recipes by intent, stack and constraints**  
  Action ID: `search-recipes`
  Operation ID: `search_recipes`
  Method: `POST`
  Relative Path: `/v1/catalog/search`
  Parameters: 
    - `body`: {"limit":5,"query":"Apply database schema changes for Hono"}

- **Prepare a side-effect-free deployment plan for an authorized project**  
  Action ID: `plan:page:guides:hono:schema-changes`
  Operation ID: `plan_deployment`
  Method: `POST`
  Relative Path: `/v1/catalog/plan`
  Parameters: 
    - `body`: {"inputs":{},"projectId":"","recipeId":"page:guides:hono:schema-changes","recipeRevision":"r1"}
