[# sources.yml Template #]
[# Defines source and its tables for the dbt project #]
version: 2

sources:
  - name: [[ source.name | lower | replace(" ", "_") ]]
[% if source.database_name %]
    database: [[ source.database_name ]]
[% endif %]
    schema: [[ source.schema_name ]]
    tables:
[% for table in source.tables %]
      - name: [[ table.table_name ]]
        description: "Source table from [[ source.source_system ]]"
        columns:
[% for column in table.columns %]
          - name: [[ column.column_name ]]
            data_type: [[ column.datatype ]]
[% endfor %]
[% endfor %]