---
desc: Sample PostgreSQL database document.
exclude:
  - user_access_logs
lint:
  requireColumnComment:
    enabled: true
    exclude:
      - id
      - created
      - updated
  columnCount:
    enabled: true
    max: 5
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: posts
    columnComments:
      body: post body
    triggerComments:
      update_posts_updated: Update updated when posts update
  -
    table: logs
    tableComment: audit log table
  -
    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
  -
    table: user_options
    constraintComments:
      user_options_user_id_fk: FK
    indexComments:
      user_options_pkey: PRIMARY KEY
  -
    table: administrator.blogs
    tableComment: admin blogs
