Rename package name

This commit is contained in:
Jinzhu 2020-06-02 09:16:07 +08:00
parent 5ecbf25b22
commit e986371a42
103 changed files with 213 additions and 211 deletions

View File

@ -2,14 +2,14 @@
The fantastic ORM library for Golang, aims to be developer friendly. The fantastic ORM library for Golang, aims to be developer friendly.
[![go report card](https://goreportcard.com/badge/github.com/jinzhu/gorm "go report card")](https://goreportcard.com/report/github.com/jinzhu/gorm) [![go report card](https://goreportcard.com/badge/gorm.io/gorm "go report card")](https://goreportcard.com/report/gorm.io/gorm)
[![wercker status](https://app.wercker.com/status/8596cace912c9947dd9c8542ecc8cb8b/s/master "wercker status")](https://app.wercker.com/project/byKey/8596cace912c9947dd9c8542ecc8cb8b) [![wercker status](https://app.wercker.com/status/8596cace912c9947dd9c8542ecc8cb8b/s/master "wercker status")](https://app.wercker.com/project/byKey/8596cace912c9947dd9c8542ecc8cb8b)
[![codecov](https://codecov.io/gh/jinzhu/gorm/branch/master/graph/badge.svg)](https://codecov.io/gh/jinzhu/gorm) [![codecov](https://codecov.io/gh/jinzhu/gorm/branch/master/graph/badge.svg)](https://codecov.io/gh/jinzhu/gorm)
[![Join the chat at https://gitter.im/jinzhu/gorm](https://img.shields.io/gitter/room/jinzhu/gorm.svg)](https://gitter.im/jinzhu/gorm?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Join the chat at https://gitter.im/jinzhu/gorm](https://img.shields.io/gitter/room/jinzhu/gorm.svg)](https://gitter.im/jinzhu/gorm?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Open Collective Backer](https://opencollective.com/gorm/tiers/backer/badge.svg?label=backer&color=brightgreen "Open Collective Backer")](https://opencollective.com/gorm) [![Open Collective Backer](https://opencollective.com/gorm/tiers/backer/badge.svg?label=backer&color=brightgreen "Open Collective Backer")](https://opencollective.com/gorm)
[![Open Collective Sponsor](https://opencollective.com/gorm/tiers/sponsor/badge.svg?label=sponsor&color=brightgreen "Open Collective Sponsor")](https://opencollective.com/gorm) [![Open Collective Sponsor](https://opencollective.com/gorm/tiers/sponsor/badge.svg?label=sponsor&color=brightgreen "Open Collective Sponsor")](https://opencollective.com/gorm)
[![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT) [![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)
[![GoDoc](https://godoc.org/github.com/jinzhu/gorm?status.svg)](https://godoc.org/github.com/jinzhu/gorm) [![GoDoc](https://godoc.org/gorm.io/gorm?status.svg)](https://godoc.org/gorm.io/gorm)
## Overview ## Overview
@ -39,3 +39,4 @@ The fantastic ORM library for Golang, aims to be developer friendly.
© Jinzhu, 2013~time.Now © Jinzhu, 2013~time.Now
Released under the [MIT License](https://github.com/jinzhu/gorm/blob/master/License) Released under the [MIT License](https://github.com/jinzhu/gorm/blob/master/License)

View File

@ -6,9 +6,9 @@ import (
"reflect" "reflect"
"strings" "strings"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
"github.com/jinzhu/gorm/utils" "gorm.io/gorm/utils"
) )
// Association Mode contains some helper methods to handle relationship things easily. // Association Mode contains some helper methods to handle relationship things easily.

View File

@ -7,9 +7,9 @@ import (
"reflect" "reflect"
"time" "time"
"github.com/jinzhu/gorm/logger" "gorm.io/gorm/logger"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
"github.com/jinzhu/gorm/utils" "gorm.io/gorm/utils"
) )
func initializeCallbacks(db *DB) *callbacks { func initializeCallbacks(db *DB) *callbacks {

View File

@ -3,10 +3,10 @@ package callbacks
import ( import (
"reflect" "reflect"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
"github.com/jinzhu/gorm/utils" "gorm.io/gorm/utils"
) )
func SaveBeforeAssociations(db *gorm.DB) { func SaveBeforeAssociations(db *gorm.DB) {

View File

@ -1,7 +1,7 @@
package callbacks package callbacks
import ( import (
"github.com/jinzhu/gorm" "gorm.io/gorm"
) )
type Config struct { type Config struct {

View File

@ -3,9 +3,9 @@ package callbacks
import ( import (
"reflect" "reflect"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
func BeforeCreate(db *gorm.DB) { func BeforeCreate(db *gorm.DB) {

View File

@ -3,9 +3,9 @@ package callbacks
import ( import (
"reflect" "reflect"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
func BeforeDelete(db *gorm.DB) { func BeforeDelete(db *gorm.DB) {

View File

@ -3,8 +3,8 @@ package callbacks
import ( import (
"sort" "sort"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
) )
// SelectAndOmitColumns get select and omit columns, select -> true, omit -> false // SelectAndOmitColumns get select and omit columns, select -> true, omit -> false

View File

@ -1,6 +1,6 @@
package callbacks package callbacks
import "github.com/jinzhu/gorm" import "gorm.io/gorm"
type beforeSaveInterface interface { type beforeSaveInterface interface {
BeforeSave(*gorm.DB) error BeforeSave(*gorm.DB) error

View File

@ -3,10 +3,10 @@ package callbacks
import ( import (
"reflect" "reflect"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
"github.com/jinzhu/gorm/utils" "gorm.io/gorm/utils"
) )
func preload(db *gorm.DB, rels []*schema.Relationship, conds []interface{}) { func preload(db *gorm.DB, rels []*schema.Relationship, conds []interface{}) {

View File

@ -6,9 +6,9 @@ import (
"sort" "sort"
"strings" "strings"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
func Query(db *gorm.DB) { func Query(db *gorm.DB) {

View File

@ -1,7 +1,7 @@
package callbacks package callbacks
import ( import (
"github.com/jinzhu/gorm" "gorm.io/gorm"
) )
func RawExec(db *gorm.DB) { func RawExec(db *gorm.DB) {

View File

@ -1,7 +1,7 @@
package callbacks package callbacks
import ( import (
"github.com/jinzhu/gorm" "gorm.io/gorm"
) )
func RowQuery(db *gorm.DB) { func RowQuery(db *gorm.DB) {

View File

@ -1,7 +1,7 @@
package callbacks package callbacks
import ( import (
"github.com/jinzhu/gorm" "gorm.io/gorm"
) )
func BeginTransaction(db *gorm.DB) { func BeginTransaction(db *gorm.DB) {

View File

@ -4,9 +4,9 @@ import (
"reflect" "reflect"
"sort" "sort"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
func SetupUpdateReflectValue(db *gorm.DB) { func SetupUpdateReflectValue(db *gorm.DB) {

View File

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/utils" "gorm.io/gorm/utils"
) )
// Model specify the model you would like to run db operations // Model specify the model you would like to run db operations

View File

@ -4,10 +4,10 @@ import (
"sync" "sync"
"testing" "testing"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
"github.com/jinzhu/gorm/tests" "gorm.io/gorm/tests"
) )
func BenchmarkSelect(b *testing.B) { func BenchmarkSelect(b *testing.B) {

View File

@ -6,10 +6,10 @@ import (
"sync" "sync"
"testing" "testing"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
"github.com/jinzhu/gorm/tests" "gorm.io/gorm/tests"
) )
var db, _ = gorm.Open(tests.DummyDialector{}, nil) var db, _ = gorm.Open(tests.DummyDialector{}, nil)

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
) )
func TestDelete(t *testing.T) { func TestDelete(t *testing.T) {

View File

@ -5,10 +5,10 @@ import (
"sync" "sync"
"testing" "testing"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
"github.com/jinzhu/gorm/tests" "gorm.io/gorm/tests"
) )
func TestExpr(t *testing.T) { func TestExpr(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
) )
func TestFrom(t *testing.T) { func TestFrom(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
) )
func TestGroupBy(t *testing.T) { func TestGroupBy(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
) )
func TestInsert(t *testing.T) { func TestInsert(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
) )
func TestLimit(t *testing.T) { func TestLimit(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
) )
func TestFor(t *testing.T) { func TestFor(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
) )
func TestOrderBy(t *testing.T) { func TestOrderBy(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
) )
func TestReturning(t *testing.T) { func TestReturning(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
) )
func TestSelect(t *testing.T) { func TestSelect(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
) )
func TestSet(t *testing.T) { func TestSet(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
) )
func TestUpdate(t *testing.T) { func TestUpdate(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
) )
func TestValues(t *testing.T) { func TestValues(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
) )
func TestWhere(t *testing.T) { func TestWhere(t *testing.T) {

View File

@ -4,10 +4,10 @@ import (
"reflect" "reflect"
"sort" "sort"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/callbacks" "gorm.io/gorm/callbacks"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
func Create(db *gorm.DB) { func Create(db *gorm.DB) {

View File

@ -3,9 +3,9 @@ package mssql
import ( import (
"fmt" "fmt"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/migrator" "gorm.io/gorm/migrator"
) )
type Migrator struct { type Migrator struct {

View File

@ -7,12 +7,12 @@ import (
"strconv" "strconv"
_ "github.com/denisenkom/go-mssqldb" _ "github.com/denisenkom/go-mssqldb"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/callbacks" "gorm.io/gorm/callbacks"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/logger" "gorm.io/gorm/logger"
"github.com/jinzhu/gorm/migrator" "gorm.io/gorm/migrator"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
type Dialector struct { type Dialector struct {

View File

@ -3,9 +3,9 @@ package mysql
import ( import (
"fmt" "fmt"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/migrator" "gorm.io/gorm/migrator"
) )
type Migrator struct { type Migrator struct {

View File

@ -6,12 +6,12 @@ import (
"math" "math"
_ "github.com/go-sql-driver/mysql" _ "github.com/go-sql-driver/mysql"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/callbacks" "gorm.io/gorm/callbacks"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/logger" "gorm.io/gorm/logger"
"github.com/jinzhu/gorm/migrator" "gorm.io/gorm/migrator"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
type Dialector struct { type Dialector struct {

View File

@ -3,10 +3,10 @@ package postgres
import ( import (
"fmt" "fmt"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/migrator" "gorm.io/gorm/migrator"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
type Migrator struct { type Migrator struct {

View File

@ -6,12 +6,12 @@ import (
"regexp" "regexp"
"strconv" "strconv"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/callbacks" "gorm.io/gorm/callbacks"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/logger" "gorm.io/gorm/logger"
"github.com/jinzhu/gorm/migrator" "gorm.io/gorm/migrator"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
_ "github.com/lib/pq" _ "github.com/lib/pq"
) )

View File

@ -5,10 +5,10 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/migrator" "gorm.io/gorm/migrator"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
type Migrator struct { type Migrator struct {

View File

@ -3,12 +3,12 @@ package sqlite
import ( import (
"database/sql" "database/sql"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/callbacks" "gorm.io/gorm/callbacks"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/logger" "gorm.io/gorm/logger"
"github.com/jinzhu/gorm/migrator" "gorm.io/gorm/migrator"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
_ "github.com/mattn/go-sqlite3" _ "github.com/mattn/go-sqlite3"
) )

View File

@ -6,7 +6,7 @@ import (
"reflect" "reflect"
"strings" "strings"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
) )
// Create insert the value into database // Create insert the value into database

7
go.mod
View File

@ -1,4 +1,4 @@
module github.com/jinzhu/gorm module gorm.io/gorm
go 1.14 go 1.14
@ -6,8 +6,9 @@ require (
github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5
github.com/go-sql-driver/mysql v1.5.0 github.com/go-sql-driver/mysql v1.5.0
github.com/jinzhu/inflection v1.0.0 gorm.io/gorm v1.9.12
github.com/jinzhu/now v1.1.1 gorm.io/inflection v1.0.0
gorm.io/now v1.1.1
github.com/lib/pq v1.1.1 github.com/lib/pq v1.1.1
github.com/mattn/go-sqlite3 v2.0.1+incompatible github.com/mattn/go-sqlite3 v2.0.1+incompatible
) )

View File

@ -6,9 +6,9 @@ import (
"sync" "sync"
"time" "time"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/logger" "gorm.io/gorm/logger"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
// Config GORM config // Config GORM config

View File

@ -4,8 +4,8 @@ import (
"context" "context"
"database/sql" "database/sql"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
// Dialector GORM database dialector // Dialector GORM database dialector

View File

@ -6,7 +6,7 @@ import (
"os" "os"
"time" "time"
"github.com/jinzhu/gorm/utils" "gorm.io/gorm/utils"
) )
// Colors // Colors

View File

@ -4,8 +4,8 @@ import (
"regexp" "regexp"
"testing" "testing"
"github.com/jinzhu/gorm/logger" "gorm.io/gorm/logger"
"github.com/jinzhu/now" "gorm.io/now"
) )
func TestExplainSQL(t *testing.T) { func TestExplainSQL(t *testing.T) {

View File

@ -6,9 +6,9 @@ import (
"reflect" "reflect"
"strings" "strings"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
// Migrator m struct // Migrator m struct

View File

@ -5,7 +5,7 @@ import (
"reflect" "reflect"
"strings" "strings"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
func Scan(rows *sql.Rows, db *DB, initialized bool) { func Scan(rows *sql.Rows, db *DB, initialized bool) {

View File

@ -5,8 +5,8 @@ import (
"sync" "sync"
"testing" "testing"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
type UserWithCallback struct { type UserWithCallback struct {

View File

@ -5,7 +5,7 @@ import (
"sync" "sync"
"testing" "testing"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
type UserCheck struct { type UserCheck struct {

View File

@ -10,8 +10,8 @@ import (
"sync" "sync"
"time" "time"
"github.com/jinzhu/gorm/utils" "gorm.io/gorm/utils"
"github.com/jinzhu/now" "gorm.io/now"
) )
type DataType string type DataType string

View File

@ -7,9 +7,9 @@ import (
"testing" "testing"
"time" "time"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
"github.com/jinzhu/gorm/tests" "gorm.io/gorm/tests"
) )
func TestFieldValuerAndSetter(t *testing.T) { func TestFieldValuerAndSetter(t *testing.T) {

View File

@ -5,7 +5,7 @@ import (
"sync" "sync"
"testing" "testing"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
type UserIndex struct { type UserIndex struct {

View File

@ -4,8 +4,8 @@ import (
"database/sql" "database/sql"
"time" "time"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/tests" "gorm.io/gorm/tests"
) )
type User struct { type User struct {

View File

@ -7,7 +7,7 @@ import (
"sync" "sync"
"unicode/utf8" "unicode/utf8"
"github.com/jinzhu/inflection" "gorm.io/inflection"
) )
// Namer namer interface // Namer namer interface

View File

@ -6,8 +6,8 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/inflection" "gorm.io/inflection"
) )
// RelationshipType relationship type // RelationshipType relationship type

View File

@ -4,8 +4,8 @@ import (
"sync" "sync"
"testing" "testing"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
func checkStructRelation(t *testing.T, data interface{}, relations ...Relation) { func checkStructRelation(t *testing.T, data interface{}, relations ...Relation) {

View File

@ -8,8 +8,8 @@ import (
"reflect" "reflect"
"sync" "sync"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/logger" "gorm.io/gorm/logger"
) )
// ErrUnsupportedDataType unsupported data type // ErrUnsupportedDataType unsupported data type

View File

@ -6,8 +6,8 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
"github.com/jinzhu/gorm/tests" "gorm.io/gorm/tests"
) )
func checkSchema(t *testing.T, s *schema.Schema, v schema.Schema, primaryFields []string) { func checkSchema(t *testing.T, s *schema.Schema, v schema.Schema, primaryFields []string) {

View File

@ -4,8 +4,8 @@ import (
"sync" "sync"
"testing" "testing"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
"github.com/jinzhu/gorm/tests" "gorm.io/gorm/tests"
) )
func TestParseSchema(t *testing.T) { func TestParseSchema(t *testing.T) {

View File

@ -5,7 +5,7 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/jinzhu/gorm/utils" "gorm.io/gorm/utils"
) )
func ParseTagSetting(str string, sep string) map[string]string { func ParseTagSetting(str string, sep string) map[string]string {

View File

@ -5,8 +5,8 @@ import (
"database/sql/driver" "database/sql/driver"
"reflect" "reflect"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
type DeletedAt sql.NullTime type DeletedAt sql.NullTime

View File

@ -10,8 +10,8 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
// Statement statement // Statement statement

View File

@ -3,7 +3,7 @@ package tests_test
import ( import (
"testing" "testing"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestBelongsToAssociation(t *testing.T) { func TestBelongsToAssociation(t *testing.T) {

View File

@ -3,7 +3,7 @@ package tests_test
import ( import (
"testing" "testing"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestHasManyAssociation(t *testing.T) { func TestHasManyAssociation(t *testing.T) {

View File

@ -3,7 +3,7 @@ package tests_test
import ( import (
"testing" "testing"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestHasOneAssociation(t *testing.T) { func TestHasOneAssociation(t *testing.T) {

View File

@ -3,7 +3,7 @@ package tests_test
import ( import (
"testing" "testing"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestMany2ManyAssociation(t *testing.T) { func TestMany2ManyAssociation(t *testing.T) {

View File

@ -3,7 +3,7 @@ package tests_test
import ( import (
"testing" "testing"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func AssertAssociationCount(t *testing.T, data interface{}, name string, result int64, reason string) { func AssertAssociationCount(t *testing.T, data interface{}, name string, result int64, reason string) {

View File

@ -7,7 +7,7 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/jinzhu/gorm" "gorm.io/gorm"
) )
func assertCallbacks(v interface{}, fnames []string) (result bool, msg string) { func assertCallbacks(v interface{}, fnames []string) (result bool, msg string) {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestCount(t *testing.T) { func TestCount(t *testing.T) {

View File

@ -4,9 +4,9 @@ import (
"testing" "testing"
"time" "time"
"github.com/jinzhu/gorm" "gorm.io/gorm"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
"github.com/jinzhu/now" "gorm.io/now"
) )
func TestCreate(t *testing.T) { func TestCreate(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"testing" "testing"
"time" "time"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestCustomizeColumn(t *testing.T) { func TestCustomizeColumn(t *testing.T) {

View File

@ -4,8 +4,8 @@ import (
"errors" "errors"
"testing" "testing"
"github.com/jinzhu/gorm" "gorm.io/gorm"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestDelete(t *testing.T) { func TestDelete(t *testing.T) {

View File

@ -1,10 +1,10 @@
package tests package tests
import ( import (
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
"github.com/jinzhu/gorm/logger" "gorm.io/gorm/logger"
"github.com/jinzhu/gorm/schema" "gorm.io/gorm/schema"
) )
type DummyDialector struct { type DummyDialector struct {

View File

@ -3,8 +3,8 @@ package tests_test
import ( import (
"testing" "testing"
"github.com/jinzhu/gorm" "gorm.io/gorm"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestEmbeddedStruct(t *testing.T) { func TestEmbeddedStruct(t *testing.T) {

View File

@ -3,7 +3,7 @@ package tests_test
import ( import (
"testing" "testing"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestGroupBy(t *testing.T) { func TestGroupBy(t *testing.T) {

View File

@ -5,8 +5,8 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/jinzhu/gorm" "gorm.io/gorm"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
type Product struct { type Product struct {

View File

@ -4,8 +4,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/jinzhu/gorm" "gorm.io/gorm"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
type Person struct { type Person struct {

View File

@ -4,8 +4,8 @@ import (
"sort" "sort"
"testing" "testing"
"github.com/jinzhu/gorm" "gorm.io/gorm"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestJoins(t *testing.T) { func TestJoins(t *testing.T) {

View File

@ -3,7 +3,7 @@ package tests_test
import ( import (
"testing" "testing"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestMain(m *testing.M) { func TestMain(m *testing.M) {

View File

@ -6,8 +6,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/jinzhu/gorm" "gorm.io/gorm"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestMigrate(t *testing.T) { func TestMigrate(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"database/sql" "database/sql"
"time" "time"
"github.com/jinzhu/gorm" "gorm.io/gorm"
) )
// User has one `Account` (has one), many `Pets` (has many) and `Toys` (has many - polymorphic) // User has one `Account` (has one), many `Pets` (has many) and `Toys` (has many - polymorphic)

View File

@ -5,7 +5,7 @@ import (
"sort" "sort"
"testing" "testing"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
type Blog struct { type Blog struct {

View File

@ -3,7 +3,7 @@ package tests_test
import ( import (
"testing" "testing"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
type Hamster struct { type Hamster struct {

View File

@ -4,7 +4,7 @@ import (
"testing" "testing"
"time" "time"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
type Animal struct { type Animal struct {

View File

@ -6,8 +6,8 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/jinzhu/gorm" "gorm.io/gorm"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func toJSONString(v interface{}) []byte { func toJSONString(v interface{}) []byte {

View File

@ -5,8 +5,8 @@ import (
"strconv" "strconv"
"testing" "testing"
"github.com/jinzhu/gorm/clause" "gorm.io/gorm/clause"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestNestedPreload(t *testing.T) { func TestNestedPreload(t *testing.T) {

View File

@ -8,8 +8,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/jinzhu/gorm" "gorm.io/gorm"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestFind(t *testing.T) { func TestFind(t *testing.T) {

View File

@ -6,7 +6,7 @@ import (
"strings" "strings"
"testing" "testing"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestScan(t *testing.T) { func TestScan(t *testing.T) {

View File

@ -10,8 +10,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/jinzhu/gorm" "gorm.io/gorm"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestScannerValuer(t *testing.T) { func TestScannerValuer(t *testing.T) {

View File

@ -3,8 +3,8 @@ package tests_test
import ( import (
"testing" "testing"
"github.com/jinzhu/gorm" "gorm.io/gorm"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func NameIn1And2(d *gorm.DB) *gorm.DB { func NameIn1And2(d *gorm.DB) *gorm.DB {

View File

@ -3,7 +3,7 @@ package tests_test
import ( import (
"testing" "testing"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestSoftDelete(t *testing.T) { func TestSoftDelete(t *testing.T) {

View File

@ -3,8 +3,8 @@ package tests_test
import ( import (
"testing" "testing"
"github.com/jinzhu/gorm" "gorm.io/gorm"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestRow(t *testing.T) { func TestRow(t *testing.T) {

View File

@ -7,12 +7,12 @@ import (
"path/filepath" "path/filepath"
"time" "time"
"github.com/jinzhu/gorm" "gorm.io/gorm"
"github.com/jinzhu/gorm/dialects/mssql" "gorm.io/gorm/dialects/mssql"
"github.com/jinzhu/gorm/dialects/mysql" "gorm.io/gorm/dialects/mysql"
"github.com/jinzhu/gorm/dialects/postgres" "gorm.io/gorm/dialects/postgres"
"github.com/jinzhu/gorm/dialects/sqlite" "gorm.io/gorm/dialects/sqlite"
"github.com/jinzhu/gorm/logger" "gorm.io/gorm/logger"
) )
var DB *gorm.DB var DB *gorm.DB

View File

@ -5,8 +5,8 @@ import (
"errors" "errors"
"testing" "testing"
"github.com/jinzhu/gorm" "gorm.io/gorm"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestTransaction(t *testing.T) { func TestTransaction(t *testing.T) {

View File

@ -3,7 +3,7 @@ package tests_test
import ( import (
"testing" "testing"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestUpdateBelongsTo(t *testing.T) { func TestUpdateBelongsTo(t *testing.T) {

View File

@ -3,7 +3,7 @@ package tests_test
import ( import (
"testing" "testing"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestUpdateHasManyAssociations(t *testing.T) { func TestUpdateHasManyAssociations(t *testing.T) {

View File

@ -3,7 +3,7 @@ package tests_test
import ( import (
"testing" "testing"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestUpdateHasOne(t *testing.T) { func TestUpdateHasOne(t *testing.T) {

View File

@ -3,7 +3,7 @@ package tests_test
import ( import (
"testing" "testing"
. "github.com/jinzhu/gorm/tests" . "gorm.io/gorm/tests"
) )
func TestUpdateMany2ManyAssociations(t *testing.T) { func TestUpdateMany2ManyAssociations(t *testing.T) {

Some files were not shown because too many files have changed in this diff Show More