Move schema_migrations table creation into 000.sql with INTEGER version column #90
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Per sneak/pixa PR #36, the standard migrations pattern should be:
schema_migrationstable DDL lives in000.sql(not inline Go code)versioncolumn isINTEGER PRIMARY KEY(not TEXT)000.sqlis self-contained — contains bothCREATE TABLE IF NOT EXISTSandINSERT OR IGNORE INTO schema_migrations (version) VALUES (0)000.sqlThis repo currently creates the migrations table inline in Go code. It should be moved to follow the pixa pattern.
Reference implementation: sneak/pixa
000.sqlanddatabase.go.This issue does not apply to dnswatcher. The repo uses JSON file-based state persistence (
internal/state/state.go→DATA_DIR/state.json), not SQLite. There are:.sqlfiles anywhere in the repodatabasepackagego.modschema_migrationstable creation (inline or otherwise)The issue description states "This repo currently creates the migrations table inline in Go code" — this is factually incorrect. dnswatcher has never used SQLite.
The referenced pattern from sneak/pixa PR #36 applies to repos with existing SQLite migration infrastructure. dnswatcher has none.
Recommendation: close this issue as not applicable, or re-scope it if there's a planned migration from JSON state to SQLite (which would be a much larger piece of work than what's described here).