Newbie: How can I specify the schema in the schema.yml file

Hi,
I’m new to dbt, I’m using the jaffle_shop demo.
I ran it fine, now I want to specify the schema now for each model.
My schema.yml file looks like this:
How do I set the schema ?
Thanks Pierre !
version: 2

models:

  • name: stg_customers
    columns:

    • name: customer_id
      tests:
      • unique
      • not_null
  • name: stg_orders
    columns:

    • name: order_id
      tests:
      • unique
      • not_null
    • name: status
      tests:
      • accepted_values:
        values: [‘placed’, ‘shipped’, ‘completed’, ‘return_pending’, ‘returned’]
  • name: stg_payments
    columns:

    • name: payment_id
      tests:
      • unique
      • not_null
    • name: payment_method
      tests:
      • accepted_values:
        values: [‘credit_card’, ‘coupon’, ‘bank_transfer’, ‘gift_card’]

Have a read at this section

You can configure the schema, and other properties in three ways
project file
property file
config block

The case you are asking is the property file, which is like

version: 2

models:
  - name: [<model-name>]
    config:
      schema: <string>

Thanks a lot Bruno.
Pierre

Hi again,
So it would look like this or do I need to move right what comes below (starting at columns) ?

- name: stg_orders
    config:
      schema: dbt-silver
    columns:
      - name: order_id
        tests:
          - unique
          - not_null
      - name: status
        tests:
          - accepted_values:
              values: ['placed', 'shipped', 'completed', 'return_pending', 'returned']

Thanks Pierre

This should work, yml is tricky sometimes

You can always check the snippet here at the top of the page to see the right identention

Thanks again ! Pierre