From 015a331bc323b6bd5b0ee093d7f1b759efb713e8 Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Sat, 28 Sep 2024 09:34:30 +1000 Subject: [PATCH 1/2] Fixed unit tests --- README.md | 7 +++++++ go.mod | 1 - migration_test.go | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..8efcb67 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# litemigrate + +Small migration library for Sqlite3 databases using [modernc.org sqlite3](https://pkg.go.dev/modernc.org/sqlite) +driver. + +This was mainly written for my own purposes. Others are free to look at the code if they want, +but I make no guarantees that it'll work or that it won't blow away your database. Use at your own risk. diff --git a/go.mod b/go.mod index 38a2c1c..f669222 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.22.4 require ( github.com/Southclaws/fault v0.8.1 - github.com/lmika/blogging-tools v0.0.0-20240630114557-8db2b3aa93e6 github.com/lmika/gopkgs v0.0.0-20240408110817-a02f6fc67d1f github.com/stretchr/testify v1.9.0 modernc.org/sqlite v1.33.1 diff --git a/migration_test.go b/migration_test.go index 98db1bf..2aac5af 100644 --- a/migration_test.go +++ b/migration_test.go @@ -3,8 +3,8 @@ package migration_test import ( "context" "database/sql" - "github.com/lmika/blogging-tools/providers/db/migration" "github.com/stretchr/testify/assert" + migration "lmika.dev/pkg/litemigrate" "os" "path/filepath" "testing" From 4b970289080be1a6697bc31328799b699c139ac3 Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Wed, 6 Nov 2024 22:16:17 +0000 Subject: [PATCH 2/2] Renamed package to litemigrate and removed blogging-tools dependency --- db.go | 2 +- go.sum | 2 -- migration.go | 2 +- migration_test.go | 6 +++--- opts.go | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/db.go b/db.go index 986f0d4..251980c 100644 --- a/db.go +++ b/db.go @@ -1,4 +1,4 @@ -package migration +package litemigrate import ( "context" diff --git a/go.sum b/go.sum index a278bba..eb7c7a6 100644 --- a/go.sum +++ b/go.sum @@ -10,8 +10,6 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/lmika/blogging-tools v0.0.0-20240630114557-8db2b3aa93e6 h1:WHM70gRzPTKHSKm/wf2kp3HErXzMpmcqfkGjHlhtu1Y= -github.com/lmika/blogging-tools v0.0.0-20240630114557-8db2b3aa93e6/go.mod h1:w4rGqiE0+/FDUNWiIhfPGSPfT948/9Yw+cja12zOb4o= github.com/lmika/gopkgs v0.0.0-20240408110817-a02f6fc67d1f h1:tz68Lhc1oR15HVz69IGbtdukdH0x70kBDEvvj5pTXyE= github.com/lmika/gopkgs v0.0.0-20240408110817-a02f6fc67d1f/go.mod h1:zHQvhjGXRro/Xp2C9dbC+ZUpE0gL4GYW75x1lk7hwzI= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= diff --git a/migration.go b/migration.go index af061bc..2633477 100644 --- a/migration.go +++ b/migration.go @@ -1,4 +1,4 @@ -package migration +package litemigrate import ( "context" diff --git a/migration_test.go b/migration_test.go index 2aac5af..553013f 100644 --- a/migration_test.go +++ b/migration_test.go @@ -1,10 +1,10 @@ -package migration_test +package litemigrate_test import ( "context" "database/sql" "github.com/stretchr/testify/assert" - migration "lmika.dev/pkg/litemigrate" + "lmika.dev/pkg/litemigrate" "os" "path/filepath" "testing" @@ -20,7 +20,7 @@ func TestMigrator_MigrateUp(t *testing.T) { defer closeFn() fileMigrated := make([]string, 0) - migrator := migration.New(testMigration, db, migration.WithPreStepHook(func(filename string) { + migrator := litemigrate.New(testMigration, db, litemigrate.WithPreStepHook(func(filename string) { fileMigrated = append(fileMigrated, filename) })) diff --git a/opts.go b/opts.go index 04f2e6c..5a430bb 100644 --- a/opts.go +++ b/opts.go @@ -1,4 +1,4 @@ -package migration +package litemigrate type Option func(m *Migrator)