Fix TestPostgresReturningMultipleColumns error
This commit is contained in:
parent
656b6e22e4
commit
48c265249c
@ -1,12 +1,11 @@
|
|||||||
package gorm_test
|
package gorm_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/jinzhu/now"
|
||||||
"os"
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/jinzhu/now"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCreate(t *testing.T) {
|
func TestCreate(t *testing.T) {
|
||||||
@ -288,6 +287,7 @@ func TestCreateIgnore(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPostgresReturningMultipleColumns(t *testing.T) {
|
func TestPostgresReturningMultipleColumns(t *testing.T) {
|
||||||
|
if DB.Dialect().GetName() == "postgres" {
|
||||||
type ReturningMultipleColumns struct {
|
type ReturningMultipleColumns struct {
|
||||||
ID uint `gorm:"primary_key"`
|
ID uint `gorm:"primary_key"`
|
||||||
SerialA int `gorm:"type:serial;not null"`
|
SerialA int `gorm:"type:serial;not null"`
|
||||||
@ -295,8 +295,6 @@ func TestPostgresReturningMultipleColumns(t *testing.T) {
|
|||||||
SerialC int `gorm:"type:serial;not null"`
|
SerialC int `gorm:"type:serial;not null"`
|
||||||
}
|
}
|
||||||
|
|
||||||
DB.LogMode(true)
|
|
||||||
|
|
||||||
err := DB.AutoMigrate(&ReturningMultipleColumns{}).Error
|
err := DB.AutoMigrate(&ReturningMultipleColumns{}).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@ -319,4 +317,5 @@ func TestPostgresReturningMultipleColumns(t *testing.T) {
|
|||||||
if record.SerialC == 0 {
|
if record.SerialC == 0 {
|
||||||
t.Error("SerialC should not be 0")
|
t.Error("SerialC should not be 0")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user