page:guides:next js:schema changes

Apply Database Schema Changes for Next.js

Summary

Schema changes for a Next.js app on Ample. Verified on Next.js: a --release-command migration ran before activation and its marker was readable by the live app (migrated=release-ok). Build and start: next build then next start -H 0.0.0.0 -p $PORT on the node-22 template.

Requirements

Prerequisites

Workflow Steps

  1. Build and Start:

    • next build then next start -H 0.0.0.0 -p $PORT 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 if it exits non-zero; keep migrations idempotent.
    • Command: ample deploy . --name <app_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 <app_name> --kind build

Success Checks

Limitations

Cost Estimate

Examples

Evidence Summary

Last Verified At

Next Actions