# Newbie: How can I specify the schema in the schema.yml file

**URL:** https://discourse.getdbt.com/t/newbie-how-can-i-specify-the-schema-in-the-schema-yml-file/14526
**Category:** Help
**Created:** [July 25, 2024, 8:15pm UTC](https://discourse.getdbt.com/t/newbie-how-can-i-specify-the-schema-in-the-schema-yml-file/14526 "2024-07-25T20:15:46Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Pierre](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@Pierre](https://discourse.getdbt.com/u/Pierre)
#### Post date: [July 25, 2024, 8:15pm UTC](https://discourse.getdbt.com/t/newbie-how-can-i-specify-the-schema-in-the-schema-yml-file/14526/1 "2024-07-25T20:15:46Z")

</div>

Hi,  
I’m new to dbt, I’m using the jaffle\_shop demo.  
I ran it fine, now I want to specify the schema now for each model.  
My schema.yml file looks like this:  
How do I set the schema ?  
Thanks Pierre !  
version: 2

models:

- name: stg\_customers  
columns:

- name: stg\_orders  
columns:

- name: stg\_payments  
columns:

---

<div class="post-metadata">

### Author: ![brunoszdl](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/brunoszdl/32/4113_2.png) [@brunoszdl](https://discourse.getdbt.com/u/brunoszdl)
#### Post date: [July 25, 2024, 9:01pm UTC](https://discourse.getdbt.com/t/newbie-how-can-i-specify-the-schema-in-the-schema-yml-file/14526/2 "2024-07-25T21:01:43Z")

</div>

Have a read at this section

> **[Model configurations | dbt Developer Hub](https://docs.getdbt.com/reference/model-configs#general-configurations)**
>
> Read this guide to understand model configurations in dbt.

You can configure the schema, and other properties in three ways  
project file  
property file  
config block

The case you are asking is the property file, which is like

version: 2

```auto
models:
  - name: [<model-name>]
    config:
      schema: <string>

```

---

<div class="post-metadata">

### Author: ![Pierre](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@Pierre](https://discourse.getdbt.com/u/Pierre)
#### Post date: [July 26, 2024, 1:16pm UTC](https://discourse.getdbt.com/t/newbie-how-can-i-specify-the-schema-in-the-schema-yml-file/14526/3 "2024-07-26T13:16:32Z")

</div>

Thanks a lot Bruno.  
Pierre

---

<div class="post-metadata">

### Author: ![Pierre](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@Pierre](https://discourse.getdbt.com/u/Pierre)
#### Post date: [July 26, 2024, 1:22pm UTC](https://discourse.getdbt.com/t/newbie-how-can-i-specify-the-schema-in-the-schema-yml-file/14526/4 "2024-07-26T13:22:44Z")

</div>

Hi again,  
So it would look like this or do I need to move right what comes below (starting at columns) ?

```auto
- name: stg_orders
    config:
      schema: dbt-silver
    columns:
      - name: order_id
        tests:
          - unique
          - not_null
      - name: status
        tests:
          - accepted_values:
              values: ['placed', 'shipped', 'completed', 'return_pending', 'returned']

```

Thanks Pierre

---

<div class="post-metadata">

### Author: ![brunoszdl](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/brunoszdl/32/4113_2.png) [@brunoszdl](https://discourse.getdbt.com/u/brunoszdl)
#### Post date: [July 26, 2024, 1:32pm UTC](https://discourse.getdbt.com/t/newbie-how-can-i-specify-the-schema-in-the-schema-yml-file/14526/5 "2024-07-26T13:32:30Z")

</div>

This should work, yml is tricky sometimes

You can always check the snippet here at the top of the page to see the right identention

> **[Model properties | dbt Developer Hub](https://docs.getdbt.com/reference/model-properties)**
>
> Models properties can be declared in .yml files in your models/ directory (as defined by the model-paths config).

---

<div class="post-metadata">

### Author: ![Pierre](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@Pierre](https://discourse.getdbt.com/u/Pierre)
#### Post date: [July 26, 2024, 8:06pm UTC](https://discourse.getdbt.com/t/newbie-how-can-i-specify-the-schema-in-the-schema-yml-file/14526/6 "2024-07-26T20:06:34Z")

</div>

Thanks again ! Pierre
