# dbt found two schema.yml entries for the same resource

**URL:** https://discourse.getdbt.com/t/dbt-found-two-schema-yml-entries-for-the-same-resource/10868
**Category:** Help
**Tags:** dbt-core
**Created:** [November 20, 2023, 8:56am UTC](https://discourse.getdbt.com/t/dbt-found-two-schema-yml-entries-for-the-same-resource/10868 "2023-11-20T08:56:22Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![guserrl](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/guserrl/32/3243_2.png) [@guserrl](https://discourse.getdbt.com/u/guserrl)
#### Post date: [November 20, 2023, 8:56am UTC](https://discourse.getdbt.com/t/dbt-found-two-schema-yml-entries-for-the-same-resource/10868/1 "2023-11-20T08:56:22Z")

</div>

## The problem I’m having

I have 2 yml, 1 where y have the incremental configuration for my models and other where i want to add the descriptions and docs, but it seems i cant.

## The context of why I’m trying to do this

In my model i have a lot of columns i want to have some sort of description and possible add blocks in the future, and i want to separte that from the incremental configuration im trying, but i allways run in to the same problem:

“dbt found two schema.yml entries for the same resource named s\_customer. Resources and their associated columns may only be described a single time.”

## Some example code

models/conf.yml

```auto
  - name: s_customer
    config:
      materialized: incremental
      unique_key : [h_customer_haskey,load_record]
      incremental_strategy: merge
      merge_exclude_columns: [h_customer_haskey,custkey]
    columns:
      - name: h_customer_haskey
        tests:
          - relationships:
              field: h_customer_haskey
              to: ref('h_customer')

```

models/cutomer/schema.yml

```auto
models:
  - name: s_customer
    description: "description"
    columns:
      - name: h_customer_haskey
        description: "description"
      - name: has_diff
        description: "description"
      - name: load_record
        description: "description"
      - name: is_active
       description: "description"
      - name: last_modified
        description: "description"
      - name: source
        description: "description"
      - name: custkey
        description: "description"
      - name: addres
        description: "description"
      - name: comment
        description: "description"
      - name: mktsegment
        description: ""
      - name: name
        description: "descriptionr"
      - name: phone
        description: "description"
      - name: accbal
        description: ""

```

How could i solve my problem? I would like to avoid having all in the same file, becouse i have more models and they can have a lot of columns and is gona be horrible to look at the yml later on.

Sorry ahead of time, english aint my first lenguage.

---

<div class="post-metadata">

### Author: ![minhajpasha](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/minhajpasha/32/1159_2.png) [@minhajpasha](https://discourse.getdbt.com/u/minhajpasha)
#### Post date: [November 20, 2023, 1:58pm UTC](https://discourse.getdbt.com/t/dbt-found-two-schema-yml-entries-for-the-same-resource/10868/2 "2023-11-20T13:58:56Z")

</div>

Hi create the model’s with two different names and use alias.

in your case

models/s\_customer\_1.sql  
models/conf.yml ( replace s\_customer with s\_customer\_1)  
inside s\_customer\_1.sql use  
{{ config(materialized=‘table’,alias=‘s\_customer’) }}

models/cutomer/s\_customer\_2.sql  
models/cutomer/schema.yml ( replace s\_customer with s\_customer\_1)

inside s\_customer\_2.sql use  
{{ config(materialized=‘table’,alias=‘s\_customer’) }}

Hope it should work for your scenerio

---

<div class="post-metadata">

### Author: ![guserrl](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/guserrl/32/3243_2.png) [@guserrl](https://discourse.getdbt.com/u/guserrl)
#### Post date: [November 21, 2023, 9:18am UTC](https://discourse.getdbt.com/t/dbt-found-two-schema-yml-entries-for-the-same-resource/10868/3 "2023-11-21T09:18:49Z")

</div>

I tried and it works but is not what i was looking for, i dont want to have to create the models 2 times if possible in the project, i already have a lot and is gonna be really complicated to navigate throught the project if i do that even if i separate then in another folder. ¿Is there any other way?

---

<div class="post-metadata">

### Author: ![minhajpasha](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/minhajpasha/32/1159_2.png) [@minhajpasha](https://discourse.getdbt.com/u/minhajpasha)
#### Post date: [November 21, 2023, 9:46am UTC](https://discourse.getdbt.com/t/dbt-found-two-schema-yml-entries-for-the-same-resource/10868/4 "2023-11-21T09:46:54Z")

</div>

Hi, If you are looking to define all descriptions at one place for the columns which are common in multiple tables, I have not seen any feature in dbt to help you. @joellabes - Any help you can provide on this?

---

<div class="post-metadata">

### Author: ![guserrl](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/guserrl/32/3243_2.png) [@guserrl](https://discourse.getdbt.com/u/guserrl)
#### Post date: [November 21, 2023, 10:21am UTC](https://discourse.getdbt.com/t/dbt-found-two-schema-yml-entries-for-the-same-resource/10868/5 "2023-11-21T10:21:53Z")

</div>

Thanks for your time, is a pity i cant do that.

---

<div class="post-metadata">

### Author: ![minhajpasha](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/minhajpasha/32/1159_2.png) [@minhajpasha](https://discourse.getdbt.com/u/minhajpasha)
#### Post date: [December 8, 2023, 4:15pm UTC](https://discourse.getdbt.com/t/dbt-found-two-schema-yml-entries-for-the-same-resource/10868/6 "2023-12-08T16:15:34Z")

</div>

Hello @guserrl .  
I think schema alias + below example can help you.

schema file :customer.yml

version: 2

models:

- name: section for columns comments for customer table  
columns: &section\_cols # block of columns which are defined once in schema.yml file
  - name: customer\_id  
description: customer unique id
  - name: customer\_name  
description: customer name
  - name: customer\_age  
description: customer age
  - name: customer\_post\_code  
description: customer post code

models:

- name: stg\_customer # table one  
description: staging customer table  
columns: \*section\_cols # referring columns comment block

- name: customer # table two  
description: primary customer table  
columns: \*section\_cols # referring columns comment block

stg\_customer.sql # model one  
{{  
config(materialized=‘table’)  
}}

select

1 as customer\_id,  
“naveed” as customer\_name,  
“s1 e001” as customer\_post\_code

customer.sql # model two  
{{  
config(materialized=‘table’)  
}}

select

\*,  
23 as customer\_age  
from {{ref(“stg\_customer”)}}

when i run the both the model’s (in big query) . i can see the descriptions are reflected for both stg\_customer and customer table

 ![image](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/2X/f/f46e51ca8439751bc6b25497214547ecfff1162f.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/2X/0/0c0f8bcbe554a150e422b55a0c3c38acfbd62317.png)
