functions: []
query_templates: []
remote_schemas: []
tables:
- array_relationships: []
  delete_permissions: []
  event_triggers: []
  insert_permissions: []
  object_relationships:
  - comment: null
    name: chat
    using:
      manual_configuration:
        column_mapping:
          chat_id: id
        remote_table: chat
  - comment: null
    name: sender
    using:
      manual_configuration:
        column_mapping:
          sender_id: id
        remote_table: users
  select_permissions:
  - comment: null
    permission:
      allow_aggregations: true
      columns:
      - chat_id
      - content
      - created_at
      - id
      - sender_id
      filter:
        _or:
        - sender_id:
            _eq: X-Hasura-User-Id
        - chat:
            users:
              user_id:
                _eq: X-Hasura-User-Id
      limit: 1
    role: user
  table: message_user
  update_permissions: []
- array_relationships: []
  delete_permissions:
  - comment: null
    permission:
      filter: {}
    role: user
  event_triggers: []
  insert_permissions:
  - comment: null
    permission:
      check: {}
      columns:
      - chat_id
      - user_id
      set: {}
    role: user
  object_relationships: []
  select_permissions:
  - comment: null
    permission:
      allow_aggregations: false
      columns:
      - chat_id
      - user_id
      filter: {}
    role: user
  table: chat_group_admins
  update_permissions:
  - comment: null
    permission:
      columns:
      - chat_id
      - user_id
      filter: {}
      set: {}
    role: user
- array_relationships:
  - comment: null
    name: users
    using:
      foreign_key_constraint_on:
        column: chat_id
        table: chat_users
  - comment: null
    name: messages
    using:
      foreign_key_constraint_on:
        column: chat_id
        table: message
  delete_permissions:
  - comment: null
    permission:
      filter:
        _or:
        - owner_id:
            _eq: X-Hasura-User-Id
        - users:
            user_id:
              _eq: X-Hasura-User-Id
    role: user
  event_triggers: []
  insert_permissions:
  - comment: null
    permission:
      check:
        _or:
        - owner_id:
            _eq: X-Hasura-User-Id
        - users:
            user_id:
              _eq: X-Hasura-User-Id
        - owner_id:
            _is_null: true
      columns:
      - created_at
      - id
      - name
      - owner_id
      - picture
      set: {}
    role: user
  object_relationships:
  - comment: null
    name: owner
    using:
      foreign_key_constraint_on: owner_id
  select_permissions:
  - comment: null
    permission:
      allow_aggregations: true
      columns:
      - created_at
      - id
      - name
      - owner_id
      - picture
      filter:
        _or:
        - owner_id:
            _eq: X-Hasura-User-Id
        - users:
            user_id:
              _eq: X-Hasura-User-Id
    role: user
  table: chat
  update_permissions:
  - comment: null
    permission:
      columns:
      - created_at
      - id
      - name
      - owner_id
      - picture
      filter:
        _or:
        - owner_id:
            _eq: X-Hasura-User-Id
        - users:
            user_id:
              _eq: X-Hasura-User-Id
      set: {}
    role: user
- array_relationships: []
  delete_permissions:
  - comment: null
    permission:
      filter:
        _or:
        - user_id:
            _eq: X-Hasura-User-Id
        - chat:
            users:
              user_id:
                _eq: X-Hasura-User-Id
    role: user
  event_triggers: []
  insert_permissions:
  - comment: null
    permission:
      check: {}
      columns:
      - chat_id
      - user_id
      set: {}
    role: user
  object_relationships:
  - comment: null
    name: chat
    using:
      foreign_key_constraint_on: chat_id
  - comment: null
    name: user
    using:
      foreign_key_constraint_on: user_id
  select_permissions:
  - comment: null
    permission:
      allow_aggregations: true
      columns:
      - chat_id
      - user_id
      filter:
        _or:
        - user_id:
            _eq: X-Hasura-User-Id
        - chat:
            users:
              user_id:
                _eq: X-Hasura-User-Id
    role: user
  table: chat_users
  update_permissions: []
- array_relationships: []
  delete_permissions:
  - comment: null
    permission:
      filter:
        id:
          _eq: X-Hasura-User-Id
    role: user
  event_triggers: []
  insert_permissions:
  - comment: null
    permission:
      check:
        id:
          _eq: X-Hasura-User-Id
      columns:
      - created_at
      - id
      - name
      - password
      - picture
      - username
      set: {}
    role: user
  object_relationships: []
  select_permissions:
  - comment: null
    permission:
      allow_aggregations: false
      columns:
      - created_at
      - id
      - name
      - password
      - picture
      - username
      filter: {}
    role: user
  - comment: null
    permission:
      allow_aggregations: false
      columns:
      - created_at
      - id
      - name
      - password
      - picture
      - username
      filter:
        id:
          _eq: X-Hasura-User-Id
    role: mine
  table: users
  update_permissions:
  - comment: null
    permission:
      columns:
      - created_at
      - id
      - name
      - password
      - picture
      - username
      filter:
        id:
          _eq: X-Hasura-User-Id
      set: {}
    role: user
- array_relationships: []
  delete_permissions:
  - comment: null
    permission:
      filter: {}
    role: user
  event_triggers: []
  insert_permissions:
  - comment: null
    permission:
      check: {}
      columns:
      - id
      - received_at
      - read_at
      - user_id
      - message_id
      set: {}
    role: user
  object_relationships:
  - comment: null
    name: user
    using:
      foreign_key_constraint_on: user_id
  - comment: null
    name: message
    using:
      foreign_key_constraint_on: message_id
  select_permissions:
  - comment: null
    permission:
      allow_aggregations: false
      columns:
      - id
      - message_id
      - read_at
      - received_at
      - user_id
      filter: {}
    role: user
  table: recipient
  update_permissions:
  - comment: null
    permission:
      columns:
      - id
      - message_id
      - read_at
      - received_at
      - user_id
      filter: {}
      set: {}
    role: user
- array_relationships:
  - comment: null
    name: recipients
    using:
      foreign_key_constraint_on:
        column: message_id
        table: recipient
  delete_permissions:
  - comment: null
    permission:
      filter:
        _or:
        - sender_id:
            _eq: X-Hasura-User-Id
    role: user
  event_triggers: []
  insert_permissions:
  - comment: null
    permission:
      check:
        _or:
        - sender_id:
            _eq: X-Hasura-User-Id
      columns:
      - id
      - content
      - created_at
      - sender_id
      - chat_id
      set: {}
    role: user
  object_relationships:
  - comment: null
    name: chat
    using:
      foreign_key_constraint_on: chat_id
  - comment: null
    name: sender
    using:
      foreign_key_constraint_on: sender_id
  select_permissions:
  - comment: null
    permission:
      allow_aggregations: true
      columns:
      - chat_id
      - content
      - created_at
      - id
      - sender_id
      filter:
        _or:
        - sender_id:
            _eq: X-Hasura-User-Id
        - chat:
            users:
              user_id:
                _eq: X-Hasura-User-Id
    role: user
  table: message
  update_permissions:
  - comment: null
    permission:
      columns:
      - chat_id
      - content
      - created_at
      - id
      - sender_id
      filter:
        _or:
        - sender_id:
            _eq: X-Hasura-User-Id
      set: {}
    role: user
