fix: implement migration tracking and make 0002 idempotent

- Add schema_migrations table to track applied migrations
- Migrate() now checks if a migration was already applied before running
- 0002 rewritten to use SAVEPOINT+ROLLBACK per column, making it safe
  to run even if some columns were partially added previously
- Each migration runs in its own transaction; INSERT into schema_migrations
  only happens if the SQL executes without error
- Bump VERSION 0.1.8 -> 0.1.9
This commit is contained in:
2026-07-05 23:54:14 -04:00
parent 3d956d43c2
commit 9a9d4cc753
3 changed files with 91 additions and 10 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
BINARY=nasctl
VERSION?=0.1.8
VERSION?=0.1.9
GO?=go
LDFLAGS=-s -w -X github.com/darroyo/nasctl/internal/web.Version=$(VERSION) -X github.com/darroyo/nasctl/internal/web.Commit=$(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
BUILD_FLAGS=CGO_ENABLED=0