File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,8 @@ func (m Migrator) CreateIndex(value interface{}, name string) error {
130130 }
131131 createIndexSQL += "INDEX "
132132
133- if strings .TrimSpace (strings .ToUpper (idx .Option )) == "CONCURRENTLY" {
133+ hasConcurrentOption := strings .TrimSpace (strings .ToUpper (idx .Option )) == "CONCURRENTLY"
134+ if hasConcurrentOption {
134135 createIndexSQL += "CONCURRENTLY "
135136 }
136137
@@ -142,7 +143,7 @@ func (m Migrator) CreateIndex(value interface{}, name string) error {
142143 createIndexSQL += " ?"
143144 }
144145
145- if idx .Option != "" && strings . TrimSpace ( strings . ToUpper ( idx . Option )) != "CONCURRENTLY" {
146+ if idx .Option != "" && ! hasConcurrentOption {
146147 createIndexSQL += " " + idx .Option
147148 }
148149
You can’t perform that action at this time.
0 commit comments