Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
t-tiger committed Nov 24, 2019
1 parent 5b3fe5f commit 4d86045
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ In the above pattern `Name` and `Email` fields are excluded.

### AUTO INCREMENT

If auto_increment attribute is assigned to the primary key etc, make sure to set `AUTO_INCREMENT` in model struct.
If auto_increment attribute is assigned to the primary key, make sure to set `gorm:"AUTO_INCREMENT"` tag in model struct.

```go
type fakeTable struct {
Expand All @@ -47,7 +47,7 @@ type fakeTable struct {
}
```

This is necessary to exclude the auto_increment column from insertion and be numbered by database system. The reason for this requirement is that if all primary keys are excluded, only the surrogate key like auto_increment can be inserted and natural key cannot at all.
This is necessary to exclude the auto_increment column from insertion and be numbered by database. The reason for this requirement is that if all primary keys are excluded, only surrogate key like auto_increment can be inserted and natural key cannot at all.

### Feature

Expand Down

0 comments on commit 4d86045

Please sign in to comment.