hey team, I have various DBT projects that runs t...
# community-support
t
hey team, I have various DBT projects that runs through various jobs and gets saved into the same DB but different schemas. If I were to run elementary on all the jobs, will the elementary tables be saved in the elementary schema? If so, how do I avoid the conflicts?
✅ 1
e
Hi @Terrill Lim, In order to avoid conflicts the best practice is to have a separate Elementary schema per dbt project, this way you won't have any conflicts
t
what if all our projects are in the same dbt project? Are there any work arounds for that?
e
if it's just one dbt project then one Elementary schema should be enough, even if you run the models in multiple jobs
t
the way our projects are set up, we have multiple projects in one dbt project but we run separate jobs for each project. I know it’s not best practice but are there ways to avoid conflicts other than restructuring the dbt project structure?
e
@Terrill Lim When you say multiple projects in one dbt project what do you mean exactly? Because for one dbt project you should be ok with one Elementary schema, did you try it and get conflicts?
t
What I mean is that we have different jobs running different schemas at different times but saving to the same db. I’m worried that if we run a different job, it’ll replace the elementary results of the previous. Here’s a sample code from our dbt_project.yml. An example, job1 will run stg1 & marts1 and so on so will job2 erase results from job1?
Copy code
models:
  +copy_grants: true
  data_engineering_snowflake:
    +database: dwh_prod
    staging:
      ware_prod:
        stg1:
          +schema: stg1
        stg2:  
          +materialized: table
          +schema: stg2
        stg3:  
          +materialized: table
          +schema: stg3
        stg4:
          +materialized: table
          +schema: stg1
    marts:
      ware_prod:
        marts1:
          +schema: marts1
        marts2:
          +schema: marts2
        marts3:
          +schema: marts3
e
yeah I understand, but this shouldn't happen. if all those models are all in your dbt project (for example, if you see all of them in your dbt docs), then you can use one Elementary schema for all of them and each job will only update the artifacts that were changed. The artifacts are derived from the dbt project json files and logs
t
got it thank you.