Compatibility
Version compatibility matrix
Section titled “Version compatibility matrix”| Framework version | Minimum schema baseline | Breaking changes | Upgrade command |
|---|---|---|---|
| 0.0.x (pre-release) | none required | Schema is additive-only; includes content_locks and srcset column on media_assets | astropress db migrate |
ensureLegacySchemaCompatibility() handles all additive schema changes automatically at
startup for existing local databases. The astropress db migrate command applies any
pending schema migrations for Cloudflare D1 or other hosted backends.
Checking compatibility
Section titled “Checking compatibility”Run the built-in compatibility check before and after upgrading:
astropress upgrade --check [--project-dir <dir>]This command:
- Reads the installed
astropresspackage version frompackage.json - Queries the
schema_migrationstable for the latest applied migration (local SQLite only) - Prints framework version, schema state, app host, and data services
- Lists any known breaking-change notes for the current version range
- Exits
0on success
Standard upgrade procedure
Section titled “Standard upgrade procedure”# 1. Check current stateastropress upgrade --check
# 2. Update the packagebun update astropress
# 3. Apply any pending schema migrationsastropress db migrate
# 4. Verify the environmentastropress doctor
# 5. Confirm schema is currentastropress upgrade --checkSchema version reference
Section titled “Schema version reference”The schema_migrations table tracks every applied migration by name. Query it directly
with sqlite3 or via the admin database file at .data/admin.db:
SELECT id, name, applied_at FROM schema_migrations ORDER BY id;For Cloudflare D1, use the Wrangler CLI:
wrangler d1 execute <DB_NAME> --command \ "SELECT id, name, applied_at FROM schema_migrations ORDER BY id"Rollback procedure
Section titled “Rollback procedure”Each migration row stores its rollback SQL in the rollback_sql column. To revert a
migration manually:
-- List available rollback SQL for the most recent migrationSELECT name, rollback_sql FROM schema_migrations ORDER BY id DESC LIMIT 1;
-- Execute the rollback SQL, then delete the migration rowDELETE FROM schema_migrations WHERE name = '<migration-name>';After rollback, pin the previous framework version in package.json until the breaking
change is resolved.
Environment variable changes
Section titled “Environment variable changes”| Removed variable | Replacement | Since |
|---|---|---|
ASTROPRESS_DATA_SERVICES | ASTROPRESS_CONTENT_SERVICES | 0.0.x |
ASTROPRESS_BACKEND_PLATFORM | ASTROPRESS_CONTENT_SERVICES | 0.0.x |
ASTROPRESS_HOSTED_PROVIDER | ASTROPRESS_CONTENT_SERVICES | 0.0.x |
ASTROPRESS_DEPLOY_TARGET | ASTROPRESS_APP_HOST | 0.0.x |
Run astropress config migrate to automatically rewrite legacy environment variable names
in your .env file.
Cloud provider migration procedures
Section titled “Cloud provider migration procedures”Cloudflare D1
Section titled “Cloudflare D1”- Snapshot first:
astropress backup --project-dir <site> --out backups/pre-migration - Apply migration:
Terminal window wrangler d1 execute <DATABASE_NAME> --file migrations/0001_my_migration.sql --remote - Verify:
Terminal window wrangler d1 execute <DATABASE_NAME> --command "SELECT * FROM schema_migrations ORDER BY id DESC LIMIT 5" --remote - Deploy new code: push to Cloudflare Pages; the new runtime picks up the schema automatically.
Supabase (PostgreSQL)
Section titled “Supabase (PostgreSQL)”- Snapshot first: use Supabase Dashboard → Database → Backups → Download backup.
- Apply migration: use the Supabase SQL Editor or
supabase db pushwith a migration file. - Verify: confirm new columns via Supabase Dashboard → Table Editor.
- Deploy: redeploy the host application.
Upgrading with astropress upgrade --apply
Section titled “Upgrading with astropress upgrade --apply”For SQLite deployments, run the full upgrade sequence in one step:
astropress upgrade --apply --project-dir <site>This command:
- Runs the pre-flight compatibility check (
astropress upgrade). - Applies pending
.sqlmigration files from themigrations/directory. - Exits with a non-zero status if any migration fails.
Run astropress doctor --project-dir <site> after upgrading to verify schema health.