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:
Craz1k0ek 2020-06-25 14:59:42 +02:00 committed by GitHub
parent ae6710c7cf
commit 7e760a4aa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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.