mirror of https://github.com/go-gorm/gorm.git
don't test AddForeignKey on sqlite
This commit is contained in:
parent
ed9cfac496
commit
58ce6153e2
|
@ -2,6 +2,7 @@ package gorm_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -842,6 +843,10 @@ func TestForeignKey(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLongForeignKey(t *testing.T) {
|
func TestLongForeignKey(t *testing.T) {
|
||||||
|
if dialect := os.Getenv("GORM_DIALECT"); dialect == "" || dialect == "sqlite" {
|
||||||
|
// sqlite does not support ADD CONSTRAINT in ALTER TABLE
|
||||||
|
return
|
||||||
|
}
|
||||||
targetScope := DB.NewScope(&ReallyLongTableNameToTestMySQLNameLengthLimit{})
|
targetScope := DB.NewScope(&ReallyLongTableNameToTestMySQLNameLengthLimit{})
|
||||||
targetTableName := targetScope.TableName()
|
targetTableName := targetScope.TableName()
|
||||||
modelScope := DB.NewScope(&User{})
|
modelScope := DB.NewScope(&User{})
|
||||||
|
|
Loading…
Reference in New Issue