From 58ce6153e29ca8eadc9342dcc97af2042fa538b9 Mon Sep 17 00:00:00 2001 From: Nikola Kovacs Date: Sat, 21 May 2016 23:19:41 +0200 Subject: [PATCH] don't test AddForeignKey on sqlite --- association_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/association_test.go b/association_test.go index e4aabb43..1e2e5179 100644 --- a/association_test.go +++ b/association_test.go @@ -2,6 +2,7 @@ package gorm_test import ( "fmt" + "os" "reflect" "sort" "testing" @@ -842,6 +843,10 @@ func TestForeignKey(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{}) targetTableName := targetScope.TableName() modelScope := DB.NewScope(&User{})