mirror of
https://github.com/therootcompany/golib.git
synced 2026-04-24 12:48:00 +00:00
Migration{ID, Name} is the identity type returned by Up/Down/Latest/Drop.
Script{Migration, Up, Down} holds collected SQL content from Collect().
Migrator interface now takes SQL as a separate parameter:
ExecUp(ctx, Migration, sql string)
ExecDown(ctx, Migration, sql string)
This separates identity from content — callers that track what ran
don't need to carry around SQL strings they'll never use.
Updates shmigrate to match (ignores the sql parameter, references
files on disk instead).
21 lines
620 B
Modula-2
21 lines
620 B
Modula-2
module github.com/therootcompany/golib/cmd/sql-migrate/v2
|
|
|
|
go 1.26.1
|
|
|
|
require (
|
|
github.com/jackc/pgx/v5 v5.9.1
|
|
github.com/therootcompany/golib/database/sqlmigrate v1.0.0
|
|
github.com/therootcompany/golib/database/sqlmigrate/shmigrate v0.0.0
|
|
)
|
|
|
|
require (
|
|
github.com/jackc/pgpassfile v1.0.0 // indirect
|
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
|
golang.org/x/text v0.29.0 // indirect
|
|
)
|
|
|
|
replace (
|
|
github.com/therootcompany/golib/database/sqlmigrate => ../../database/sqlmigrate
|
|
github.com/therootcompany/golib/database/sqlmigrate/shmigrate => ../../database/sqlmigrate/shmigrate
|
|
)
|