Align MySQL migration 008 with sqlite/postgres (H-12 partial) #116

Merged
qwc merged 1 commit from fix/migration-008-mysql-default into main 2026-05-19 07:17:06 +02:00
Owner

Summary

  • Add DEFAULT '' to upload_logs.filename in MySQL migration 008 so it matches sqlite and postgres.
  • Harmless for existing deployments: the only INSERT site (internal/store/sql/upload_log.go:20) always passes filename, and TEXT NOT NULL DEFAULT 'archive' on the same table proves the targeted MySQL version supports DEFAULT on TEXT.

The companion piece — a TestMigrationsAllDialects using testcontainers to assert column-list parity — is deferred; it needs Docker available wherever tests run, and the current sandbox doesn't have it.

Test plan

  • go test ./internal/database/... ./internal/store/... — green.

Audit item: H-12 (High / Arch), partial.

🤖 Generated with Claude Code

## Summary - Add `DEFAULT ''` to `upload_logs.filename` in MySQL migration 008 so it matches sqlite and postgres. - Harmless for existing deployments: the only INSERT site (`internal/store/sql/upload_log.go:20`) always passes `filename`, and `TEXT NOT NULL DEFAULT 'archive'` on the same table proves the targeted MySQL version supports `DEFAULT` on `TEXT`. The companion piece — a `TestMigrationsAllDialects` using testcontainers to assert column-list parity — is deferred; it needs Docker available wherever tests run, and the current sandbox doesn't have it. ## Test plan - [x] `go test ./internal/database/... ./internal/store/...` — green. Audit item: **H-12** (High / Arch), partial. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Align MySQL migration 008 with sqlite/postgres (H-12 partial)
All checks were successful
CI / test (pull_request) Successful in 1m19s
CI / build (pull_request) Successful in 56s
CI / docker (pull_request) Has been skipped
994706f096
The `upload_logs.filename` column was declared `TEXT NOT NULL` on
MySQL but `TEXT NOT NULL DEFAULT ''` on sqlite/postgres. Current code
always passes a value, so this is harmless today — but the drift is the
exact kind of thing the audit's full H-12 fix (multi-dialect migration
parity test) is meant to catch. Doing the reconcile now; the
testcontainers-based parity test is deferred (needs CI Docker).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
qwc merged commit 372c5af750 into main 2026-05-19 07:17:06 +02:00
qwc deleted branch fix/migration-008-mysql-default 2026-05-19 07:17:06 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
qwc-open/asiakirjat!116
No description provided.