# How to make a schema run on a different profile.

**URL:** <https://discourse.getdbt.com/t/how-to-make-a-schema-run-on-a-different-profile/10291>\
**Category:** Help\
**Tags:** dbt-core\
**Created:** [October 11, 2023, 8:21am UTC](https://discourse.getdbt.com/t/how-to-make-a-schema-run-on-a-different-profile/10291 "2023-10-11T08:21:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![B-P](https://avatars.discourse-cdn.com/v4/letter/b/dc4da7/32.png) [@B-P](https://discourse.getdbt.com/u/B-P)\
**Post date:** [October 11, 2023, 8:21am UTC](https://discourse.getdbt.com/t/how-to-make-a-schema-run-on-a-different-profile/10291/1 "2023-10-11T08:21:07Z")

</div>

Currently I have set-up a medaillon structure in dbt. Using dbt core. I have 3 different catalogs in Databricks for Bronze - Silver - Gold as my target. I have also set-up a containerized instance of dbt that will run the models. However I am not able to set-up multiple commands for that container. So when I execute dbt run on that container on a schedule, it will use the default target. Which is Bronze in this case, specified in the dbt\_project.yml

What I want is, that when the Bronze schema are run, it will use profile A, when the silver schema models are run, it will use profile B and when the gold schema runs it will use profile C, which are all defined in the profiles.yml.

I am thinking I should put all schemas into 1 catalog…

But in the article it says:

> If you have different data catalogs/schemas for your source data depending on your environment, you can use the [target.name](https://docs.getdbt.com/reference/dbt-jinja-functions/target#use-targetname-to-change-your-source-database) to change the data catalog/schema you’re pulling from depending on the environment.

Unfortunately I do not understand how this translates. Because if I look at the example code:

> sources:
> 
> - name: source\_name  
> database: |  
> {%- if target.name == “dev” -%} raw\_dev  
> {%- elif target.name == “qa” -%} raw\_qa  
> {%- elif target.name == “prod” -%} raw\_prod  
> {%- else -%} invalid\_database  
> {%- endif -%}  
> schema: source\_schema

Database in this case will be catalog. But then I also need to specify a schema.

I know it is possible manually with the -t argument. I am wondering if I can automate this per schema, like how I can specify that everything in bronze needs to be materialized as a table. If I can do this in another way please let me know.

Thanks for your help in advance, I hope I made myself clear 🙂
