You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Migrations that Alchemy can apply to D1 and Durable Objects #59
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.
Output layout that Alchemy D1 reads (ordered .sql files, 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 deploy creates 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.
The D1 half has started: #121 makes effect-orm generate write SQLite migrations in the drizzle-kit 1.0 layout (<timestamp>_<name>/migration.sql and snapshot.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 an alchemy deploy end-to-end test.
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.