Open
Description
Signal
We use Alchemy for all Cloudflare resources. We want effect-orm migrations in a format that Alchemy applies. For D1, that is D1Database({ migrationsDir }). For Durable Objects, it is a bundled list the object runs at start.
Why (MyRemotely / CAFE)
- One source of truth: table definitions → generated SQL → Alchemy deploy. No second tool such as wrangler or drizzle-kit.
- PR feat(sqlite): generate migrations #51 adds SQLite migration generation. This issue is about the delivery path.
Scope
- Output layout that Alchemy D1 reads (ordered
.sqlfiles, journal). - A DO helper:
Migrations.runOnStart(storage, bundledMigrations)with a ledger table inside the object. - Per-tenant fan-out: apply one migration to N tenant databases, with resume after a partial failure (the ClickHouse runner has a journal and resume already).
Done when
alchemy deploycreates a D1 database and applies effect-orm migrations to it.- A DO applies new migrations when it starts after a deploy.
Part of #52: the CAFE-stack roadmap signal from MyRemotely. This shows the direction we want, and it is not a demand. We can send a PR if you accept the idea.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Makisuo commentedon Oct 25, 2026
The D1 half has started: #121 makes
effect-orm generatewrite SQLite migrations in the drizzle-kit 1.0 layout (<timestamp>_<name>/migration.sqlandsnapshot.json), which Alchemy's D1 resource applies. The migration fuzzer checks each generated migration applied as one D1 batch. Still open: a Durable Object runner and ledger, per-tenant fan-out, and analchemy deployend-to-end test.