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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user