cubes:
  - name: category_attribute
    sql_table: inventory_v2.category_attribute
    data_source: default

    joins:
      - name: category
        sql: "{CUBE}.category_id = {category.id}"
        relationship: many_to_one

    dimensions:
      - name: id
        sql: id
        type: number
        primary_key: true

      - name: createdat
        sql: "{CUBE}.`createdAt`"
        type: time

      - name: updatedat
        sql: "{CUBE}.`updatedAt`"
        type: time

    measures:
      - name: count
        type: count

    pre_aggregations:
      # Pre-aggregation definitions go here.
      # Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started

