Skip to content

Commit

Permalink
remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
googollee committed Sep 15, 2022
1 parent 916f57e commit 81dbdf0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/migrate_test.go
Expand Up @@ -963,7 +963,7 @@ func TestMigrateArrayTypeModel(t *testing.T) {

type Origin struct {
ID int64 `gorm:"primaryKey"`
Data string `gorm:"null"`
Data string `gorm:"size:64;notnull;default:''"`
}

func (Origin) TableName() string {
Expand All @@ -973,20 +973,20 @@ func (Origin) TableName() string {
func TestDryRunAutoMigrate(t *testing.T) {
type ChangeColumn struct {
Origin `gorm:"-"`
ID int64 `gorm:"primaryKey"`
Data int64 `gorm:""`
ID int64 `gorm:"primaryKey"`
Data string `gorm:"size:64;null;default:null"`
}

type AddIndex struct {
Origin `gorm:"-"`
ID int64 `gorm:"primaryKey"`
Data string `gorm:"null;index"`
Data string `gorm:"size:64;notnull;default:'';index"`
}

type AddConstraint struct {
Origin `gorm:"-"`
ID int64 `gorm:"primaryKey"`
Data string `gorm:"null;check:,data <> 'migrate'"`
Data string `gorm:"size:64;notnull;default:'';check:,data<>'migrate'"`
}

var tests = []struct {
Expand All @@ -1000,7 +1000,7 @@ func TestDryRunAutoMigrate(t *testing.T) {
}

for _, test := range tests {
name := strings.ReplaceAll(fmt.Sprintf("%T", test.to), "*", "")
name := strings.ReplaceAll(fmt.Sprintf("%T", test.to), "*tests_test.", "")
t.Run(name, func(t *testing.T) {
DB.Migrator().DropTable(test.from, test.to)
t.Cleanup(func() {
Expand Down

0 comments on commit 81dbdf0

Please sign in to comment.