Commit Graph

194 Commits

Author SHA1 Message Date
Andrea Maria Piana 604309dd45
configurable migration table 2019-10-14 10:50:56 +02:00
Adam Babik d4b77d81b5
use v4 in sqlcipher 2019-10-14 10:50:56 +02:00
Andrea Maria Piana 9b09c4f75c
Add sqlcipher 2019-10-14 10:50:27 +02:00
Calvin Tuong 9ef241d273 Update postgres driver Lock comment to reflect actual behavior 2019-09-24 13:57:01 -07:00
ch3rub1m 0601111d88 Remove debug output 2019-08-28 18:36:44 +08:00
Dale Hui 0064ee83cf Properly filter out custom query params in MySQL DB driver
Addresses: https://github.com/golang-migrate/migrate/issues/272
2019-08-22 00:03:26 -07:00
Erik Dubbelboer e5b4be7771 Let database.Open() use schemeFromURL as well (#271)
* Let database.Open() use schemeFromURL as well

Otherwise it will fail on MySQL DSNs.

Moved schemeFromURL into the database package. Also removed databaseSchemeFromURL
and sourceSchemeFromURL as they were just calling schemeFromURL.

Fixes https://github.com/golang-migrate/migrate/pull/265#issuecomment-522301237

* Moved url functions into internal/url

Also merged the test cases.

* Add some database tests to improve coverage

* Fix suggestions
2019-08-20 09:59:15 -07:00
Dale Hui d068374972 Test against MS SQL Server 2019-CTP3.1 (Ubuntu) 2019-08-18 23:37:33 -07:00
Dale Hui 947936279a Update firebird README to reflect lack of official support 2019-08-18 23:34:07 -07:00
zikaeroh d80e0e2f7f Merge branch 'master' into fix-mongodb-dep 2019-08-17 08:13:16 -07:00
Erik Dubbelboer eb7d0dd6a1 Fix in the URL parser with go 1.12.8 and github.com/go-sql-driver/mysql (#265)
* Fix in the URL parser with go 1.12.8 and github.com/go-sql-driver/mysql

Change schemeFromURL to just split the url by :// to find the scheme.
It's not required to parse the whole URL. MySQL DSNs aren't valid URLs.

Fixes #264

* The mysql driver itself also used net/url.Parse

* Also fix TestPasswordUnencodedReservedURLChars

* Keep backwards compatibility with url encoded username and passwords

* Fix suggestions

* Reuse old function names
2019-08-16 23:09:12 -07:00
zikaeroh 9e406c40b5 Update MongoDB driver to 1.1.0, use correct import path 2019-08-14 17:40:52 -07:00
Marcin K 12f7e22e36 Put tutorial specific info into a separate file 2019-08-11 22:06:04 +02:00
Dale Hui cde3cfc30d Fix broken sqlite tests
Since v4.3.0, Migrate.Drop() no longer recreates the migrate schema version table.
See: https://github.com/golang-migrate/migrate/releases/tag/v4.3.0
2019-06-21 00:15:01 -07:00
Thomas Lokshall ffbd6893f6 sqlserver: update comment referencing mssql 2019-05-27 08:20:35 +02:00
Thomas Lokshall bad962cf21 Merge branch 'mssql-params' of https://github.com/zhevron/migrate into mssql-params 2019-05-24 15:16:24 +02:00
Thomas Lokshall 293bfec844 rename mssql driver to sqlserver 2019-05-24 15:16:12 +02:00
Thomas Lokshall bc0b686fc0
Merge branch 'master' into mssql-params 2019-05-23 11:12:50 +02:00
Thomas Lokshall e08ae0e996 mssql: remove mssql registration, document only support for sqlserver driver 2019-05-23 09:43:13 +02:00
Alex Pliutau e877644ed1 Fix MongoDB docs: x-migrations-collection (#225) 2019-05-22 18:29:44 -07:00
Thomas Lokshall 3d4dad5655 mssql: use sqlserver driver instead of deprecated mssql driver 2019-05-22 14:10:37 +02:00
Thomas Lokshall ec3ae16f2e mssql: fix sp_MSforeachtable parameter 2019-05-22 14:09:50 +02:00
Thomas Lokshall 9f282f4ee3 use correct mssql parameter syntax 2019-05-22 10:34:53 +02:00
Ferdy Pruis e85c5f51b9 Disable foreign_key_checks in Drop command for MySQL (#224)
* Disable FOREIGN_KEY_CHECKS in MySQL when dropping all tables.

* Lowercased system variable

* Discard error enabling foreign_key_checks, dropping is already successful at this point

* Explicitly discard error
2019-05-21 10:56:37 -07:00
Nathan Collard aeb7f633f3 mssql: fix code review comments 2019-05-21 08:44:17 +01:00
Nathan Collard 7817573893 Merge remote-tracking branch 'root/master' 2019-05-21 08:21:33 +01:00
Dale Hui 923901c81f Cleanup regex usage in spanner DB driver
- Only compile a regex once for re-use
    - Don't use regex unnecessarily (removing trailing semicolon)
    - Add test for parsing multiple statements in a migration
2019-05-20 08:28:07 -07:00
nathan-c e211c5b5f5 mssql: increase pull timeout 2019-05-19 21:36:50 +01:00
nathan-c 98e5f88b9f mssql: fix error parsing and add tests 2019-05-19 16:08:15 +01:00
nathan-c 5ac583ba7b mssql: fix linter errors 2019-05-19 15:21:25 +01:00
nathan-c 3bd91a774e mssql: reorder readme 2019-05-19 15:15:07 +01:00
nathan-c 95290f2fbd mssql: change migration table name and add readme 2019-05-19 15:09:56 +01:00
nathan-c c273636efe parse mssql errors 2019-05-19 14:08:10 +01:00
nathan-c ae500dbe45 finish implementing mssql db and add tests 2019-05-19 13:37:40 +01:00
nathan-c 50e972912d Merge remote-tracking branch 'evosure/mssql' 2019-05-18 14:39:55 +01:00
Dale Hui 66510b82c4 Remove official support for Firebird
- In the future, support for Firebird should also include v2.5
2019-04-26 19:04:05 -07:00
Kirill Muratov 6c96ef02df Enabled maligned, staticcheck and errcheck linters (#206)
* Enabled maligned check

* Enabled staticcheck

* Fixes for golint

* Enabled errcheck linter

* Added fixes for error check

* Added errcheck for tests

* Fixed test

* Increased golangci-lint deadline for travis

* Increased golangci-lint deadline for travis

* Decreased golangci-lint deadline for travis

* Revert for backward compatibility

* Using log.Println() instead of fmt.Println()

* Handling os.RemoveAll() errors

* Using t.Error(error) instead of t.Errorf("%v", err)

* Using t.Fatal(error) instead of t.Fatalf("%v", err)

* Using fmt.Sprint(sum) instead of t.Srintf("%v", sum)

* Refactoring

* Revert for backward compatibility

* Revert

* go mod tidy

* Added error logging

* Added error logging

* Added error handling

* Added error handling

* Added error logging

* Fix error logging

* Added error handling

* Fix

* Added logging for migr.Buffer()

* Fixes

* Firebird test disabled

* Fixed nolint comment

* Updated firebird docker image version

* Disabled test for firebird 2.5

* Fixed // nolint
2019-04-26 15:47:16 -07:00
Dale Hui 16197b67e3 Update to golangci-lint v1.16.0
- Fix newly raised issues
2019-04-07 00:51:27 -07:00
Dale Hui 43e4503343 Update golangci-lint config and implore contributors to use it
- Run golangci-lint on tests and fix found issues
2019-03-28 18:55:12 -07:00
Kirill Muratov be4c129168 Added interfacer, unconvert, goconst, nakedret, prealloc 2019-03-23 00:40:35 +03:00
Kirill Muratov 465060c9a7 Fixes for gosimple linter 2019-03-22 22:02:08 +03:00
Kirill Muratov 2c9773ed89 Added Firebird support (#191)
* 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
2019-03-21 01:51:49 -07:00
Cyrille Hemidy 46fb82ce3d Fmt (#189)
* fix gofmt -s

* fix gofmt -s + fix mispelling
2019-03-13 12:15:21 -07:00
Dale Hui 5e004dbef4 Fix issues with new version of MongoDB driver:
- "connect=single" option is no longer supported
        - "connect=direct" is the equivalent
        - https://jira.mongodb.org/browse/GODRIVER-665
    - Count() needs to be passed a non-nil filter/document
        - https://jira.mongodb.org/browse/GODRIVER-572
2019-03-01 17:44:40 -08:00
Lukas Joergensen 480a5a634a postgres: Move lock out of ensureVersionTable, for consistency with other SQL operations (#173)
* 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
2019-02-26 15:56:57 -08:00
Dale Hui 0f8263de2e Remove unnecessary panics from core implementation 2019-02-19 02:07:07 -08:00
Jesse Szwedko 3db0395e0a Replace " quoting with pq.QuoteIdentifier for postgres driver 2019-02-18 11:44:38 +01:00
Jesse Szwedko fe66cd7734 Quote postgres table identifiers when `DROP`ing
Handles table identifiers that are invalid without quotes (such as
uppercase letters).
2019-02-18 11:29:10 +01:00
Brian Wigginton 9b551a1c10 initial mssql support 2019-02-15 16:12:57 -06:00
Dale Hui c0f025d2f6
Merge pull request #167 from arpando/fix/DocumentNilError
Fix document nil error
2019-02-05 03:48:34 -08:00