Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ tasks:
# [AFTER applying metadata & migrations] Apply the hasura seeds
seed:
cmds:
- hasura seeds apply --project apps/hasura --admin-secret ${HASURA_GRAPHQL_ADMIN_SECRET}
- hasura seeds apply --project apps/hasura --admin-secret ${HASURA_GRAPHQL_ADMIN_SECRET} --database-name masterbots > seed.log 2>&1
# - hasura seeds apply --project apps/hasura --admin-secret ${HASURA_GRAPHQL_ADMIN_SECRET}

# Turns on the hasura backend (docker desktop must be started first)
up:
Expand Down
1 change: 0 additions & 1 deletion apps/hasura/metadata/databases/databases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
isolation_level: read-committed
use_prepared_statements: false
tables: "!include masterbots/tables/tables.yaml"
functions: "!include masterbots/functions/functions.yaml"
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ object_relationships:
- name: complexityEnum
using:
foreign_key_constraint_on: default_complexity
- name: department
using:
foreign_key_constraint_on: department_id
- name: lengthEnum
using:
foreign_key_constraint_on: default_length
Expand Down Expand Up @@ -39,13 +36,6 @@ array_relationships:
table:
name: chatbot_domain
schema: public
- name: organization_chatbots
using:
foreign_key_constraint_on:
column: chatbot_id
table:
name: organization_chatbot
schema: public
- name: prompts
using:
foreign_key_constraint_on:
Expand All @@ -66,6 +56,7 @@ select_permissions:
columns:
- avatar
- chatbot_id
- chatbot_id
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate column chatbot_id appears twice in the select permissions. This appears to be an accidental duplication that should be removed.

Suggested change
- chatbot_id

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove duplicate column entry.

The chatbot_id column appears twice in the anonymous role's select permissions (lines 58 and 59). This duplication is redundant and may cause metadata validation warnings.

🔎 Proposed fix
       columns:
         - avatar
         - chatbot_id
-        - chatbot_id
         - created_by
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- chatbot_id
columns:
- avatar
- chatbot_id
- created_by
🤖 Prompt for AI Agents
In apps/hasura/metadata/databases/masterbots/tables/public_chatbot.yaml around
line 59, the anonymous role's select permissions include a duplicated
"chatbot_id" column entry; remove the second occurrence (the entry on line 59)
so each column appears only once in the columns list, then save and run Hasura
metadata validation to ensure no warnings remain.

- created_by
- default_complexity
- default_length
Expand All @@ -84,20 +75,20 @@ select_permissions:
- role: moderator
permission:
columns:
- disabled
- is_pro
- pro_exclusive
- avatar
- chatbot_id
- department_id
- order
- avatar
- created_by
- default_complexity
- default_length
- default_tone
- default_type
- department_id
- description
- disabled
- name
- order
filter: {}
allow_aggregations: true
comment: ""
Expand Down
122 changes: 16 additions & 106 deletions apps/hasura/metadata/databases/masterbots/tables/public_message.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@ table:
name: message
schema: public
object_relationships:
- name: actionTypeEnum
- name: message
using:
foreign_key_constraint_on: action_type
- name: docContextPolicyEnum
using:
foreign_key_constraint_on: doc_context_policy
- name: intentSourceEnum
using:
foreign_key_constraint_on: intent_source

foreign_key_constraint_on: augmented_from
- name: messageTypeEnum
using:
foreign_key_constraint_on: role
Expand All @@ -24,49 +17,36 @@ object_relationships:
remote_table:
name: models_enum
schema: public
- name: scopeTypeEnum
using:
foreign_key_constraint_on: scope_type
- name: thread
using:
foreign_key_constraint_on: thread_id
- name: uiModeEnum
using:
foreign_key_constraint_on: ui_mode
array_relationships:

- name: messages
using:
foreign_key_constraint_on:
column: augmented_from
table:
name: message
schema: public
insert_permissions:
- role: moderator
permission:
check: {}
columns:
- action_type

- augmented_from
- content
- created_at
- doc_context_included
- doc_context_policy
- doc_node_id
- examples
- exclude_from_q_chain
- heading_content_version
- intent_source
- isContinued
- message_id
- model
- mutation_allowed
- mutation_applied
- prompt
- rag_eligible
- role
- scope_id
- scope_type
- short_link
- slug
- thinking
- thinking_traces
- thread_id
- ui_mode
comment: ""
- role: user
permission:
Expand All @@ -75,165 +55,95 @@ insert_permissions:
user_id:
_eq: X-Hasura-User-Id
columns:
- action_type

- augmented_from
- content
- created_at
- doc_context_included
- doc_context_policy
- doc_node_id
- examples
- exclude_from_q_chain
- heading_content_version
- intent_source
- isContinued
- message_id
- model
- mutation_allowed
- mutation_applied
- prompt
- rag_eligible
- role
- scope_id
- scope_type
- short_link
- slug
- thinking
- thinking_traces
- thread_id
- ui_mode
comment: ""
select_permissions:
- role: anonymous
permission:
columns:
- action_type

- augmented_from
- content
- created_at
- doc_context_included
- doc_context_policy
- doc_node_id
- examples
- exclude_from_q_chain
- heading_content_version
- intent_source
- isContinued
- message_id
- model
- mutation_allowed
- mutation_applied
- prompt
- rag_eligible
- role
- scope_id
- scope_type
- short_link
- slug
- thinking
- thinking_traces
- thread_id
- ui_mode
filter: {}
allow_aggregations: true
comment: ""
- role: moderator
permission:
columns:
- action_type

- augmented_from
- content
- created_at
- doc_context_included
- doc_context_policy
- doc_node_id
- examples
- exclude_from_q_chain
- heading_content_version
- intent_source
- isContinued
- message_id
- model
- mutation_allowed
- mutation_applied
- prompt
- rag_eligible
- role
- scope_id
- scope_type
- short_link
- slug
- thinking
- thinking_traces
- thread_id
- ui_mode
filter: {}
allow_aggregations: true
comment: ""
- role: user
permission:
columns:
- action_type

- augmented_from
- content
- created_at
- doc_context_included
- doc_context_policy
- doc_node_id
- examples
- exclude_from_q_chain
- heading_content_version
- intent_source
- isContinued
- message_id
- model
- mutation_allowed
- mutation_applied
- prompt
- rag_eligible
- role
- scope_id
- scope_type
- short_link
- slug
- thinking
- thinking_traces
- thread_id
- ui_mode
filter: {}
allow_aggregations: true
comment: ""
update_permissions:
- role: moderator
permission:
columns:
- doc_context_included
- doc_context_policy
- doc_node_id
- examples
- exclude_from_q_chain
- heading_content_version
- intent_source
- mutation_applied
- rag_eligible
- scope_id
- content
- short_link
filter: {}
check: null
comment: ""
- role: user
permission:
columns:
- doc_context_included
- doc_context_policy
- doc_node_id
- examples
- exclude_from_q_chain
- heading_content_version
- intent_source
- mutation_applied
- rag_eligible
- scope_id
- content
- short_link
filter:
thread:
Expand Down
Loading