Separate models for initial load and for incremental updates

Hello, I need to build a model - slowly changing dimension type 2 - and I need to use two separate queries for building it. First is for the initial load of data, it will use the table with historic log of changes called user_activity to recreate the past data for the new model. The second query will use the snapshot table and extract data from it daily for future row insertions (I need to use this snapshot table because the user_activity table sometimes fails to record updates, so the snapshot table is more correct).

I’m new with dbt and I’m having trouble figuring out how to keep these two models in my dbt project, only run the initial load model once and exclude it from every subsequent load, without having to type “dbt run --exclude model” every time (because someone is bound to forget to include that clause at some point).

Is there a way to permanently exclude a model from running on “dbt run” and just run it manually when I want to?

Thanks!

You can use the is_incremental() macro to differentiate between a full refresh (i.e., initial load of data) and subsequent incremental updates. This can be used to insert a where clause for incremental updates, as an example.

Thanks for the suggestion kinghuang. I think I found a better solution because it uses a configurational change.

I can define a model config and set enabled to false.