## Apply Database Schema Changes for Sinatra

### Summary
Schema changes for a Sinatra app on Ample. Verified on Sinatra: a --release-command migration ran before activation and its marker was readable by the live app (migrated=release-ok). Build and start: bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via `rackup` (config.ru) reading PORT on the ruby-3.4 template.

### Prerequisites
- A Sinatra project (bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via `rackup` (config.ru) reading PORT on the ruby-3.4 template)
- A PostgreSQL driver reading DATABASE_URL at runtime
- An Ample account token with servers:write, databases:read

### Workflow Steps
1. **Build and start**  
   bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via `rackup` (config.ru) reading PORT on the ruby-3.4 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.
   ```bash
   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.
   ```bash
   ample logs  --kind build
   ```

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

### Limitations
- Verified on the ruby-3.4 template at s-1vcpu-1gb; other sizes and Sinatra 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  
- **Note**: Always-on monthly price of the tested sizes; apps auto-pause when idle.

### Examples
- **Sinatra pattern fixture**  
   Verified schema changes on Sinatra.  
   Source Reference: tests/deploy-canaries/sinatra-patterns

### Evidence Summary
- **Canary Run**  
   Sinatra pattern fixture deployed on Ample (bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via `rackup` (config.ru) reading PORT on the ruby-3.4 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-20T23:45:31Z  
   - Implementation Revision: 4d1511e574302f3904b75088bd4048a0975218b3-dirty (CLI 0.1.21)  
   - Expires At: 2027-03-19T23:45:31Z  
   - Scope: 
      - Checks: /p/migrated  
      - Template: ruby-3.4

### Next Actions
- **Browse the catalog index**  
- **Search published recipes by intent, stack and constraints**  
- **Prepare a side-effect-free deployment plan for an authorized project**  
- **Read the existing agent authentication setup**  
- **Browse Sinatra**  
- **Browse Configure deployment**  
- **Browse Transactional workflows**
