title: Gin or Gorm complain about a unique column index being a syntax error, somewhat inconsistently
body: <p>I took the example from <a href="https://gorm.io/docs/migration.html#Indexes" rel="nofollow noreferrer">Gorm's docs</a> of how to create a unique index, which seems to be be simply adding a <code>,unique</code> to the column tag when declaring a model. But when I tried to run it, it would always output the following message in the console:</p>
  <pre class="lang-sh prettyprint-override"><code>(/Users/[...]/main.go:16) 
  [2021-06-26 13:59:20]  near &quot;unique&quot;: syntax error 
  </code></pre>
  <p>While it seemed bizarre that an example directly from their docs would fail, I tried running that code in isolation, and it indeed worked fine on its own. Then, adding on more and more code from my app, it seemed to start outputting that message once Gin-Gonic was introduced and <code>gin.Default()</code> was called. I don't know if this is only because Go won't output the error by default, or there is some sort of a clash going on. But either way, I have also never had Gorm actually create the unique index; syntax error or not.</p>
  <p>The minimum reproducible code is as follows, though it behaves rather inconsistently, running without any error about 1 out of 5 times:</p>
  <pre class="lang-golang prettyprint-override"><code>package main
  
  import (
      &quot;github.com/jinzhu/gorm&quot;
      _ &quot;github.com/jinzhu/gorm/dialects/sqlite&quot;
      &quot;github.com/gin-gonic/gin&quot;
  )
  
  type User struct {
    gorm.Model
    Name string `gorm:&quot;size:40;index:idx_name,unique&quot;`
  }
  
  func main() {
      db, _ := gorm.Open(&quot;sqlite3&quot;, &quot;test.db&quot;)
      db.AutoMigrate(&amp;User{})
  
      r := gin.Default()
      r.Run(&quot;:8082&quot;)
  }
  </code></pre>
  <p>How would I go about fixing this; Both getting rid of the inconsistent error, and having the unique index actually being created?</p>
  <p>If relevant, I'm running this on a Mac.</p>