diff --git a/pages/ar_SA/docs/create.md b/pages/ar_SA/docs/create.md index 15f09941893..7caca6cdf8d 100644 --- a/pages/ar_SA/docs/create.md +++ b/pages/ar_SA/docs/create.md @@ -252,6 +252,31 @@ type User struct { } ``` +{% note warn %} +**NOTE** **SQLite** doesn't support some records are default values when batch insert. See [SQLite Insert stmt](https://www.sqlite.org/lang_insert.html). For example: + +```go +type Pet struct { + Name string `gorm:"default:cat"` +} + +// In SQLite, this is not supported, so GORM will build a wrong SQL to raise error: +// INSERT INTO `pets` (`name`) VALUES ("dog"),(DEFAULT) RETURNING `name` +db.Create(&[]Pet{{Name: "dog"}, {}}) +``` +A viable alternative is to assign default value to fields in the hook, e.g. + +```go +func (p *Pet) BeforeCreate(tx *gorm.DB) (err error) { + if p.Name == "" { + p.Name = "cat" + } +} +``` + +You can see more info in [issues#6335](https://github.com/go-gorm/gorm/issues/6335) +{% endnote %} + When using virtual/generated value, you might need to disable its creating/updating permission, check out [Field-Level Permission](models.html#field_permission) ### Upsert / On Conflict diff --git a/pages/az_AZ/docs/create.md b/pages/az_AZ/docs/create.md index ae06885fad6..7dc71376762 100644 --- a/pages/az_AZ/docs/create.md +++ b/pages/az_AZ/docs/create.md @@ -257,6 +257,31 @@ type User struct { } ``` +{% note warn %} +**NOTE** **SQLite** doesn't support some records are default values when batch insert. See [SQLite Insert stmt](https://www.sqlite.org/lang_insert.html). For example: + +```go +type Pet struct { + Name string `gorm:"default:cat"` +} + +// In SQLite, this is not supported, so GORM will build a wrong SQL to raise error: +// INSERT INTO `pets` (`name`) VALUES ("dog"),(DEFAULT) RETURNING `name` +db.Create(&[]Pet{{Name: "dog"}, {}}) +``` +A viable alternative is to assign default value to fields in the hook, e.g. + +```go +func (p *Pet) BeforeCreate(tx *gorm.DB) (err error) { + if p.Name == "" { + p.Name = "cat" + } +} +``` + +You can see more info in [issues#6335](https://github.com/go-gorm/gorm/issues/6335) +{% endnote %} + When using virtual/generated value, you might need to disable its creating/updating permission, check out [Field-Level Permission](models.html#field_permission) ### Upsert / On Conflict diff --git a/pages/de_DE/docs/create.md b/pages/de_DE/docs/create.md index 146f61489d3..456a47b4477 100644 --- a/pages/de_DE/docs/create.md +++ b/pages/de_DE/docs/create.md @@ -257,6 +257,31 @@ type User struct { } ``` +{% note warn %} +**NOTE** **SQLite** doesn't support some records are default values when batch insert. See [SQLite Insert stmt](https://www.sqlite.org/lang_insert.html). For example: + +```go +type Pet struct { + Name string `gorm:"default:cat"` +} + +// In SQLite, this is not supported, so GORM will build a wrong SQL to raise error: +// INSERT INTO `pets` (`name`) VALUES ("dog"),(DEFAULT) RETURNING `name` +db.Create(&[]Pet{{Name: "dog"}, {}}) +``` +A viable alternative is to assign default value to fields in the hook, e.g. + +```go +func (p *Pet) BeforeCreate(tx *gorm.DB) (err error) { + if p.Name == "" { + p.Name = "cat" + } +} +``` + +You can see more info in [issues#6335](https://github.com/go-gorm/gorm/issues/6335) +{% endnote %} + When using virtual/generated value, you might need to disable its creating/updating permission, check out [Field-Level Permission](models.html#field_permission) ### Upsert / On Conflict diff --git a/pages/es_ES/docs/create.md b/pages/es_ES/docs/create.md index 152c9e7ff8d..dd42e04fd97 100644 --- a/pages/es_ES/docs/create.md +++ b/pages/es_ES/docs/create.md @@ -257,6 +257,31 @@ type User struct { } ``` +{% note warn %} +**NOTE** **SQLite** doesn't support some records are default values when batch insert. See [SQLite Insert stmt](https://www.sqlite.org/lang_insert.html). For example: + +```go +type Pet struct { + Name string `gorm:"default:cat"` +} + +// In SQLite, this is not supported, so GORM will build a wrong SQL to raise error: +// INSERT INTO `pets` (`name`) VALUES ("dog"),(DEFAULT) RETURNING `name` +db.Create(&[]Pet{{Name: "dog"}, {}}) +``` +A viable alternative is to assign default value to fields in the hook, e.g. + +```go +func (p *Pet) BeforeCreate(tx *gorm.DB) (err error) { + if p.Name == "" { + p.Name = "cat" + } +} +``` + +You can see more info in [issues#6335](https://github.com/go-gorm/gorm/issues/6335) +{% endnote %} + When using virtual/generated value, you might need to disable its creating/updating permission, check out [Field-Level Permission](models.html#field_permission) ### Upsert / On Conflict diff --git a/pages/fa_IR/docs/create.md b/pages/fa_IR/docs/create.md index ae06885fad6..7dc71376762 100644 --- a/pages/fa_IR/docs/create.md +++ b/pages/fa_IR/docs/create.md @@ -257,6 +257,31 @@ type User struct { } ``` +{% note warn %} +**NOTE** **SQLite** doesn't support some records are default values when batch insert. See [SQLite Insert stmt](https://www.sqlite.org/lang_insert.html). For example: + +```go +type Pet struct { + Name string `gorm:"default:cat"` +} + +// In SQLite, this is not supported, so GORM will build a wrong SQL to raise error: +// INSERT INTO `pets` (`name`) VALUES ("dog"),(DEFAULT) RETURNING `name` +db.Create(&[]Pet{{Name: "dog"}, {}}) +``` +A viable alternative is to assign default value to fields in the hook, e.g. + +```go +func (p *Pet) BeforeCreate(tx *gorm.DB) (err error) { + if p.Name == "" { + p.Name = "cat" + } +} +``` + +You can see more info in [issues#6335](https://github.com/go-gorm/gorm/issues/6335) +{% endnote %} + When using virtual/generated value, you might need to disable its creating/updating permission, check out [Field-Level Permission](models.html#field_permission) ### Upsert / On Conflict diff --git a/pages/fr_FR/docs/create.md b/pages/fr_FR/docs/create.md index 82eb8d27fa4..6baf7c81ba9 100644 --- a/pages/fr_FR/docs/create.md +++ b/pages/fr_FR/docs/create.md @@ -257,6 +257,31 @@ type User struct { } ``` +{% note warn %} +**NOTE** **SQLite** doesn't support some records are default values when batch insert. See [SQLite Insert stmt](https://www.sqlite.org/lang_insert.html). For example: + +```go +type Pet struct { + Name string `gorm:"default:cat"` +} + +// In SQLite, this is not supported, so GORM will build a wrong SQL to raise error: +// INSERT INTO `pets` (`name`) VALUES ("dog"),(DEFAULT) RETURNING `name` +db.Create(&[]Pet{{Name: "dog"}, {}}) +``` +A viable alternative is to assign default value to fields in the hook, e.g. + +```go +func (p *Pet) BeforeCreate(tx *gorm.DB) (err error) { + if p.Name == "" { + p.Name = "cat" + } +} +``` + +You can see more info in [issues#6335](https://github.com/go-gorm/gorm/issues/6335) +{% endnote %} + When using virtual/generated value, you might need to disable its creating/updating permission, check out [Field-Level Permission](models.html#field_permission) ### Upsert / On Conflict diff --git a/pages/hi_IN/docs/create.md b/pages/hi_IN/docs/create.md index feb7d70a622..34ae7f01c74 100644 --- a/pages/hi_IN/docs/create.md +++ b/pages/hi_IN/docs/create.md @@ -257,6 +257,31 @@ type User struct { } ``` +{% note warn %} +**NOTE** **SQLite** doesn't support some records are default values when batch insert. See [SQLite Insert stmt](https://www.sqlite.org/lang_insert.html). For example: + +```go +type Pet struct { + Name string `gorm:"default:cat"` +} + +// In SQLite, this is not supported, so GORM will build a wrong SQL to raise error: +// INSERT INTO `pets` (`name`) VALUES ("dog"),(DEFAULT) RETURNING `name` +db.Create(&[]Pet{{Name: "dog"}, {}}) +``` +A viable alternative is to assign default value to fields in the hook, e.g. + +```go +func (p *Pet) BeforeCreate(tx *gorm.DB) (err error) { + if p.Name == "" { + p.Name = "cat" + } +} +``` + +You can see more info in [issues#6335](https://github.com/go-gorm/gorm/issues/6335) +{% endnote %} + When using virtual/generated value, you might need to disable its creating/updating permission, check out [Field-Level Permission](models.html#field_permission) ### Upsert / On Conflict diff --git a/pages/id_ID/docs/create.md b/pages/id_ID/docs/create.md index ae06885fad6..7dc71376762 100644 --- a/pages/id_ID/docs/create.md +++ b/pages/id_ID/docs/create.md @@ -257,6 +257,31 @@ type User struct { } ``` +{% note warn %} +**NOTE** **SQLite** doesn't support some records are default values when batch insert. See [SQLite Insert stmt](https://www.sqlite.org/lang_insert.html). For example: + +```go +type Pet struct { + Name string `gorm:"default:cat"` +} + +// In SQLite, this is not supported, so GORM will build a wrong SQL to raise error: +// INSERT INTO `pets` (`name`) VALUES ("dog"),(DEFAULT) RETURNING `name` +db.Create(&[]Pet{{Name: "dog"}, {}}) +``` +A viable alternative is to assign default value to fields in the hook, e.g. + +```go +func (p *Pet) BeforeCreate(tx *gorm.DB) (err error) { + if p.Name == "" { + p.Name = "cat" + } +} +``` + +You can see more info in [issues#6335](https://github.com/go-gorm/gorm/issues/6335) +{% endnote %} + When using virtual/generated value, you might need to disable its creating/updating permission, check out [Field-Level Permission](models.html#field_permission) ### Upsert / On Conflict diff --git a/pages/it_IT/docs/create.md b/pages/it_IT/docs/create.md index ae06885fad6..7dc71376762 100644 --- a/pages/it_IT/docs/create.md +++ b/pages/it_IT/docs/create.md @@ -257,6 +257,31 @@ type User struct { } ``` +{% note warn %} +**NOTE** **SQLite** doesn't support some records are default values when batch insert. See [SQLite Insert stmt](https://www.sqlite.org/lang_insert.html). For example: + +```go +type Pet struct { + Name string `gorm:"default:cat"` +} + +// In SQLite, this is not supported, so GORM will build a wrong SQL to raise error: +// INSERT INTO `pets` (`name`) VALUES ("dog"),(DEFAULT) RETURNING `name` +db.Create(&[]Pet{{Name: "dog"}, {}}) +``` +A viable alternative is to assign default value to fields in the hook, e.g. + +```go +func (p *Pet) BeforeCreate(tx *gorm.DB) (err error) { + if p.Name == "" { + p.Name = "cat" + } +} +``` + +You can see more info in [issues#6335](https://github.com/go-gorm/gorm/issues/6335) +{% endnote %} + When using virtual/generated value, you might need to disable its creating/updating permission, check out [Field-Level Permission](models.html#field_permission) ### Upsert / On Conflict diff --git a/pages/ja_JP/docs/create.md b/pages/ja_JP/docs/create.md index 06cc477ec0a..11b0a16558f 100644 --- a/pages/ja_JP/docs/create.md +++ b/pages/ja_JP/docs/create.md @@ -29,19 +29,19 @@ result.RowsAffected // returns inserted records count ``` {% note warn %} -**NOTE** You cannot pass a struct to 'create', so you should pass a pointer to the data. +**注意** **Create()**の引数として構造体を渡すことはできません。代わりにポインタを渡すようにしてください。 {% endnote %} ## フィールドを選択してレコードを作成する -Create a record and assign a value to the fields specified. +レコード作成時に、Selectで指定されたフィールドのみに対して値をアサインできます。 ```go db.Select("Name", "Age", "CreatedAt").Create(&user) // INSERT INTO `users` (`name`,`age`,`created_at`) VALUES ("jinzhu", 18, "2020-07-04 11:05:21.775") ``` -Create a record and ignore the values for fields passed to omit. +省略する項目を指定し、レコードを作成します。 ```go db.Omit("Name", "Age", "CreatedAt").Create(&user) @@ -50,7 +50,7 @@ db.Omit("Name", "Age", "CreatedAt").Create(&user) ## 一括作成 -To efficiently insert large number of records, pass a slice to the `Create` method. GORM will generate a single SQL statement to insert all the data and backfill primary key values, hook methods will be invoked too. It will begin a **transaction** when records can be split into multiple batches. +大量のレコードを効率的に挿入するには、スライスを `Create` メソッドに渡します。 GORMはすべてのデータを挿入する1つのSQL文を生成します。SQLが実行されると登録された主キーの値がモデルに代入され、フックメソッドも呼び出されます。 レコードを複数のバッチに分割することが可能な場合には、 **トランザクション** が開始されます。 ```go var users = []User{{Name: "jinzhu1"}, {Name: "jinzhu2"}, {Name: "jinzhu3"}} @@ -61,7 +61,7 @@ for _, user := range users { } ``` -You can specify batch size when creating with `CreateInBatches`, e.g: +`CreateInBatches` を利用することで、バッチサイズを指定してレコードを作成することができます。 ```go var users = []User{{Name: "jinzhu_1"}, ...., {Name: "jinzhu_10000"}} @@ -70,10 +70,10 @@ var users = []User{{Name: "jinzhu_1"}, ...., {Name: "jinzhu_10000"}} db.CreateInBatches(users, 100) ``` -Batch Insert is also supported when using [Upsert](#upsert) and [Create With Associations](#create_with_associations) +[Upsert](#upsert) や [Create With Associations](#create_with_associations) を使用する場合もバッチインサートはサポートされています。 {% note warn %} -**NOTE** initialize GORM with `CreateBatchSize` option, all `INSERT` will respect this option when creating record & associations +**注記** `CreateBatchSize` オプションを使ってGORMを初期化した場合、すべての `INSERT` は、その設定を参照してレコードやアソシエーションを作成します。 {% endnote %} ```go @@ -257,6 +257,31 @@ type User struct { } ``` +{% note warn %} +**NOTE** **SQLite** doesn't support some records are default values when batch insert. See [SQLite Insert stmt](https://www.sqlite.org/lang_insert.html). For example: + +```go +type Pet struct { + Name string `gorm:"default:cat"` +} + +// In SQLite, this is not supported, so GORM will build a wrong SQL to raise error: +// INSERT INTO `pets` (`name`) VALUES ("dog"),(DEFAULT) RETURNING `name` +db.Create(&[]Pet{{Name: "dog"}, {}}) +``` +A viable alternative is to assign default value to fields in the hook, e.g. + +```go +func (p *Pet) BeforeCreate(tx *gorm.DB) (err error) { + if p.Name == "" { + p.Name = "cat" + } +} +``` + +You can see more info in [issues#6335](https://github.com/go-gorm/gorm/issues/6335) +{% endnote %} + When using virtual/generated value, you might need to disable its creating/updating permission, check out [Field-Level Permission](models.html#field_permission) ### コンフリクト発生時のUpsert diff --git a/pages/ko_KR/docs/create.md b/pages/ko_KR/docs/create.md index 45cd2affcbe..920bd5c5409 100644 --- a/pages/ko_KR/docs/create.md +++ b/pages/ko_KR/docs/create.md @@ -257,6 +257,31 @@ type User struct { } ``` +{% note warn %} +**NOTE** **SQLite** doesn't support some records are default values when batch insert. See [SQLite Insert stmt](https://www.sqlite.org/lang_insert.html). For example: + +```go +type Pet struct { + Name string `gorm:"default:cat"` +} + +// In SQLite, this is not supported, so GORM will build a wrong SQL to raise error: +// INSERT INTO `pets` (`name`) VALUES ("dog"),(DEFAULT) RETURNING `name` +db.Create(&[]Pet{{Name: "dog"}, {}}) +``` +A viable alternative is to assign default value to fields in the hook, e.g. + +```go +func (p *Pet) BeforeCreate(tx *gorm.DB) (err error) { + if p.Name == "" { + p.Name = "cat" + } +} +``` + +You can see more info in [issues#6335](https://github.com/go-gorm/gorm/issues/6335) +{% endnote %} + When using virtual/generated value, you might need to disable its creating/updating permission, check out [Field-Level Permission](models.html#field_permission) ### Upsert / On Conflict diff --git a/pages/pl_PL/docs/create.md b/pages/pl_PL/docs/create.md index ae06885fad6..7dc71376762 100644 --- a/pages/pl_PL/docs/create.md +++ b/pages/pl_PL/docs/create.md @@ -257,6 +257,31 @@ type User struct { } ``` +{% note warn %} +**NOTE** **SQLite** doesn't support some records are default values when batch insert. See [SQLite Insert stmt](https://www.sqlite.org/lang_insert.html). For example: + +```go +type Pet struct { + Name string `gorm:"default:cat"` +} + +// In SQLite, this is not supported, so GORM will build a wrong SQL to raise error: +// INSERT INTO `pets` (`name`) VALUES ("dog"),(DEFAULT) RETURNING `name` +db.Create(&[]Pet{{Name: "dog"}, {}}) +``` +A viable alternative is to assign default value to fields in the hook, e.g. + +```go +func (p *Pet) BeforeCreate(tx *gorm.DB) (err error) { + if p.Name == "" { + p.Name = "cat" + } +} +``` + +You can see more info in [issues#6335](https://github.com/go-gorm/gorm/issues/6335) +{% endnote %} + When using virtual/generated value, you might need to disable its creating/updating permission, check out [Field-Level Permission](models.html#field_permission) ### Upsert / On Conflict diff --git a/pages/pt_BR/docs/associations.md b/pages/pt_BR/docs/associations.md index 5f7033c3d5c..60162ded4c1 100644 --- a/pages/pt_BR/docs/associations.md +++ b/pages/pt_BR/docs/associations.md @@ -5,11 +5,11 @@ layout: page ## Criar/Atualizar Automaticamente -GORM automates the saving of associations and their references when creating or updating records, using an upsert technique that primarily updates foreign key references for existing associations. +Ao criar um registro, o GORM salvará automaticamente os dados associados. Isto inclui a inserção de dados em tabelas relacionadas e o gerenciamento de referências de chave estrangeira. -### Auto-Saving Associations on Create +### Associações de salvamento automático ao criar -When you create a new record, GORM will automatically save its associated data. This includes inserting data into related tables and managing foreign key references. +Ao criar um registro, o GORM salvará automaticamente os dados associados. Isto inclui a inserção de dados em tabelas relacionadas e o gerenciamento de referências de chave estrangeira. ```go user := User{ @@ -39,14 +39,14 @@ db.Create(&user) db.Save(&user) ``` -### Updating Associations with `FullSaveAssociations` +### Atualizando associações com `FullSaveAssociations` -For scenarios where a full update of the associated data is required (not just the foreign key references), the `FullSaveAssociations` mode should be used. +Para cenários onde é necessária uma atualização completa dos dados associados (não apenas das referências de chave estrangeira), o modo `FullSaveAssociations` deve ser usado. ```go -// Update a user and fully update all its associations +// Atualizar um usuário e atualizar totalmente todas as suas associações db.Session(&gorm.Session{FullSaveAssociations: true}).Updates(&user) -// SQL: Fully updates addresses, users, emails tables, including existing associated records +// SQL: Atualiza totalmente endereços, usuários, tabelas de e-mails, incluindo registros associados existentes ``` Using `FullSaveAssociations` ensures that the entire state of the model, including all its associations, is reflected in the database, maintaining data integrity and consistency throughout the application. diff --git a/pages/pt_BR/docs/create.md b/pages/pt_BR/docs/create.md index e4f07e58b8c..1aed8349be7 100644 --- a/pages/pt_BR/docs/create.md +++ b/pages/pt_BR/docs/create.md @@ -257,6 +257,31 @@ type User struct { } ``` +{% note warn %} +**NOTE** **SQLite** doesn't support some records are default values when batch insert. See [SQLite Insert stmt](https://www.sqlite.org/lang_insert.html). For example: + +```go +type Pet struct { + Name string `gorm:"default:cat"` +} + +// In SQLite, this is not supported, so GORM will build a wrong SQL to raise error: +// INSERT INTO `pets` (`name`) VALUES ("dog"),(DEFAULT) RETURNING `name` +db.Create(&[]Pet{{Name: "dog"}, {}}) +``` +A viable alternative is to assign default value to fields in the hook, e.g. + +```go +func (p *Pet) BeforeCreate(tx *gorm.DB) (err error) { + if p.Name == "" { + p.Name = "cat" + } +} +``` + +You can see more info in [issues#6335](https://github.com/go-gorm/gorm/issues/6335) +{% endnote %} + When using virtual/generated value, you might need to disable its creating/updating permission, check out [Field-Level Permission](models.html#field_permission) ### Upsert / On Conflict diff --git a/pages/ru_RU/docs/create.md b/pages/ru_RU/docs/create.md index a3cfe15bc78..5388197905f 100644 --- a/pages/ru_RU/docs/create.md +++ b/pages/ru_RU/docs/create.md @@ -257,6 +257,31 @@ type User struct { } ``` +{% note warn %} +**NOTE** **SQLite** doesn't support some records are default values when batch insert. See [SQLite Insert stmt](https://www.sqlite.org/lang_insert.html). For example: + +```go +type Pet struct { + Name string `gorm:"default:cat"` +} + +// In SQLite, this is not supported, so GORM will build a wrong SQL to raise error: +// INSERT INTO `pets` (`name`) VALUES ("dog"),(DEFAULT) RETURNING `name` +db.Create(&[]Pet{{Name: "dog"}, {}}) +``` +A viable alternative is to assign default value to fields in the hook, e.g. + +```go +func (p *Pet) BeforeCreate(tx *gorm.DB) (err error) { + if p.Name == "" { + p.Name = "cat" + } +} +``` + +You can see more info in [issues#6335](https://github.com/go-gorm/gorm/issues/6335) +{% endnote %} + When using virtual/generated value, you might need to disable its creating/updating permission, check out [Field-Level Permission](models.html#field_permission) ### Upsert (Создать или обновить) / При конфликте diff --git a/pages/tr_TR/docs/create.md b/pages/tr_TR/docs/create.md index 35518c78e18..7104190672b 100644 --- a/pages/tr_TR/docs/create.md +++ b/pages/tr_TR/docs/create.md @@ -257,6 +257,31 @@ type User struct { } ``` +{% note warn %} +**NOTE** **SQLite** doesn't support some records are default values when batch insert. See [SQLite Insert stmt](https://www.sqlite.org/lang_insert.html). For example: + +```go +type Pet struct { + Name string `gorm:"default:cat"` +} + +// In SQLite, this is not supported, so GORM will build a wrong SQL to raise error: +// INSERT INTO `pets` (`name`) VALUES ("dog"),(DEFAULT) RETURNING `name` +db.Create(&[]Pet{{Name: "dog"}, {}}) +``` +A viable alternative is to assign default value to fields in the hook, e.g. + +```go +func (p *Pet) BeforeCreate(tx *gorm.DB) (err error) { + if p.Name == "" { + p.Name = "cat" + } +} +``` + +You can see more info in [issues#6335](https://github.com/go-gorm/gorm/issues/6335) +{% endnote %} + When using virtual/generated value, you might need to disable its creating/updating permission, check out [Field-Level Permission](models.html#field_permission) ### Upsert / On Conflict diff --git a/pages/zh_CN/docs/create.md b/pages/zh_CN/docs/create.md index 86928fe9286..9eb7ae1e9f5 100644 --- a/pages/zh_CN/docs/create.md +++ b/pages/zh_CN/docs/create.md @@ -257,6 +257,31 @@ type User struct { } ``` +{% note warn %} +**NOTE** **SQLite** doesn't support some records are default values when batch insert. See [SQLite Insert stmt](https://www.sqlite.org/lang_insert.html). For example: + +```go +type Pet struct { + Name string `gorm:"default:cat"` +} + +// In SQLite, this is not supported, so GORM will build a wrong SQL to raise error: +// INSERT INTO `pets` (`name`) VALUES ("dog"),(DEFAULT) RETURNING `name` +db.Create(&[]Pet{{Name: "dog"}, {}}) +``` +A viable alternative is to assign default value to fields in the hook, e.g. + +```go +func (p *Pet) BeforeCreate(tx *gorm.DB) (err error) { + if p.Name == "" { + p.Name = "cat" + } +} +``` + +You can see more info in [issues#6335](https://github.com/go-gorm/gorm/issues/6335) +{% endnote %} + When using virtual/generated value, you might need to disable its creating/updating permission, check out [Field-Level Permission](models.html#field_permission) ### Upsert 及冲突 diff --git a/pages/zh_CN/docs/update.md b/pages/zh_CN/docs/update.md index 0dc0b42c844..ce89342b738 100644 --- a/pages/zh_CN/docs/update.md +++ b/pages/zh_CN/docs/update.md @@ -27,7 +27,7 @@ db.Save(&User{ID: 1, Name: "jinzhu", Age: 100}) ``` {% note warn %} -**NOTE**不要将 `Save` 和 `Model`一同使用, 这是 **为定义的行为**。 +**NOTE**不要将 `Save` 和 `Model`一同使用, 这是 **未定义的行为**。 {% endnote %} ## 更新单个列