Create a new dbt model and work on it in an Omni branch
Firstly, the model must be built within your development environment.
- Run the dbt build command, using your development environment
Secondly, the code for the dbt model must be pushed to GitHub (or other git provider)
-
Create a branch in your git repository (git checkout -b branch_for_my_new_model)
-
Add the code for your dbt model to the branch (git add models/my_new_model.sql, git commit -m “add new model”
-
Push the code to GitHub (git push -u origin branch_for_my_new_model)
Now, switch into Omni
-
Create a branch in Omni that has the exact same name as your git branch (from the example above, branch_for_my_new_model). If the name is not the same, this will not pick up your git branch’s changes
-
Switch to your dbt development environment in the branch header at the top
-
Run a refresh schema from the menu Model → Refresh schema
-
Viola! Your development models are now present for you to work with in Omni before you push them to production within your database