Is it possible to automatically alias only the model that is being built (using generate_alias_name) and not all models?
For example, if I run dbt run -m model_name I want model_name model to have database identifier as dbtuser_model_name so multiple data analysts can build the same model in the playground schema without collisions?
Basically I want to conditionally override the name of the model. Is it possible to extract some JInja variable that tells that this or that model is a model that is being build (not ref’ed).
In this case all tables will be aliased with dbtuser_ prefix (not only the model that is being built). For example if we build target_model that references source_model with {{ ref('source_model') then dbt run -m target_model --vars 'add_database_to_model_name: true' will fail with the error that there is no table in the database with dbtuser_source_model identifier.
Is there a way to not alias source tables but only the model that is being built?