title: dbt cannot create two resources with identical database representations
body: <p>I have a situation here as below:</p>
  <p>There are two models in my dbt project</p>
  <ol>
  <li>model-A</li>
  </ol>
  <pre><code>{{ config(
      materialized='ephemeral',
      alias='A_0001',
      schema=var('xxx_yyy_dataset')
  ) }}
  </code></pre>
  <ol start="2">
  <li>model-B</li>
  </ol>
  <pre><code>{{ config(
      materialized='ephemeral',
      alias='B_0002',
      schema=var('xxx_yyy_dataset')
  ) }}
  </code></pre>
  <p>And these are getting materialized as incremental in same schema as <code>xxx_yyy_dataset.Table_DDD</code></p>
  <pre><code>{{ config(
      materialized='incremental',
      alias='Table_DDD',
      schema=var('xxx_yyy_dataset')
  ) }}
  SELECT * FROM {{ref('A_0001')}}
  UNION ALL
  SELECT * FROM {{ref('B_0002')}}
  </code></pre>
  <p>This is working fine and it is ingesting records into target table.</p>
  <p>Now I have introduced another model - model-C ind different package
  model-C</p>
  <pre><code>{{ config(
      materialized='incremental',
      alias='Table_DDD',
      schema=var('xxx_yyy_dataset')
  ) }}
  </code></pre>
  <p>This gives me the following error:</p>
  <pre><code>$ dbt compile --profiles-dir=profile --target ide
  Running with dbt=0.16.0
  Encountered an error:
  Compilation Error
    dbt found two resources with the database representation &quot;xxx_yyy_dataset.Table_DDD&quot;.
    dbt cannot create two resources with identical database representations. To fix this,
    change the &quot;schema&quot; or &quot;alias&quot; configuration of one of these resources:
    - model.eplus_rnc_dbt_project.conrol_outcome_joined (models/controls/payment/fa-join/conrol_outcome_joined.sql)
    - model.eplus_rnc_dbt_project.dq_control_outcome_joined (models/controls/dq/dq-join/dq_control_outcome_joined.sql)
  </code></pre>
  <p>I have configured macro for custom macro as below :</p>
  <pre><code>{% macro generate_schema_name(custom_schema_name, node) -%}
      {%- set default_schema = target.schema -%}
      {%- if custom_schema_name is none -%}
          {{ default_schema }}
      {%- else -%}
          {{ custom_schema_name }}
      {%- endif -%}
  {%- endmacro %}
  
  
  {% macro generate_alias_name(custom_alias_name=none, node=none) -%}
      {%- if custom_alias_name is none -%}
          {{ node.name }}
      {%- else -%}
          {{ custom_alias_name | trim }}
      enter code here
      {%- endif -%}
  {%- endmacro %}
  </code></pre>