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.
32 lines
1.4 KiB
Markdown
32 lines
1.4 KiB
Markdown
+++
|
|
title = "[TRIAGE] D1 migrations in OpenTofu — null_resource local-exec vs separate wrangler step vs manual"
|
|
priority = 9
|
|
status = "todo"
|
|
ticket_type = "task"
|
|
dependencies = ["25c413"]
|
|
+++
|
|
|
|
<context>
|
|
This is a triage decision ticket. It must be resolved before dependent implementation tickets can proceed.
|
|
</context>
|
|
|
|
<question>
|
|
D1 migrations in OpenTofu: how do we apply the SQL schema to a newly created D1 database? Options are a null_resource local-exec in OpenTofu, a separate wrangler d1 execute step, or a manual migration step.
|
|
</question>
|
|
|
|
<options>
|
|
1. **null_resource local-exec** — run `wrangler d1 execute` as a provisioner in OpenTofu. Ties infra and schema together in one `tofu apply`.
|
|
2. **Separate wrangler step** — document as a manual step after `tofu apply`. Simpler OpenTofu config, slightly more manual.
|
|
3. **API startup migration** — the API runs `CREATE TABLE IF NOT EXISTS` on startup. Works but risks schema drift in production.
|
|
</options>
|
|
|
|
<resolution>
|
|
1. Research the options above and choose the best approach for this project.
|
|
2. Update ticket d0da0b (D1 resource), ticket a5049d (migrations module), and ticket 75489a (migration workflow docs) with the chosen strategy.
|
|
3. Mark this ticket done with a note on the chosen approach in the body or a comment.
|
|
</resolution>
|
|
|
|
<commit>
|
|
`chore(quotesdb): resolve triage — d1-migrations-in-opentofu-nullresource-localexec-vs-separate`
|
|
</commit>
|