Skip to content

Commit

Permalink
Use v4 for Go module support
Browse files Browse the repository at this point in the history
  • Loading branch information
dhui committed Oct 10, 2018
1 parent 60b45ba commit fc2b2e9
Show file tree
Hide file tree
Showing 56 changed files with 94 additions and 94 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ __[Go Documentation](https://godoc.org/github.com/golang-migrate/migrate)__

```go
import (
"github.com/golang-migrate/migrate/v3"
_ "github.com/golang-migrate/migrate/v3/database/postgres"
_ "github.com/golang-migrate/migrate/v3/source/github"
"github.com/golang-migrate/migrate/v4"
_ "github.com/golang-migrate/migrate/v4/database/postgres"
_ "github.com/golang-migrate/migrate/v4/source/github"
)

func main() {
Expand All @@ -126,9 +126,9 @@ Want to use an existing database client?
import (
"database/sql"
_ "github.com/lib/pq"
"github.com/golang-migrate/migrate/v3"
"github.com/golang-migrate/migrate/v3/database/postgres"
_ "github.com/golang-migrate/migrate/v3/source/file"
"github.com/golang-migrate/migrate/v4"
"github.com/golang-migrate/migrate/v4/database/postgres"
_ "github.com/golang-migrate/migrate/v4/source/file"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion cli/build_aws-s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
package main

import (
_ "github.com/golang-migrate/migrate/v3/source/aws_s3"
_ "github.com/golang-migrate/migrate/v4/source/aws_s3"
)
2 changes: 1 addition & 1 deletion cli/build_cassandra.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
package main

import (
_ "github.com/golang-migrate/migrate/v3/database/cassandra"
_ "github.com/golang-migrate/migrate/v4/database/cassandra"
)
2 changes: 1 addition & 1 deletion cli/build_clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
package main

import (
_ "github.com/golang-migrate/migrate/v3/database/clickhouse"
_ "github.com/golang-migrate/migrate/v4/database/clickhouse"
_ "github.com/kshvakov/clickhouse"
)
2 changes: 1 addition & 1 deletion cli/build_cockroachdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
package main

import (
_ "github.com/golang-migrate/migrate/v3/database/cockroachdb"
_ "github.com/golang-migrate/migrate/v4/database/cockroachdb"
)
2 changes: 1 addition & 1 deletion cli/build_github.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
package main

import (
_ "github.com/golang-migrate/migrate/v3/source/github"
_ "github.com/golang-migrate/migrate/v4/source/github"
)
2 changes: 1 addition & 1 deletion cli/build_go-bindata.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
package main

import (
_ "github.com/golang-migrate/migrate/v3/source/go_bindata"
_ "github.com/golang-migrate/migrate/v4/source/go_bindata"
)
2 changes: 1 addition & 1 deletion cli/build_godoc-vfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
package main

import (
_ "github.com/golang-migrate/migrate/v3/source/godoc_vfs"
_ "github.com/golang-migrate/migrate/v4/source/godoc_vfs"
)
2 changes: 1 addition & 1 deletion cli/build_google-cloud-storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
package main

import (
_ "github.com/golang-migrate/migrate/v3/source/google_cloud_storage"
_ "github.com/golang-migrate/migrate/v4/source/google_cloud_storage"
)
2 changes: 1 addition & 1 deletion cli/build_mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
package main

import (
_ "github.com/golang-migrate/migrate/v3/database/mysql"
_ "github.com/golang-migrate/migrate/v4/database/mysql"
)
2 changes: 1 addition & 1 deletion cli/build_postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
package main

import (
_ "github.com/golang-migrate/migrate/v3/database/postgres"
_ "github.com/golang-migrate/migrate/v4/database/postgres"
)
2 changes: 1 addition & 1 deletion cli/build_ql.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
package main

import (
_ "github.com/golang-migrate/migrate/v3/database/ql"
_ "github.com/golang-migrate/migrate/v4/database/ql"
)
2 changes: 1 addition & 1 deletion cli/build_redshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
package main

import (
_ "github.com/golang-migrate/migrate/v3/database/redshift"
_ "github.com/golang-migrate/migrate/v4/database/redshift"
)
2 changes: 1 addition & 1 deletion cli/build_spanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
package main

import (
_ "github.com/golang-migrate/migrate/v3/database/spanner"
_ "github.com/golang-migrate/migrate/v4/database/spanner"
)
2 changes: 1 addition & 1 deletion cli/build_sqlite3.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
package main

import (
_ "github.com/golang-migrate/migrate/v3/database/sqlite3"
_ "github.com/golang-migrate/migrate/v4/database/sqlite3"
)
6 changes: 3 additions & 3 deletions cli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package main
import (
"errors"
"fmt"
"github.com/golang-migrate/migrate/v3"
_ "github.com/golang-migrate/migrate/v3/database/stub" // TODO remove again
_ "github.com/golang-migrate/migrate/v3/source/file"
"github.com/golang-migrate/migrate/v4"
_ "github.com/golang-migrate/migrate/v4/database/stub" // TODO remove again
_ "github.com/golang-migrate/migrate/v4/source/file"
"os"
"path/filepath"
"strconv"
Expand Down
6 changes: 3 additions & 3 deletions cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"syscall"
"time"

"github.com/golang-migrate/migrate/v3"
"github.com/golang-migrate/migrate/v3/database"
"github.com/golang-migrate/migrate/v3/source"
"github.com/golang-migrate/migrate/v4"
"github.com/golang-migrate/migrate/v4/database"
"github.com/golang-migrate/migrate/v4/source"
)

const defaultTimeFormat = "20060102150405"
Expand Down
2 changes: 1 addition & 1 deletion database/cassandra/cassandra.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"github.com/gocql/gocql"
"github.com/golang-migrate/migrate/v3/database"
"github.com/golang-migrate/migrate/v4/database"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions database/cassandra/cassandra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/gocql/gocql"

dt "github.com/golang-migrate/migrate/v3/database/testing"
mt "github.com/golang-migrate/migrate/v3/testing"
dt "github.com/golang-migrate/migrate/v4/database/testing"
mt "github.com/golang-migrate/migrate/v4/testing"
)

var versions = []mt.Version{
Expand Down
4 changes: 2 additions & 2 deletions database/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"strings"
"time"

"github.com/golang-migrate/migrate/v3"
"github.com/golang-migrate/migrate/v3/database"
"github.com/golang-migrate/migrate/v4"
"github.com/golang-migrate/migrate/v4/database"
)

var DefaultMigrationsTable = "schema_migrations"
Expand Down
4 changes: 2 additions & 2 deletions database/cockroachdb/cockroachdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
)

import (
"github.com/golang-migrate/migrate/v3"
"github.com/golang-migrate/migrate/v3/database"
"github.com/golang-migrate/migrate/v4"
"github.com/golang-migrate/migrate/v4/database"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions database/cockroachdb/cockroachdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"testing"

"bytes"
dt "github.com/golang-migrate/migrate/v3/database/testing"
mt "github.com/golang-migrate/migrate/v3/testing"
dt "github.com/golang-migrate/migrate/v4/database/testing"
mt "github.com/golang-migrate/migrate/v4/testing"
"github.com/lib/pq"
)

Expand Down
4 changes: 2 additions & 2 deletions database/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
)

import (
"github.com/golang-migrate/migrate/v3"
"github.com/golang-migrate/migrate/v3/database"
"github.com/golang-migrate/migrate/v4"
"github.com/golang-migrate/migrate/v4/database"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions database/mysql/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
)

import (
dt "github.com/golang-migrate/migrate/v3/database/testing"
mt "github.com/golang-migrate/migrate/v3/testing"
dt "github.com/golang-migrate/migrate/v4/database/testing"
mt "github.com/golang-migrate/migrate/v4/testing"
)

var versions = []mt.Version{
Expand Down
4 changes: 2 additions & 2 deletions database/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"strconv"
"strings"

"github.com/golang-migrate/migrate/v3"
"github.com/golang-migrate/migrate/v3/database"
"github.com/golang-migrate/migrate/v4"
"github.com/golang-migrate/migrate/v4/database"
"github.com/lib/pq"
)

Expand Down
4 changes: 2 additions & 2 deletions database/postgres/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"strings"
"testing"

dt "github.com/golang-migrate/migrate/v3/database/testing"
mt "github.com/golang-migrate/migrate/v3/testing"
dt "github.com/golang-migrate/migrate/v4/database/testing"
mt "github.com/golang-migrate/migrate/v4/testing"
)

var versions = []mt.Version{
Expand Down
4 changes: 2 additions & 2 deletions database/ql/ql.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
nurl "net/url"

_ "github.com/cznic/ql/driver"
"github.com/golang-migrate/migrate/v3"
"github.com/golang-migrate/migrate/v3/database"
"github.com/golang-migrate/migrate/v4"
"github.com/golang-migrate/migrate/v4/database"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions database/ql/ql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"testing"

_ "github.com/cznic/ql/driver"
"github.com/golang-migrate/migrate/v3"
dt "github.com/golang-migrate/migrate/v3/database/testing"
_ "github.com/golang-migrate/migrate/v3/source/file"
"github.com/golang-migrate/migrate/v4"
dt "github.com/golang-migrate/migrate/v4/database/testing"
_ "github.com/golang-migrate/migrate/v4/source/file"
)

func Test(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions database/redshift/redshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package redshift
import (
"net/url"

"github.com/golang-migrate/migrate/v3/database"
"github.com/golang-migrate/migrate/v3/database/postgres"
"github.com/golang-migrate/migrate/v4/database"
"github.com/golang-migrate/migrate/v4/database/postgres"
)

// init registers the driver under the name 'redshift'
Expand Down
4 changes: 2 additions & 2 deletions database/spanner/spanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"cloud.google.com/go/spanner"
sdb "cloud.google.com/go/spanner/admin/database/apiv1"

"github.com/golang-migrate/migrate/v3"
"github.com/golang-migrate/migrate/v3/database"
"github.com/golang-migrate/migrate/v4"
"github.com/golang-migrate/migrate/v4/database"

"google.golang.org/api/iterator"
adminpb "google.golang.org/genproto/googleapis/spanner/admin/database/v1"
Expand Down
2 changes: 1 addition & 1 deletion database/spanner/spanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"testing"

dt "github.com/golang-migrate/migrate/v3/database/testing"
dt "github.com/golang-migrate/migrate/v4/database/testing"
)

func Test(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions database/sqlite3/sqlite3.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package sqlite3
import (
"database/sql"
"fmt"
"github.com/golang-migrate/migrate/v3"
"github.com/golang-migrate/migrate/v3/database"
"github.com/golang-migrate/migrate/v4"
"github.com/golang-migrate/migrate/v4/database"
_ "github.com/mattn/go-sqlite3"
"io"
"io/ioutil"
Expand Down
6 changes: 3 additions & 3 deletions database/sqlite3/sqlite3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package sqlite3
import (
"database/sql"
"fmt"
"github.com/golang-migrate/migrate/v3"
dt "github.com/golang-migrate/migrate/v3/database/testing"
_ "github.com/golang-migrate/migrate/v3/source/file"
"github.com/golang-migrate/migrate/v4"
dt "github.com/golang-migrate/migrate/v4/database/testing"
_ "github.com/golang-migrate/migrate/v4/source/file"
_ "github.com/mattn/go-sqlite3"
"io/ioutil"
"os"
Expand Down
2 changes: 1 addition & 1 deletion database/stub/stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io/ioutil"
"reflect"

"github.com/golang-migrate/migrate/v3/database"
"github.com/golang-migrate/migrate/v4/database"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion database/stub/stub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package stub
import (
"testing"

dt "github.com/golang-migrate/migrate/v3/database/testing"
dt "github.com/golang-migrate/migrate/v4/database/testing"
)

func Test(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion database/testing/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"testing"
"time"

"github.com/golang-migrate/migrate/v3/database"
"github.com/golang-migrate/migrate/v4/database"
)

// Test runs tests against database implementations.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/golang-migrate/migrate/v3
module github.com/golang-migrate/migrate/v4

require (
cloud.google.com/go v0.27.0
Expand Down
4 changes: 2 additions & 2 deletions migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"sync"
"time"

"github.com/golang-migrate/migrate/v3/database"
"github.com/golang-migrate/migrate/v3/source"
"github.com/golang-migrate/migrate/v4/database"
"github.com/golang-migrate/migrate/v4/source"
)

// DefaultPrefetchMigrations sets the number of migrations to pre-read
Expand Down
Loading

0 comments on commit fc2b2e9

Please sign in to comment.