page:guides:symfony:schema changes
Apply Database Schema Changes for Symfony
Summary
Schema changes for a Symfony app on Ample. Verified on Symfony: a --release-command migration ran before activation and its marker was readable by the live app (migrated=release-ok). Build and start: composer install --no-dev from composer.lock with Symfony Runtime's dotenv disabled (extra.runtime.disable_dotenv; .env never ships, its values arrive as encrypted env, and compile-time parameters such as DEFAULT_URI need a default), then FrankenPHP serving public/ (php-server with the index.php fallback) reading PORT on the php-8.5 template with APP_ENV=prod.
Prerequisites
- A Symfony project (composer install --no-dev from composer.lock with Symfony Runtime's dotenv disabled (extra.runtime.disable_dotenv; .env never ships, its values arrive as encrypted env, and compile-time parameters such as DEFAULT_URI need a default), then FrankenPHP serving public/ (php-server with the index.php fallback) reading PORT on the php-8.5 template with APP_ENV=prod)
- A PostgreSQL driver reading DATABASE_URL at runtime
- An Ample account token with servers:write, databases:read
Resource 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.
Workflow Steps
Build and Start
composer install --no-dev from composer.lock with Symfony Runtime's dotenv disabled (extra.runtime.disable_dotenv; .env never ships, its values arrive as encrypted env, and compile-time parameters such as DEFAULT_URI need a default), then FrankenPHP serving public/ (php-server with the index.php fallback) reading PORT on the php-8.5 template with APP_ENV=prod; the server must bind 0.0.0.0 on PORT.
Run Migrations as the Release Command
Ample runs the command before activation and fails the release if it exits non-zero; keep migrations idempotent.
ample deploy . --name --public --release-command "python3 migrate.py"
Verify
Fetch the live URL and /p/migrated on the example; on failure read the build and runtime logs.
ample logs --kind build
Success Checks
- app responds on its public URL
- Path:
/ - Expect: ample canary symfony patterns
- Path:
- migrated check from the example
- Path:
/p/migrated - Expect: see the pattern fixture checks
- Path:
Limitations
- Verified on the php-8.5 template at s-1vcpu-1gb; other sizes and Symfony 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.
Examples
Symfony Pattern Fixture
- Description: Verified schema changes on Symfony.
- Source Reference: tests/deploy-canaries/symfony-patterns
Evidence Summary
- Kind: canary_run
- Summary: Symfony pattern fixture deployed on Ample (composer install --no-dev from composer.lock with Symfony Runtime's dotenv disabled (extra.runtime.disable_dotenv; .env never ships, its values arrive as encrypted env, and compile-time parameters such as DEFAULT_URI need a default), then FrankenPHP serving public/ (php-server with the index.php fallback) reading PORT on the php-8.5 template with APP_ENV=prod); 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-20T22:23:52Z
- Implementation Revision: 64a7bb8e37dd-dirty (CLI 64a7bb8e)
- Expires At: 2027-03-19T22:23:52Z
- Scope: {"checks":["/p/migrated"],"template":"php-8.5"}
Last Verified At
2026-09-20T22:23:52Z
Unknowns
- Region availability is unknown until a verified region fact is recorded
- Compliance attestations are unknown; none are claimed
Formats
- HTML: View guide
- Markdown: View markdown
- JSON: View JSON
Next Actions
- Action: Browse the catalog index
- Operation: catalog_index
- Method: GET
- Relative Path: /v1/catalog
- Action: Search published recipes by intent, stack and constraints
- Operation: search_recipes
- Method: POST
- Relative Path: /v1/catalog/search
- Parameters: {"body":{"limit":5,"query":"Apply database schema changes for Symfony"}}
- Action: Prepare a side-effect-free deployment plan for an authorized project
- Operation: plan_deployment
- Method: POST
- Relative Path: /v1/catalog/plan
- Parameters: {"body":{"inputs":{},"projectId":"","recipeId":"page:guides:symfony:schema-changes","recipeRevision":"r1"}}
- Action: Read the existing agent authentication setup
- Operation: existing_auth_setup
- Method: GET
- Relative Path: /mcp/setup
- Action: Browse Symfony
- Operation: browse_node
- Method: GET
- Relative Path: /v1/catalog/nodes/stack%3Aframework-symfony
- Action: Browse Configure Deployment
- Operation: browse_node
- Method: GET
- Relative Path: /v1/catalog/nodes/intent%3Aconfigure-deployment
- Action: Browse Transactional Workflows
- Operation: browse_node
- Method: GET
- Relative Path: /v1/catalog/nodes/pattern%3Atransactional-workflows