For the examples below with DataStore, let's add a new model to the `schema.graphql` file located by default at `amplify/backend/{api_name}/`:

```graphql
enum PostStatus {
  ACTIVE
  INACTIVE
}

type Post @model {
  id: ID!
  title: String!
  rating: Int!
  status: PostStatus!
  # New field with @hasMany
  comments: [Comment] @hasMany(indexName: "byPost", fields: ["id"])
}

# New model
type Comment @model {
  id: ID!
  postID: ID! @index(name: "byPost")
  post: Post! @belongsTo(fields: ["postID"])
  content: String!
}
```

After that, regenerate the models with the following console command:

```console
amplify codegen models
```
