title: Golang - GORM how to create a model for an existing table?
body: <p>According to the source from this link : <a href="https://gorm.io/docs/index.html" rel="nofollow noreferrer">https://gorm.io/docs/index.html</a></p>
  <p>To declaring a model, we do this:</p>
  <pre><code>type User struct {
    ID           uint
    Name         string
    Email        *string
    Age          uint8
    Birthday     *time.Time
    MemberNumber sql.NullString
    ActivatedAt  sql.NullTime
    CreatedAt    time.Time
    UpdatedAt    time.Time
  }
  </code></pre>
  <p>Then run <code>migration</code> to create it on the database.</p>
  <p>However, I could not find any document mentioning about declaring a model that already exist in database. I suppose there is something like this:</p>
  <pre><code>type User struct {
    ID           uint
    Name         string
  
  
  This_struct(User).belongs_to_an_existing_table_named(&quot;a_table_name&quot;)  -- this is an example to explaning what I mean
  </code></pre>
  <p>If and only if we do it by declaring a <code>struct</code> with the same name with an existing table. Can I change the name for simplicity in my code ?</p>