You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.0 KiB
2.0 KiB
+++ title = "Document D1 schema migration workflow — how to apply SQL schema changes to D1 in CI/CD" priority = 7 status = "done" ticket_type = "task" dependencies = ["d0da0b", "bb1514"] +++
Infrastructure is managed with OpenTofu using the Cloudflare provider. Configuration lives in `infra/`. Resources include a Cloudflare Worker (API), Cloudflare D1 database (bound to the worker), and a Cloudflare Pages project (UI frontend).Cloudflare D1 uses SQL migrations. Because the Worker runs in the Cloudflare runtime (not a standard server), migrations must be applied via a separate mechanism.
TRIAGE 5c0c64 resolved: the chosen strategy is Option 2 — separate wrangler step. Schema SQL lives at infra/schema.sql (ticket bb1514). No null_resource, no startup migration from the Workers handler.
For local dev/tests, NativeRepository::run_migrations() (ticket 00aff0) calls execute_batch via rusqlite — no manual step needed there.