* ci: update golangci-lint to v2
update method:
```
golangci-lint migrate
golangci-lint run --fix
```
and fix the last ones manually
* Apply suggestion from @Copilot
* fix tests
---------
Co-authored-by: Hanzo Dev <[email protected]>
* feat: remove dependency on "hashicorp/go-multierror"
It seems the project has been unmainted for quite some time already,
see for example https://github.com/hashicorp/go-multierror/issues/97
and https://github.com/hashicorp/go-multierror/issues/98.
This also removes an uneccessary dependency which slims down the go.mod.
Go as of version 1.20 supports appending errors by specifying
multiple "%w" formatters in the "fmt.Errorf"[^0] function.
[^0]: https://pkg.go.dev/fmt#Errorf
* feat: use errors.Join to combine multiple errors
As an update to the previous commit 59f084ea3be2e7ec9d912c1a311402b1e4c40df6,
use "errors.Join"[^0] instead of multiple "%w" formatters for "fmt.Errorf".
[^0]: https://pkg.go.dev/errors#Join
* chore: bring back unused util.go file as removing it is a breaking change
* Run go mod tidy
* Fix Github linting action
Changes:
* checkout before setting up go
* pin golangci-lint version
* Update supported db versions
* Use start-single-node instead of start for cockroachdb
As of Go 1.16, the same functionality is now provided by package io or
package os, and those implementations should be preferred in new code.
So replacing all usage of ioutil pkg with io & os.
* used uber atomic bool instead standard in lock/unlock db
* fixing local lock optimization implementation
* fixing mysql local lock optimization implementation
* fixing cockroachdb local lock optimization implementation
* CAS wrapper to automatically restore
* added test for cas with restore
* added atomic lock to sqlite & mongo
* added atomic lock to sqlite & mongo
* fix/refactor test cas restore function
* disable lock for mongo
* mongo local lock before acquiring the db lock
Co-authored-by: a.prinkov <[email protected]>
* Postgres and pgx - Add x-migrations-table-quoted url query option to postgres and pgx drivers (#95)
By default, gomigrate quote migrations table name, if `x-migrations-table-quoted` is enabled, then you must to quote migrations table name manually, for instance `"gomigrate"."schema_migrations"`
* Work In Progress
* Force MigrationsTable on public schema
* Revert "Force MigrationsTable on public schema"
This reverts commit e5b25e8858ed42d19d420cb8bd16795c060994d2.
* Add example to fix search_path issue
* Use POSTGRESQL_URL in example and fix typo
* Make example simpler by using the `search_path` query parameter of the DB URL
* Added Firebird support
* Fixed typo
* Refactoring
* Schema migrations table name don't have to be upper case
* Fixed readme
* Added Firebird 2.5 support
* Removed SchemaName
* Refactoring
* Consistently lock in ensureVersionTable and do not call ensureVersionTable from Drop across all database implementations
* Add test for dropping postgres databases
* Fix failing database tests
* Fix CockroachDb test, lock table should be created before versionTable
* Add Initialize() to Driver interface, and add integration tests for Drop() between database implementations and migrate
* Remove Initialize, document breaking behaviour of Drop
* Revert introduction of Initialize method
* Removed Initialize in Stub as well
* Remove call to non-existent Initialize and make sure to close re-initialized database connections
* Revert changes to TestDrop in database/testing
* Split Test and TestMigrate into different test entrypoints
* Remove unused import in migrate_testing
* Remove erroneous code to fix tests
* Add stub source imports to database tests
* Add Stub source to migrate tests
* Use example migrations for tests
* Add file driver to database tests
* Align database directory layout
* Add file source driver to Cassandra
* Review changes
* Minor syntactic change for cleaner diff
This commit reverts back to querying the existance of the table instead
of using CREATE IF NOT EXISTS because we want to support versions of
Postgres older than 9.1 which is when this feature was introduced.
- Leaving migrate/testing in case there are unknown consumers
- Add migrate/dktesting package
- Update tests to use migrate/dktesting instead of migrate/testing