mirror of https://github.com/vapor/docs.git
Updated field constraint example (#515)
The .unique is not a valid field constraint. I've updated the docs to correct this minor mistake.
This commit is contained in:
parent
ae6710c7cf
commit
7e760a4aa3
|
|
@ -58,7 +58,7 @@ Fields can be added when creating or updating a schema.
|
|||
|
||||
```swift
|
||||
// Adds a new field
|
||||
.field("name", .string, .unique)
|
||||
.field("name", .string, .required)
|
||||
```
|
||||
|
||||
The first parameter is the name of the field. This should match the key used on the associated model property. The second parameter is the field's [data type](#data-type). Finally, zero or more [constraints](#field-constraint) can be added.
|
||||
|
|
|
|||
Loading…
Reference in New Issue