Skip to content

Commit

Permalink
fix concurrent issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dashrews78 committed Dec 20, 2024
1 parent 54c71e3 commit 7adeb84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package postgres
import (
"database/sql"
"fmt"
"github.com/jackc/pgx/v5"
"regexp"
"strings"

"github.com/jackc/pgx/v5"
"gorm.io/gorm"
"gorm.io/gorm/clause"
"gorm.io/gorm/migrator"
Expand Down Expand Up @@ -142,7 +142,7 @@ func (m Migrator) CreateIndex(value interface{}, name string) error {
createIndexSQL += " ?"
}

if idx.Option != "" {
if idx.Option != "" && strings.TrimSpace(strings.ToUpper(idx.Option)) != "CONCURRENTLY" {
createIndexSQL += " " + idx.Option
}

Expand Down

0 comments on commit 7adeb84

Please sign in to comment.