---
desc: Sample database document.
labels:
  - sample
  - tbls
lint:
  requireColumnComment:
    enabled: true
    exclude:
      - id
      - created
      - updated
  columnCount:
    enabled: true
    max: 5
viewpoints:
  -
    name: Content
    desc: Content as an asset for blogging services
    labels:
      - content
  -
    name: Ops
    desc: Tables to be referenced during operation
    tables:
      - logs
      - users
      - posts
  -
    name: Around the users table
    desc: Tables related to the users table
    tables:
      - users
    distance: 1
    groups:
      -
        name: Content
        desc: Content as an asset for blogging services
        labels:
          - content
  -
    name: Secure data
    desc: Tables with secure data
    labels:
      - secure
relations:
  -
    table: logs
    columns:
      - user_id
    parentTable: users
    parentColumns:
      - id
    def: logs->users
  -
    table: logs
    columns:
      - post_id
    parentTable: posts
    parentColumns:
      - id
  -
    table: logs
    columns:
      - comment_id
    parentTable: comments
    parentColumns:
      - id
  -
    table: logs
    columns:
      - comment_star_id
    parentTable: comment_stars
    parentColumns:
      - id
comments:
  -
    table: user_options
    labels:
      - user
  -
    table: posts
    columnComments:
      body: post body
    columnLabels:
      user_id:
        - user
    labels:
      - content
  -
    table: comments
    labels:
      - content
    columnLabels:
      user_id:
        - user
  -
    table: comment_stars
    labels:
      - content
    columnLabels:
      user_id:
        - user
  -
    table: logs
  -
    table: post_comments
    tableComment: post and comments View table
    columnComments:
      id: comments.id
      title: posts.title
      post_user: posts.users.username
      comment_user: comments.users.username
      created: comments.created
      updated: comments.updated
    labels:
      - content
  -
    table: users
    columnLabels:
      email:
        - secure
      password:
        - secure
        - encrypted
    labels:
      - user
