From f5ced2faf9cf3e16245ebc090b8398a8b6f1ca6c Mon Sep 17 00:00:00 2001 From: Tomi Turtiainen <10324676+tomi@users.noreply.github.com> Date: Fri, 12 Jun 2026 10:44:01 +0300 Subject: [PATCH] feat(core): Add auto-generated database schema documentation (no-changelog) (#32069) --- .../plugins/n8n/skills/db-migrations/SKILL.md | 19 +- .github/workflows/ci-pull-requests.yml | 24 + .gitignore | 1 + .tbls.postgres.yml | 16 + .tbls.sqlite.yml | 16 + docs/db.md | 37 + docs/generated/postgres-schema/README.md | 1309 ++ .../public.agent_checkpoints.md | 65 + .../postgres-schema/public.agent_execution.md | 104 + .../public.agent_execution_threads.md | 145 + .../postgres-schema/public.agent_files.md | 73 + .../postgres-schema/public.agent_history.md | 123 + .../public.agent_task_definition.md | 70 + .../public.agent_task_run_lock.md | 66 + .../public.agent_task_snapshot.md | 69 + .../postgres-schema/public.agents.md | 231 + .../public.agents_memory_entries.md | 110 + .../public.agents_memory_entry_cursors.md | 77 + .../public.agents_memory_entry_locks.md | 75 + .../public.agents_memory_entry_sources.md | 121 + .../postgres-schema/public.agents_messages.md | 67 + .../public.agents_observation_cursors.md | 77 + .../public.agents_observation_locks.md | 81 + .../public.agents_observations.md | 111 + .../public.agents_resources.md | 68 + .../postgres-schema/public.agents_threads.md | 114 + .../public.ai_builder_temporary_workflow.md | 80 + .../public.annotation_tag_entity.md | 50 + .../postgres-schema/public.auth_identity.md | 65 + .../public.auth_provider_sync_history.md | 64 + .../postgres-schema/public.binary_data.md | 59 + .../public.chat_hub_agent_tools.md | 68 + .../postgres-schema/public.chat_hub_agents.md | 143 + .../public.chat_hub_messages.md | 158 + .../public.chat_hub_session_tools.md | 68 + .../public.chat_hub_sessions.md | 167 + .../postgres-schema/public.chat_hub_tools.md | 89 + .../public.credential_dependency.md | 65 + .../public.credentials_entity.md | 152 + .../postgres-schema/public.data_table.md | 72 + .../public.data_table_column.md | 64 + .../postgres-schema/public.deployment_key.md | 58 + .../public.dynamic_credential_entry.md | 77 + .../public.dynamic_credential_resolver.md | 83 + .../public.dynamic_credential_user_entry.md | 96 + .../public.evaluation_collection.md | 136 + .../public.evaluation_config.md | 125 + .../public.event_destinations.md | 44 + .../public.execution_annotation_tags.md | 58 + .../public.execution_annotations.md | 73 + .../postgres-schema/public.execution_data.md | 62 + .../public.execution_entity.md | 159 + .../public.execution_metadata.md | 64 + .../postgres-schema/public.folder.md | 93 + .../postgres-schema/public.folder_tag.md | 56 + .../public.insights_by_period.md | 59 + .../public.insights_metadata.md | 100 + .../postgres-schema/public.insights_raw.md | 57 + .../postgres-schema/public.installed_nodes.md | 54 + .../public.installed_packages.md | 55 + .../public.instance_ai_checkpoints.md | 82 + .../public.instance_ai_iteration_logs.md | 62 + ...ic.instance_ai_mcp_registry_connections.md | 98 + .../public.instance_ai_messages.md | 67 + .../public.instance_ai_observation_cursors.md | 58 + .../public.instance_ai_observation_locks.md | 62 + ...public.instance_ai_observational_memory.md | 127 + .../public.instance_ai_observations.md | 80 + ...ublic.instance_ai_pending_confirmations.md | 110 + .../public.instance_ai_resources.md | 45 + .../public.instance_ai_run_snapshots.md | 72 + .../public.instance_ai_threads.md | 199 + .../public.instance_ai_workflow_snapshots.md | 52 + .../public.instance_version_history.md | 47 + .../public.invalid_auth_token.md | 38 + .../public.mcp_registry_server.md | 64 + .../public.oauth_access_tokens.md | 73 + .../public.oauth_authorization_codes.md | 101 + .../postgres-schema/public.oauth_clients.md | 96 + .../public.oauth_refresh_tokens.md | 85 + .../public.oauth_user_consents.md | 78 + .../postgres-schema/public.processed_data.md | 71 + .../postgres-schema/public.project.md | 190 + .../public.project_relation.md | 94 + .../public.project_secrets_provider_access.md | 72 + docs/generated/postgres-schema/public.role.md | 92 + .../public.role_mapping_rule.md | 72 + .../public.role_mapping_rule_project.md | 63 + .../postgres-schema/public.role_scope.md | 57 + .../generated/postgres-schema/public.scope.md | 44 + .../public.secrets_provider_connection.md | 62 + .../postgres-schema/public.settings.md | 41 + .../public.shared_credentials.md | 75 + .../postgres-schema/public.shared_workflow.md | 85 + .../postgres-schema/public.tag_entity.md | 56 + .../public.test_case_execution.md | 105 + .../postgres-schema/public.test_run.md | 143 + .../public.token_exchange_jti.md | 41 + .../postgres-schema/public.trusted_key.md | 56 + .../public.trusted_key_source.md | 61 + docs/generated/postgres-schema/public.user.md | 291 + .../postgres-schema/public.user_api_keys.md | 78 + .../postgres-schema/public.user_favorites.md | 67 + .../postgres-schema/public.variables.md | 61 + .../postgres-schema/public.webhook_entity.md | 73 + .../public.workflow_builder_session.md | 101 + .../public.workflow_dependency.md | 85 + .../postgres-schema/public.workflow_entity.md | 304 + .../public.workflow_history.md | 105 + .../public.workflow_publication_outbox.md | 54 + .../public.workflow_publish_history.md | 108 + .../public.workflow_published_version.md | 83 + .../public.workflow_statistics.md | 50 + .../postgres-schema/public.workflows_tags.md | 71 + docs/generated/postgres-schema/schema.json | 18859 ++++++++++++++++ docs/generated/sqlite-schema/README.md | 1299 ++ .../sqlite-schema/agent_checkpoints.md | 73 + .../sqlite-schema/agent_execution.md | 108 + .../sqlite-schema/agent_execution_threads.md | 146 + docs/generated/sqlite-schema/agent_files.md | 77 + docs/generated/sqlite-schema/agent_history.md | 130 + .../sqlite-schema/agent_task_definition.md | 75 + .../sqlite-schema/agent_task_run_lock.md | 73 + .../sqlite-schema/agent_task_snapshot.md | 74 + docs/generated/sqlite-schema/agents.md | 235 + .../sqlite-schema/agents_memory_entries.md | 113 + .../agents_memory_entry_cursors.md | 84 + .../agents_memory_entry_locks.md | 82 + .../agents_memory_entry_sources.md | 124 + .../sqlite-schema/agents_messages.md | 72 + .../agents_observation_cursors.md | 84 + .../sqlite-schema/agents_observation_locks.md | 88 + .../sqlite-schema/agents_observations.md | 114 + .../sqlite-schema/agents_resources.md | 77 + .../generated/sqlite-schema/agents_threads.md | 122 + .../ai_builder_temporary_workflow.md | 88 + .../sqlite-schema/annotation_tag_entity.md | 58 + docs/generated/sqlite-schema/auth_identity.md | 81 + .../auth_provider_sync_history.md | 71 + docs/generated/sqlite-schema/binary_data.md | 64 + .../sqlite-schema/chat_hub_agent_tools.md | 79 + .../sqlite-schema/chat_hub_agents.md | 145 + .../sqlite-schema/chat_hub_messages.md | 162 + .../sqlite-schema/chat_hub_session_tools.md | 79 + .../sqlite-schema/chat_hub_sessions.md | 171 + .../generated/sqlite-schema/chat_hub_tools.md | 92 + .../sqlite-schema/credential_dependency.md | 70 + .../sqlite-schema/credentials_entity.md | 153 + docs/generated/sqlite-schema/data_table.md | 79 + .../sqlite-schema/data_table_column.md | 69 + .../generated/sqlite-schema/deployment_key.md | 64 + .../sqlite-schema/dynamic_credential_entry.md | 85 + .../dynamic_credential_resolver.md | 89 + .../dynamic_credential_user_entry.md | 104 + .../sqlite-schema/evaluation_collection.md | 142 + .../sqlite-schema/evaluation_config.md | 126 + .../sqlite-schema/event_destinations.md | 52 + .../execution_annotation_tags.md | 69 + .../sqlite-schema/execution_annotations.md | 79 + .../generated/sqlite-schema/execution_data.md | 76 + .../sqlite-schema/execution_entity.md | 163 + .../sqlite-schema/execution_metadata.md | 70 + docs/generated/sqlite-schema/folder.md | 100 + docs/generated/sqlite-schema/folder_tag.md | 67 + .../sqlite-schema/insights_by_period.md | 64 + .../sqlite-schema/insights_metadata.md | 107 + docs/generated/sqlite-schema/insights_raw.md | 62 + .../sqlite-schema/installed_nodes.md | 62 + .../sqlite-schema/installed_packages.md | 63 + .../sqlite-schema/instance_ai_checkpoints.md | 90 + .../instance_ai_iteration_logs.md | 68 + .../instance_ai_mcp_registry_connections.md | 104 + .../sqlite-schema/instance_ai_messages.md | 73 + .../instance_ai_observation_cursors.md | 65 + .../instance_ai_observation_locks.md | 69 + .../instance_ai_observational_memory.md | 121 + .../sqlite-schema/instance_ai_observations.md | 84 + .../instance_ai_pending_confirmations.md | 115 + .../sqlite-schema/instance_ai_resources.md | 54 + .../instance_ai_run_snapshots.md | 80 + .../sqlite-schema/instance_ai_threads.md | 205 + .../instance_ai_workflow_snapshots.md | 60 + .../sqlite-schema/instance_version_history.md | 47 + .../sqlite-schema/invalid_auth_token.md | 48 + .../sqlite-schema/mcp_registry_server.md | 69 + .../sqlite-schema/oauth_access_tokens.md | 82 + .../oauth_authorization_codes.md | 102 + docs/generated/sqlite-schema/oauth_clients.md | 101 + .../sqlite-schema/oauth_refresh_tokens.md | 90 + .../sqlite-schema/oauth_user_consents.md | 84 + .../generated/sqlite-schema/processed_data.md | 79 + docs/generated/sqlite-schema/project.md | 196 + .../sqlite-schema/project_relation.md | 102 + .../project_secrets_provider_access.md | 80 + docs/generated/sqlite-schema/role.md | 100 + .../sqlite-schema/role_mapping_rule.md | 77 + .../role_mapping_rule_project.md | 74 + docs/generated/sqlite-schema/role_scope.md | 74 + docs/generated/sqlite-schema/schema.json | 13523 +++++++++++ docs/generated/sqlite-schema/scope.md | 55 + .../secrets_provider_connection.md | 65 + docs/generated/sqlite-schema/settings.md | 50 + .../sqlite-schema/shared_credentials.md | 83 + .../sqlite-schema/shared_workflow.md | 93 + docs/generated/sqlite-schema/tag_entity.md | 63 + .../sqlite-schema/test_case_execution.md | 120 + docs/generated/sqlite-schema/test_run.md | 151 + .../sqlite-schema/token_exchange_jti.md | 50 + docs/generated/sqlite-schema/trusted_key.md | 65 + .../sqlite-schema/trusted_key_source.md | 67 + docs/generated/sqlite-schema/user.md | 297 + docs/generated/sqlite-schema/user_api_keys.md | 85 + .../generated/sqlite-schema/user_favorites.md | 73 + docs/generated/sqlite-schema/variables.md | 69 + .../generated/sqlite-schema/webhook_entity.md | 58 + .../sqlite-schema/workflow_builder_session.md | 107 + .../sqlite-schema/workflow_dependency.md | 88 + .../sqlite-schema/workflow_entity.md | 295 + .../sqlite-schema/workflow_history.md | 110 + .../workflow_publication_outbox.md | 58 + .../sqlite-schema/workflow_publish_history.md | 116 + .../workflow_published_version.md | 95 + .../sqlite-schema/workflow_statistics.md | 65 + .../generated/sqlite-schema/workflows_tags.md | 83 + package.json | 2 + packages/@n8n/db/package.json | 11 +- packages/@n8n/db/scripts/schema-docs.mjs | 247 + pnpm-lock.yaml | 3 + 228 files changed, 54899 insertions(+), 4 deletions(-) create mode 100644 .tbls.postgres.yml create mode 100644 .tbls.sqlite.yml create mode 100644 docs/db.md create mode 100644 docs/generated/postgres-schema/README.md create mode 100644 docs/generated/postgres-schema/public.agent_checkpoints.md create mode 100644 docs/generated/postgres-schema/public.agent_execution.md create mode 100644 docs/generated/postgres-schema/public.agent_execution_threads.md create mode 100644 docs/generated/postgres-schema/public.agent_files.md create mode 100644 docs/generated/postgres-schema/public.agent_history.md create mode 100644 docs/generated/postgres-schema/public.agent_task_definition.md create mode 100644 docs/generated/postgres-schema/public.agent_task_run_lock.md create mode 100644 docs/generated/postgres-schema/public.agent_task_snapshot.md create mode 100644 docs/generated/postgres-schema/public.agents.md create mode 100644 docs/generated/postgres-schema/public.agents_memory_entries.md create mode 100644 docs/generated/postgres-schema/public.agents_memory_entry_cursors.md create mode 100644 docs/generated/postgres-schema/public.agents_memory_entry_locks.md create mode 100644 docs/generated/postgres-schema/public.agents_memory_entry_sources.md create mode 100644 docs/generated/postgres-schema/public.agents_messages.md create mode 100644 docs/generated/postgres-schema/public.agents_observation_cursors.md create mode 100644 docs/generated/postgres-schema/public.agents_observation_locks.md create mode 100644 docs/generated/postgres-schema/public.agents_observations.md create mode 100644 docs/generated/postgres-schema/public.agents_resources.md create mode 100644 docs/generated/postgres-schema/public.agents_threads.md create mode 100644 docs/generated/postgres-schema/public.ai_builder_temporary_workflow.md create mode 100644 docs/generated/postgres-schema/public.annotation_tag_entity.md create mode 100644 docs/generated/postgres-schema/public.auth_identity.md create mode 100644 docs/generated/postgres-schema/public.auth_provider_sync_history.md create mode 100644 docs/generated/postgres-schema/public.binary_data.md create mode 100644 docs/generated/postgres-schema/public.chat_hub_agent_tools.md create mode 100644 docs/generated/postgres-schema/public.chat_hub_agents.md create mode 100644 docs/generated/postgres-schema/public.chat_hub_messages.md create mode 100644 docs/generated/postgres-schema/public.chat_hub_session_tools.md create mode 100644 docs/generated/postgres-schema/public.chat_hub_sessions.md create mode 100644 docs/generated/postgres-schema/public.chat_hub_tools.md create mode 100644 docs/generated/postgres-schema/public.credential_dependency.md create mode 100644 docs/generated/postgres-schema/public.credentials_entity.md create mode 100644 docs/generated/postgres-schema/public.data_table.md create mode 100644 docs/generated/postgres-schema/public.data_table_column.md create mode 100644 docs/generated/postgres-schema/public.deployment_key.md create mode 100644 docs/generated/postgres-schema/public.dynamic_credential_entry.md create mode 100644 docs/generated/postgres-schema/public.dynamic_credential_resolver.md create mode 100644 docs/generated/postgres-schema/public.dynamic_credential_user_entry.md create mode 100644 docs/generated/postgres-schema/public.evaluation_collection.md create mode 100644 docs/generated/postgres-schema/public.evaluation_config.md create mode 100644 docs/generated/postgres-schema/public.event_destinations.md create mode 100644 docs/generated/postgres-schema/public.execution_annotation_tags.md create mode 100644 docs/generated/postgres-schema/public.execution_annotations.md create mode 100644 docs/generated/postgres-schema/public.execution_data.md create mode 100644 docs/generated/postgres-schema/public.execution_entity.md create mode 100644 docs/generated/postgres-schema/public.execution_metadata.md create mode 100644 docs/generated/postgres-schema/public.folder.md create mode 100644 docs/generated/postgres-schema/public.folder_tag.md create mode 100644 docs/generated/postgres-schema/public.insights_by_period.md create mode 100644 docs/generated/postgres-schema/public.insights_metadata.md create mode 100644 docs/generated/postgres-schema/public.insights_raw.md create mode 100644 docs/generated/postgres-schema/public.installed_nodes.md create mode 100644 docs/generated/postgres-schema/public.installed_packages.md create mode 100644 docs/generated/postgres-schema/public.instance_ai_checkpoints.md create mode 100644 docs/generated/postgres-schema/public.instance_ai_iteration_logs.md create mode 100644 docs/generated/postgres-schema/public.instance_ai_mcp_registry_connections.md create mode 100644 docs/generated/postgres-schema/public.instance_ai_messages.md create mode 100644 docs/generated/postgres-schema/public.instance_ai_observation_cursors.md create mode 100644 docs/generated/postgres-schema/public.instance_ai_observation_locks.md create mode 100644 docs/generated/postgres-schema/public.instance_ai_observational_memory.md create mode 100644 docs/generated/postgres-schema/public.instance_ai_observations.md create mode 100644 docs/generated/postgres-schema/public.instance_ai_pending_confirmations.md create mode 100644 docs/generated/postgres-schema/public.instance_ai_resources.md create mode 100644 docs/generated/postgres-schema/public.instance_ai_run_snapshots.md create mode 100644 docs/generated/postgres-schema/public.instance_ai_threads.md create mode 100644 docs/generated/postgres-schema/public.instance_ai_workflow_snapshots.md create mode 100644 docs/generated/postgres-schema/public.instance_version_history.md create mode 100644 docs/generated/postgres-schema/public.invalid_auth_token.md create mode 100644 docs/generated/postgres-schema/public.mcp_registry_server.md create mode 100644 docs/generated/postgres-schema/public.oauth_access_tokens.md create mode 100644 docs/generated/postgres-schema/public.oauth_authorization_codes.md create mode 100644 docs/generated/postgres-schema/public.oauth_clients.md create mode 100644 docs/generated/postgres-schema/public.oauth_refresh_tokens.md create mode 100644 docs/generated/postgres-schema/public.oauth_user_consents.md create mode 100644 docs/generated/postgres-schema/public.processed_data.md create mode 100644 docs/generated/postgres-schema/public.project.md create mode 100644 docs/generated/postgres-schema/public.project_relation.md create mode 100644 docs/generated/postgres-schema/public.project_secrets_provider_access.md create mode 100644 docs/generated/postgres-schema/public.role.md create mode 100644 docs/generated/postgres-schema/public.role_mapping_rule.md create mode 100644 docs/generated/postgres-schema/public.role_mapping_rule_project.md create mode 100644 docs/generated/postgres-schema/public.role_scope.md create mode 100644 docs/generated/postgres-schema/public.scope.md create mode 100644 docs/generated/postgres-schema/public.secrets_provider_connection.md create mode 100644 docs/generated/postgres-schema/public.settings.md create mode 100644 docs/generated/postgres-schema/public.shared_credentials.md create mode 100644 docs/generated/postgres-schema/public.shared_workflow.md create mode 100644 docs/generated/postgres-schema/public.tag_entity.md create mode 100644 docs/generated/postgres-schema/public.test_case_execution.md create mode 100644 docs/generated/postgres-schema/public.test_run.md create mode 100644 docs/generated/postgres-schema/public.token_exchange_jti.md create mode 100644 docs/generated/postgres-schema/public.trusted_key.md create mode 100644 docs/generated/postgres-schema/public.trusted_key_source.md create mode 100644 docs/generated/postgres-schema/public.user.md create mode 100644 docs/generated/postgres-schema/public.user_api_keys.md create mode 100644 docs/generated/postgres-schema/public.user_favorites.md create mode 100644 docs/generated/postgres-schema/public.variables.md create mode 100644 docs/generated/postgres-schema/public.webhook_entity.md create mode 100644 docs/generated/postgres-schema/public.workflow_builder_session.md create mode 100644 docs/generated/postgres-schema/public.workflow_dependency.md create mode 100644 docs/generated/postgres-schema/public.workflow_entity.md create mode 100644 docs/generated/postgres-schema/public.workflow_history.md create mode 100644 docs/generated/postgres-schema/public.workflow_publication_outbox.md create mode 100644 docs/generated/postgres-schema/public.workflow_publish_history.md create mode 100644 docs/generated/postgres-schema/public.workflow_published_version.md create mode 100644 docs/generated/postgres-schema/public.workflow_statistics.md create mode 100644 docs/generated/postgres-schema/public.workflows_tags.md create mode 100644 docs/generated/postgres-schema/schema.json create mode 100644 docs/generated/sqlite-schema/README.md create mode 100644 docs/generated/sqlite-schema/agent_checkpoints.md create mode 100644 docs/generated/sqlite-schema/agent_execution.md create mode 100644 docs/generated/sqlite-schema/agent_execution_threads.md create mode 100644 docs/generated/sqlite-schema/agent_files.md create mode 100644 docs/generated/sqlite-schema/agent_history.md create mode 100644 docs/generated/sqlite-schema/agent_task_definition.md create mode 100644 docs/generated/sqlite-schema/agent_task_run_lock.md create mode 100644 docs/generated/sqlite-schema/agent_task_snapshot.md create mode 100644 docs/generated/sqlite-schema/agents.md create mode 100644 docs/generated/sqlite-schema/agents_memory_entries.md create mode 100644 docs/generated/sqlite-schema/agents_memory_entry_cursors.md create mode 100644 docs/generated/sqlite-schema/agents_memory_entry_locks.md create mode 100644 docs/generated/sqlite-schema/agents_memory_entry_sources.md create mode 100644 docs/generated/sqlite-schema/agents_messages.md create mode 100644 docs/generated/sqlite-schema/agents_observation_cursors.md create mode 100644 docs/generated/sqlite-schema/agents_observation_locks.md create mode 100644 docs/generated/sqlite-schema/agents_observations.md create mode 100644 docs/generated/sqlite-schema/agents_resources.md create mode 100644 docs/generated/sqlite-schema/agents_threads.md create mode 100644 docs/generated/sqlite-schema/ai_builder_temporary_workflow.md create mode 100644 docs/generated/sqlite-schema/annotation_tag_entity.md create mode 100644 docs/generated/sqlite-schema/auth_identity.md create mode 100644 docs/generated/sqlite-schema/auth_provider_sync_history.md create mode 100644 docs/generated/sqlite-schema/binary_data.md create mode 100644 docs/generated/sqlite-schema/chat_hub_agent_tools.md create mode 100644 docs/generated/sqlite-schema/chat_hub_agents.md create mode 100644 docs/generated/sqlite-schema/chat_hub_messages.md create mode 100644 docs/generated/sqlite-schema/chat_hub_session_tools.md create mode 100644 docs/generated/sqlite-schema/chat_hub_sessions.md create mode 100644 docs/generated/sqlite-schema/chat_hub_tools.md create mode 100644 docs/generated/sqlite-schema/credential_dependency.md create mode 100644 docs/generated/sqlite-schema/credentials_entity.md create mode 100644 docs/generated/sqlite-schema/data_table.md create mode 100644 docs/generated/sqlite-schema/data_table_column.md create mode 100644 docs/generated/sqlite-schema/deployment_key.md create mode 100644 docs/generated/sqlite-schema/dynamic_credential_entry.md create mode 100644 docs/generated/sqlite-schema/dynamic_credential_resolver.md create mode 100644 docs/generated/sqlite-schema/dynamic_credential_user_entry.md create mode 100644 docs/generated/sqlite-schema/evaluation_collection.md create mode 100644 docs/generated/sqlite-schema/evaluation_config.md create mode 100644 docs/generated/sqlite-schema/event_destinations.md create mode 100644 docs/generated/sqlite-schema/execution_annotation_tags.md create mode 100644 docs/generated/sqlite-schema/execution_annotations.md create mode 100644 docs/generated/sqlite-schema/execution_data.md create mode 100644 docs/generated/sqlite-schema/execution_entity.md create mode 100644 docs/generated/sqlite-schema/execution_metadata.md create mode 100644 docs/generated/sqlite-schema/folder.md create mode 100644 docs/generated/sqlite-schema/folder_tag.md create mode 100644 docs/generated/sqlite-schema/insights_by_period.md create mode 100644 docs/generated/sqlite-schema/insights_metadata.md create mode 100644 docs/generated/sqlite-schema/insights_raw.md create mode 100644 docs/generated/sqlite-schema/installed_nodes.md create mode 100644 docs/generated/sqlite-schema/installed_packages.md create mode 100644 docs/generated/sqlite-schema/instance_ai_checkpoints.md create mode 100644 docs/generated/sqlite-schema/instance_ai_iteration_logs.md create mode 100644 docs/generated/sqlite-schema/instance_ai_mcp_registry_connections.md create mode 100644 docs/generated/sqlite-schema/instance_ai_messages.md create mode 100644 docs/generated/sqlite-schema/instance_ai_observation_cursors.md create mode 100644 docs/generated/sqlite-schema/instance_ai_observation_locks.md create mode 100644 docs/generated/sqlite-schema/instance_ai_observational_memory.md create mode 100644 docs/generated/sqlite-schema/instance_ai_observations.md create mode 100644 docs/generated/sqlite-schema/instance_ai_pending_confirmations.md create mode 100644 docs/generated/sqlite-schema/instance_ai_resources.md create mode 100644 docs/generated/sqlite-schema/instance_ai_run_snapshots.md create mode 100644 docs/generated/sqlite-schema/instance_ai_threads.md create mode 100644 docs/generated/sqlite-schema/instance_ai_workflow_snapshots.md create mode 100644 docs/generated/sqlite-schema/instance_version_history.md create mode 100644 docs/generated/sqlite-schema/invalid_auth_token.md create mode 100644 docs/generated/sqlite-schema/mcp_registry_server.md create mode 100644 docs/generated/sqlite-schema/oauth_access_tokens.md create mode 100644 docs/generated/sqlite-schema/oauth_authorization_codes.md create mode 100644 docs/generated/sqlite-schema/oauth_clients.md create mode 100644 docs/generated/sqlite-schema/oauth_refresh_tokens.md create mode 100644 docs/generated/sqlite-schema/oauth_user_consents.md create mode 100644 docs/generated/sqlite-schema/processed_data.md create mode 100644 docs/generated/sqlite-schema/project.md create mode 100644 docs/generated/sqlite-schema/project_relation.md create mode 100644 docs/generated/sqlite-schema/project_secrets_provider_access.md create mode 100644 docs/generated/sqlite-schema/role.md create mode 100644 docs/generated/sqlite-schema/role_mapping_rule.md create mode 100644 docs/generated/sqlite-schema/role_mapping_rule_project.md create mode 100644 docs/generated/sqlite-schema/role_scope.md create mode 100644 docs/generated/sqlite-schema/schema.json create mode 100644 docs/generated/sqlite-schema/scope.md create mode 100644 docs/generated/sqlite-schema/secrets_provider_connection.md create mode 100644 docs/generated/sqlite-schema/settings.md create mode 100644 docs/generated/sqlite-schema/shared_credentials.md create mode 100644 docs/generated/sqlite-schema/shared_workflow.md create mode 100644 docs/generated/sqlite-schema/tag_entity.md create mode 100644 docs/generated/sqlite-schema/test_case_execution.md create mode 100644 docs/generated/sqlite-schema/test_run.md create mode 100644 docs/generated/sqlite-schema/token_exchange_jti.md create mode 100644 docs/generated/sqlite-schema/trusted_key.md create mode 100644 docs/generated/sqlite-schema/trusted_key_source.md create mode 100644 docs/generated/sqlite-schema/user.md create mode 100644 docs/generated/sqlite-schema/user_api_keys.md create mode 100644 docs/generated/sqlite-schema/user_favorites.md create mode 100644 docs/generated/sqlite-schema/variables.md create mode 100644 docs/generated/sqlite-schema/webhook_entity.md create mode 100644 docs/generated/sqlite-schema/workflow_builder_session.md create mode 100644 docs/generated/sqlite-schema/workflow_dependency.md create mode 100644 docs/generated/sqlite-schema/workflow_entity.md create mode 100644 docs/generated/sqlite-schema/workflow_history.md create mode 100644 docs/generated/sqlite-schema/workflow_publication_outbox.md create mode 100644 docs/generated/sqlite-schema/workflow_publish_history.md create mode 100644 docs/generated/sqlite-schema/workflow_published_version.md create mode 100644 docs/generated/sqlite-schema/workflow_statistics.md create mode 100644 docs/generated/sqlite-schema/workflows_tags.md create mode 100644 packages/@n8n/db/scripts/schema-docs.mjs diff --git a/.claude/plugins/n8n/skills/db-migrations/SKILL.md b/.claude/plugins/n8n/skills/db-migrations/SKILL.md index 0e01653c366..dac121ff9ad 100644 --- a/.claude/plugins/n8n/skills/db-migrations/SKILL.md +++ b/.claude/plugins/n8n/skills/db-migrations/SKILL.md @@ -19,7 +19,7 @@ description: Authors n8n database migrations. Use when creating or modifying fil - [Cross-database Compatibility](#cross-database-compatibility) - [Tests](#tests) - [General Design Guidance](#general-design-guidance) -- [After authoring](#after-authoring) +- [Schema documentation](#schema-documentation) --- @@ -123,6 +123,7 @@ Run through this before requesting review. Each item is a real, recurring review - [ ] **One logical change per migration**; split unrelated table changes into separate files. — [Don't combine independent schema changes](#dont-combine-independent-schema-changes) - [ ] **`up()` / `down()` reads as a list of intentions.** If either body grows past a screen or mixes schema operations with a multi-statement raw-SQL data move, extract the data move into a `private async` method on the same class (e.g. `private async backfillFromX(ctx)`). The top-level should orchestrate, not implement. - [ ] **Precedent is the bar to fix, not perpetuate.** When the checklist conflicts with what an older migration does (e.g. redundant `.primary.notNull`, hand-quoted identifiers, missing `.comment()`), the checklist wins for new code — don't copy the violation forward. Note the old occurrences in the PR if you spotted them. +- [ ] **Regenerated the schema docs** with `pnpm db:schema:docs` and committed the `docs/generated/` changes. The `schema-docs-check` CI job fails on stale docs. — [Schema documentation](#schema-documentation) Treat the checklist as a floor, not a ceiling. If any item fails, fix it before opening review. @@ -779,4 +780,18 @@ A "polymorphic" column pair is one column that points at different tables depend - **Separate join tables per relation type** (`credential_external_secret_dependency`, `credential_node_dependency`, …). Each has a real FK. Queries that need "all dependencies" become a UNION. - **One nullable FK per possible target** with a CHECK constraint that exactly one is set. Each column is a real FK. - **Supertype table**: hoist parents into a single `dependency_target` with its own type column, then have one FK to that table. -- + +--- + +## Schema documentation + +The database schema is documented under `docs/generated/` — `docs/generated/sqlite-schema/` and `docs/generated/postgres-schema/`, one Markdown page per table plus a Mermaid ER diagram. These are **auto-generated from the migrations** with [tbls](https://github.com/k1LoW/tbls) (it runs every migration against a throwaway database and introspects the result), so any schema-changing migration makes them stale. + +Regenerate and commit them alongside your migration: + +```sh +pnpm db:schema:docs # rewrites docs/generated/ — requires Docker (and `brew install tbls` locally) +pnpm db:schema:check # verify only; what the schema-docs-check CI job runs +``` + +The `schema-docs-check` CI job fails the PR when the committed docs don't match the migrations. Don't hand-edit anything under `docs/generated/` — it's overwritten on every regeneration. diff --git a/.github/workflows/ci-pull-requests.yml b/.github/workflows/ci-pull-requests.yml index 87fd921e961..a2c1c96085b 100644 --- a/.github/workflows/ci-pull-requests.yml +++ b/.github/workflows/ci-pull-requests.yml @@ -133,6 +133,9 @@ jobs: packages/cli/**/__tests__/** packages/testing/containers/services/postgres.ts .github/workflows/test-db-reusable.yml + docs/generated/** + .tbls.sqlite.yml + .tbls.postgres.yml - name: Setup and Build if: fromJSON(steps.ci-filter.outputs.results).ci || fromJSON(steps.ci-filter.outputs.results).e2e @@ -304,6 +307,26 @@ jobs: with: ref: ${{ needs.install-and-build.outputs.commit_sha }} + schema-docs-check: + name: DB Schema Docs Check + if: needs.install-and-build.outputs.db == 'true' + runs-on: ${{ vars.RUNNER_PROVIDER == 'github' && 'ubuntu-latest' || 'blacksmith-4vcpu-ubuntu-2204' }} + needs: install-and-build + steps: + - uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1 + with: + ref: ${{ needs.install-and-build.outputs.commit_sha }} + + - name: Setup Node.js + uses: ./.github/actions/setup-nodejs + with: + build-command: pnpm turbo run build --filter=@n8n/db + + # Regenerates the schema docs (sqlite + postgres-in-a-container) and fails + # if they differ from what's committed. tbls runs as a Docker image in CI. + - name: Verify schema docs are up to date + run: pnpm --filter=@n8n/db schema:check + performance: name: Performance needs: install-and-build @@ -378,6 +401,7 @@ jobs: e2e, dev-server-smoke, db-tests, + schema-docs-check, performance, security-checks, workflow-scripts, diff --git a/.gitignore b/.gitignore index 3ac82617071..be6cec7fdff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ node_modules .DS_Store .tmp +.tmp-schema-docs tmp dist coverage diff --git a/.tbls.postgres.yml b/.tbls.postgres.yml new file mode 100644 index 00000000000..be771c158f2 --- /dev/null +++ b/.tbls.postgres.yml @@ -0,0 +1,16 @@ +# Auto-generated DB schema docs config (PostgreSQL). See docs/db.md. +# Generated by `pnpm db:schema:docs`; do not point this at a real database. +name: n8n database schema (PostgreSQL) +desc: Auto-generated from the PostgreSQL migrations in @n8n/db. Do not edit by hand. +dsn: ${TBLS_DSN} +docPath: docs/generated/postgres-schema + +er: + format: mermaid + +format: + sortTablesByName: true + +# The migrations bookkeeping table is operational noise, not part of the schema. +exclude: + - migrations diff --git a/.tbls.sqlite.yml b/.tbls.sqlite.yml new file mode 100644 index 00000000000..b5d764905eb --- /dev/null +++ b/.tbls.sqlite.yml @@ -0,0 +1,16 @@ +# Auto-generated DB schema docs config (SQLite). See docs/db.md. +# Generated by `pnpm db:schema:docs`; do not point this at a real database. +name: n8n database schema (SQLite) +desc: Auto-generated from the SQLite migrations in @n8n/db. Do not edit by hand. +dsn: ${TBLS_DSN} +docPath: docs/generated/sqlite-schema + +er: + format: mermaid + +format: + sortTablesByName: true + +# The migrations bookkeeping table is operational noise, not part of the schema. +exclude: + - migrations diff --git a/docs/db.md b/docs/db.md new file mode 100644 index 00000000000..5dd4eeab09c --- /dev/null +++ b/docs/db.md @@ -0,0 +1,37 @@ +# Database + +n8n persists its state in a relational database, accessed through TypeORM. The +schema supports both SQLite (the default) and PostgreSQL, and is defined by the +**migrations** in `@n8n/db` rather than the entities (entities run with +`synchronize: false`). + +## Schema reference + +Auto-generated documentation of the schema, one set per supported database: + +- [SQLite](./generated/sqlite-schema/README.md) +- [PostgreSQL](./generated/postgres-schema/README.md) + +Each set lists every table with its columns, types, defaults, indexes, and +foreign keys, plus a Mermaid ER diagram of the relationships. The two differ +where the column types do (e.g. `datetime` vs `timestamptz`, `text`/`simple-json` +vs `json`/`jsonb`, `boolean` representation). + +### How it's generated + +The generator spins up an empty database, runs the full `@n8n/db` migration set +against it, and points [tbls](https://github.com/k1LoW/tbls) at the result. +SQLite uses a throwaway file; PostgreSQL uses a throwaway testcontainer, so +**Docker is required**. + +```bash +# Regenerate both (requires Docker; tbls locally via `brew install tbls`) +pnpm db:schema:docs + +# Verify the committed docs match the current migrations +pnpm db:schema:check +``` + +The schema reference is **auto-generated — do not edit by hand.** CI fails when +a migration changes the schema but the docs weren't regenerated; when that +happens, run `pnpm db:schema:docs` and commit the result. diff --git a/docs/generated/postgres-schema/README.md b/docs/generated/postgres-schema/README.md new file mode 100644 index 00000000000..03e4520648f --- /dev/null +++ b/docs/generated/postgres-schema/README.md @@ -0,0 +1,1309 @@ +# n8n database schema (PostgreSQL) + +## Description + +Auto-generated from the PostgreSQL migrations in @n8n/db. Do not edit by hand. + +## Tables + +| Name | Columns | Comment | Type | +| ---- | ------- | ------- | ---- | +| [public.credentials_entity](public.credentials_entity.md) | 11 | | BASE TABLE | +| [public.execution_entity](public.execution_entity.md) | 15 | | BASE TABLE | +| [public.workflow_entity](public.workflow_entity.md) | 20 | | BASE TABLE | +| [public.webhook_entity](public.webhook_entity.md) | 6 | | BASE TABLE | +| [public.tag_entity](public.tag_entity.md) | 4 | | BASE TABLE | +| [public.workflows_tags](public.workflows_tags.md) | 2 | | BASE TABLE | +| [public.user](public.user.md) | 15 | | BASE TABLE | +| [public.settings](public.settings.md) | 3 | | BASE TABLE | +| [public.installed_packages](public.installed_packages.md) | 6 | | BASE TABLE | +| [public.installed_nodes](public.installed_nodes.md) | 4 | | BASE TABLE | +| [public.workflow_statistics](public.workflow_statistics.md) | 7 | | BASE TABLE | +| [public.event_destinations](public.event_destinations.md) | 4 | | BASE TABLE | +| [public.auth_identity](public.auth_identity.md) | 5 | | BASE TABLE | +| [public.auth_provider_sync_history](public.auth_provider_sync_history.md) | 11 | | BASE TABLE | +| [public.variables](public.variables.md) | 5 | | BASE TABLE | +| [public.execution_data](public.execution_data.md) | 4 | | BASE TABLE | +| [public.workflow_history](public.workflow_history.md) | 11 | | BASE TABLE | +| [public.project](public.project.md) | 9 | | BASE TABLE | +| [public.project_relation](public.project_relation.md) | 5 | | BASE TABLE | +| [public.shared_credentials](public.shared_credentials.md) | 5 | | BASE TABLE | +| [public.shared_workflow](public.shared_workflow.md) | 5 | | BASE TABLE | +| [public.execution_metadata](public.execution_metadata.md) | 4 | | BASE TABLE | +| [public.invalid_auth_token](public.invalid_auth_token.md) | 2 | | BASE TABLE | +| [public.execution_annotations](public.execution_annotations.md) | 6 | | BASE TABLE | +| [public.annotation_tag_entity](public.annotation_tag_entity.md) | 4 | | BASE TABLE | +| [public.execution_annotation_tags](public.execution_annotation_tags.md) | 2 | | BASE TABLE | +| [public.user_api_keys](public.user_api_keys.md) | 9 | | BASE TABLE | +| [public.processed_data](public.processed_data.md) | 5 | | BASE TABLE | +| [public.folder](public.folder.md) | 6 | | BASE TABLE | +| [public.folder_tag](public.folder_tag.md) | 2 | | BASE TABLE | +| [public.insights_metadata](public.insights_metadata.md) | 5 | | BASE TABLE | +| [public.insights_raw](public.insights_raw.md) | 5 | | BASE TABLE | +| [public.insights_by_period](public.insights_by_period.md) | 6 | | BASE TABLE | +| [public.test_run](public.test_run.md) | 16 | | BASE TABLE | +| [public.test_case_execution](public.test_case_execution.md) | 14 | | BASE TABLE | +| [public.scope](public.scope.md) | 3 | | BASE TABLE | +| [public.role](public.role.md) | 7 | | BASE TABLE | +| [public.role_scope](public.role_scope.md) | 2 | | BASE TABLE | +| [public.data_table](public.data_table.md) | 5 | | BASE TABLE | +| [public.data_table_column](public.data_table_column.md) | 7 | | BASE TABLE | +| [public.chat_hub_sessions](public.chat_hub_sessions.md) | 13 | | BASE TABLE | +| [public.chat_hub_messages](public.chat_hub_messages.md) | 17 | | BASE TABLE | +| [public.chat_hub_agents](public.chat_hub_agents.md) | 13 | | BASE TABLE | +| [public.oauth_clients](public.oauth_clients.md) | 9 | | BASE TABLE | +| [public.oauth_authorization_codes](public.oauth_authorization_codes.md) | 13 | | BASE TABLE | +| [public.oauth_access_tokens](public.oauth_access_tokens.md) | 3 | | BASE TABLE | +| [public.oauth_refresh_tokens](public.oauth_refresh_tokens.md) | 7 | | BASE TABLE | +| [public.oauth_user_consents](public.oauth_user_consents.md) | 4 | | BASE TABLE | +| [public.workflow_dependency](public.workflow_dependency.md) | 9 | | BASE TABLE | +| [public.binary_data](public.binary_data.md) | 9 | | BASE TABLE | +| [public.workflow_publish_history](public.workflow_publish_history.md) | 6 | | BASE TABLE | +| [public.dynamic_credential_resolver](public.dynamic_credential_resolver.md) | 6 | | BASE TABLE | +| [public.dynamic_credential_user_entry](public.dynamic_credential_user_entry.md) | 6 | | BASE TABLE | +| [public.secrets_provider_connection](public.secrets_provider_connection.md) | 7 | | BASE TABLE | +| [public.project_secrets_provider_access](public.project_secrets_provider_access.md) | 5 | | BASE TABLE | +| [public.workflow_published_version](public.workflow_published_version.md) | 4 | | BASE TABLE | +| [public.dynamic_credential_entry](public.dynamic_credential_entry.md) | 6 | | BASE TABLE | +| [public.chat_hub_tools](public.chat_hub_tools.md) | 9 | | BASE TABLE | +| [public.chat_hub_session_tools](public.chat_hub_session_tools.md) | 2 | | BASE TABLE | +| [public.chat_hub_agent_tools](public.chat_hub_agent_tools.md) | 2 | | BASE TABLE | +| [public.workflow_builder_session](public.workflow_builder_session.md) | 9 | | BASE TABLE | +| [public.role_mapping_rule](public.role_mapping_rule.md) | 7 | | BASE TABLE | +| [public.role_mapping_rule_project](public.role_mapping_rule_project.md) | 2 | | BASE TABLE | +| [public.credential_dependency](public.credential_dependency.md) | 5 | | BASE TABLE | +| [public.instance_version_history](public.instance_version_history.md) | 5 | | BASE TABLE | +| [public.instance_ai_threads](public.instance_ai_threads.md) | 7 | | BASE TABLE | +| [public.instance_ai_messages](public.instance_ai_messages.md) | 8 | | BASE TABLE | +| [public.instance_ai_resources](public.instance_ai_resources.md) | 5 | | BASE TABLE | +| [public.instance_ai_observational_memory](public.instance_ai_observational_memory.md) | 32 | | BASE TABLE | +| [public.instance_ai_workflow_snapshots](public.instance_ai_workflow_snapshots.md) | 7 | | BASE TABLE | +| [public.instance_ai_run_snapshots](public.instance_ai_run_snapshots.md) | 11 | | BASE TABLE | +| [public.instance_ai_iteration_logs](public.instance_ai_iteration_logs.md) | 6 | | BASE TABLE | +| [public.token_exchange_jti](public.token_exchange_jti.md) | 3 | | BASE TABLE | +| [public.trusted_key_source](public.trusted_key_source.md) | 8 | | BASE TABLE | +| [public.trusted_key](public.trusted_key.md) | 4 | | BASE TABLE | +| [public.user_favorites](public.user_favorites.md) | 4 | | BASE TABLE | +| [public.deployment_key](public.deployment_key.md) | 7 | | BASE TABLE | +| [public.ai_builder_temporary_workflow](public.ai_builder_temporary_workflow.md) | 4 | | BASE TABLE | +| [public.evaluation_config](public.evaluation_config.md) | 12 | | BASE TABLE | +| [public.evaluation_collection](public.evaluation_collection.md) | 9 | | BASE TABLE | +| [public.agents](public.agents.md) | 12 | | BASE TABLE | +| [public.agent_checkpoints](public.agent_checkpoints.md) | 6 | | BASE TABLE | +| [public.agents_resources](public.agents_resources.md) | 4 | | BASE TABLE | +| [public.agents_threads](public.agents_threads.md) | 6 | | BASE TABLE | +| [public.agents_messages](public.agents_messages.md) | 8 | | BASE TABLE | +| [public.agent_execution_threads](public.agent_execution_threads.md) | 17 | | BASE TABLE | +| [public.agent_execution](public.agent_execution.md) | 20 | | BASE TABLE | +| [public.instance_ai_checkpoints](public.instance_ai_checkpoints.md) | 8 | | BASE TABLE | +| [public.agents_observations](public.agents_observations.md) | 11 | | BASE TABLE | +| [public.agents_observation_cursors](public.agents_observation_cursors.md) | 6 | | BASE TABLE | +| [public.agents_observation_locks](public.agents_observation_locks.md) | 7 | | BASE TABLE | +| [public.agents_memory_entries](public.agents_memory_entries.md) | 13 | | BASE TABLE | +| [public.agents_memory_entry_locks](public.agents_memory_entry_locks.md) | 6 | | BASE TABLE | +| [public.agents_memory_entry_sources](public.agents_memory_entry_sources.md) | 9 | | BASE TABLE | +| [public.agents_memory_entry_cursors](public.agents_memory_entry_cursors.md) | 6 | | BASE TABLE | +| [public.agent_history](public.agent_history.md) | 9 | | BASE TABLE | +| [public.instance_ai_observations](public.instance_ai_observations.md) | 10 | | BASE TABLE | +| [public.instance_ai_observation_cursors](public.instance_ai_observation_cursors.md) | 5 | | BASE TABLE | +| [public.instance_ai_observation_locks](public.instance_ai_observation_locks.md) | 6 | | BASE TABLE | +| [public.instance_ai_pending_confirmations](public.instance_ai_pending_confirmations.md) | 12 | | BASE TABLE | +| [public.mcp_registry_server](public.mcp_registry_server.md) | 7 | | BASE TABLE | +| [public.agent_files](public.agent_files.md) | 8 | | BASE TABLE | +| [public.agent_task_definition](public.agent_task_definition.md) | 7 | | BASE TABLE | +| [public.agent_task_snapshot](public.agent_task_snapshot.md) | 8 | | BASE TABLE | +| [public.agent_task_run_lock](public.agent_task_run_lock.md) | 6 | | BASE TABLE | +| [public.instance_ai_mcp_registry_connections](public.instance_ai_mcp_registry_connections.md) | 7 | | BASE TABLE | +| [public.workflow_publication_outbox](public.workflow_publication_outbox.md) | 7 | | BASE TABLE | + +## Stored procedures and functions + +| Name | ReturnType | Arguments | Type | +| ---- | ------- | ------- | ---- | +| public.uuid_nil | uuid | | FUNCTION | +| public.uuid_ns_dns | uuid | | FUNCTION | +| public.uuid_ns_url | uuid | | FUNCTION | +| public.uuid_ns_oid | uuid | | FUNCTION | +| public.uuid_ns_x500 | uuid | | FUNCTION | +| public.uuid_generate_v1 | uuid | | FUNCTION | +| public.uuid_generate_v1mc | uuid | | FUNCTION | +| public.uuid_generate_v3 | uuid | namespace uuid, name text | FUNCTION | +| public.uuid_generate_v4 | uuid | | FUNCTION | +| public.uuid_generate_v5 | uuid | namespace uuid, name text | FUNCTION | +| public.increment_workflow_version | trigger | | FUNCTION | + +## Relations + +```mermaid +erDiagram + +"public.credentials_entity" }o--o| "public.dynamic_credential_resolver" : "FOREIGN KEY (#quot;resolverId#quot;) REFERENCES dynamic_credential_resolver(id) ON DELETE SET NULL" +"public.execution_entity" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.workflow_entity" }o--o| "public.workflow_history" : "FOREIGN KEY (#quot;activeVersionId#quot;) REFERENCES workflow_history(#quot;versionId#quot;) ON DELETE RESTRICT" +"public.workflow_entity" }o--o| "public.folder" : "FOREIGN KEY (#quot;parentFolderId#quot;) REFERENCES folder(id) ON DELETE CASCADE" +"public.webhook_entity" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.workflows_tags" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.workflows_tags" }o--|| "public.tag_entity" : "FOREIGN KEY (#quot;tagId#quot;) REFERENCES tag_entity(id) ON DELETE CASCADE" +"public.user" }o--|| "public.role" : "FOREIGN KEY (#quot;roleSlug#quot;) REFERENCES role(slug)" +"public.installed_nodes" }o--|| "public.installed_packages" : "FOREIGN KEY (package) REFERENCES installed_packages(#quot;packageName#quot;) ON UPDATE CASCADE ON DELETE CASCADE" +"public.auth_identity" }o--o| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id)" +"public.variables" }o--o| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.execution_data" |o--|| "public.execution_entity" : "FOREIGN KEY (#quot;executionId#quot;) REFERENCES execution_entity(id) ON DELETE CASCADE" +"public.workflow_history" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.project" }o--o| "public.user" : "FOREIGN KEY (#quot;creatorId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE SET NULL" +"public.project_relation" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.project_relation" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.project_relation" }o--|| "public.role" : "FOREIGN KEY (role) REFERENCES role(slug)" +"public.shared_credentials" }o--|| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialsId#quot;) REFERENCES credentials_entity(id) ON DELETE CASCADE" +"public.shared_credentials" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.shared_workflow" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.shared_workflow" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.execution_metadata" }o--|| "public.execution_entity" : "FOREIGN KEY (#quot;executionId#quot;) REFERENCES execution_entity(id) ON DELETE CASCADE" +"public.execution_annotations" }o--|| "public.execution_entity" : "FOREIGN KEY (#quot;executionId#quot;) REFERENCES execution_entity(id) ON DELETE CASCADE" +"public.execution_annotation_tags" }o--|| "public.execution_annotations" : "FOREIGN KEY (#quot;annotationId#quot;) REFERENCES execution_annotations(id) ON DELETE CASCADE" +"public.execution_annotation_tags" }o--|| "public.annotation_tag_entity" : "FOREIGN KEY (#quot;tagId#quot;) REFERENCES annotation_tag_entity(id) ON DELETE CASCADE" +"public.user_api_keys" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.processed_data" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.folder" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.folder" }o--o| "public.folder" : "FOREIGN KEY (#quot;parentFolderId#quot;) REFERENCES folder(id) ON DELETE CASCADE" +"public.folder_tag" }o--|| "public.tag_entity" : "FOREIGN KEY (#quot;tagId#quot;) REFERENCES tag_entity(id) ON DELETE CASCADE" +"public.folder_tag" }o--|| "public.folder" : "FOREIGN KEY (#quot;folderId#quot;) REFERENCES folder(id) ON DELETE CASCADE" +"public.insights_metadata" }o--o| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE SET NULL" +"public.insights_metadata" }o--o| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE SET NULL" +"public.insights_raw" }o--|| "public.insights_metadata" : "FOREIGN KEY (#quot;metaId#quot;) REFERENCES insights_metadata(#quot;metaId#quot;) ON DELETE CASCADE" +"public.insights_by_period" }o--|| "public.insights_metadata" : "FOREIGN KEY (#quot;metaId#quot;) REFERENCES insights_metadata(#quot;metaId#quot;) ON DELETE CASCADE" +"public.test_run" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.test_run" }o--o| "public.evaluation_config" : "FOREIGN KEY (#quot;evaluationConfigId#quot;) REFERENCES evaluation_config(id) ON DELETE SET NULL" +"public.test_run" }o--o| "public.evaluation_collection" : "FOREIGN KEY (#quot;collectionId#quot;) REFERENCES evaluation_collection(id) ON DELETE SET NULL" +"public.test_case_execution" }o--o| "public.execution_entity" : "FOREIGN KEY (#quot;executionId#quot;) REFERENCES execution_entity(id) ON DELETE SET NULL" +"public.test_case_execution" }o--|| "public.test_run" : "FOREIGN KEY (#quot;testRunId#quot;) REFERENCES test_run(id) ON DELETE CASCADE" +"public.role_scope" }o--|| "public.scope" : "FOREIGN KEY (#quot;scopeSlug#quot;) REFERENCES scope(slug) ON UPDATE CASCADE ON DELETE CASCADE" +"public.role_scope" }o--|| "public.role" : "FOREIGN KEY (#quot;roleSlug#quot;) REFERENCES role(slug) ON UPDATE CASCADE ON DELETE CASCADE" +"public.data_table" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.data_table_column" }o--|| "public.data_table" : "FOREIGN KEY (#quot;dataTableId#quot;) REFERENCES data_table(id) ON DELETE CASCADE" +"public.chat_hub_sessions" }o--|| "public.user" : "FOREIGN KEY (#quot;ownerId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.chat_hub_sessions" }o--o| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE SET NULL" +"public.chat_hub_sessions" }o--o| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE SET NULL" +"public.chat_hub_sessions" }o--o| "public.chat_hub_agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES chat_hub_agents(id) ON DELETE SET NULL" +"public.chat_hub_messages" }o--o| "public.execution_entity" : "FOREIGN KEY (#quot;executionId#quot;) REFERENCES execution_entity(id) ON DELETE SET NULL" +"public.chat_hub_messages" }o--o| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE SET NULL" +"public.chat_hub_messages" }o--|| "public.chat_hub_sessions" : "FOREIGN KEY (#quot;sessionId#quot;) REFERENCES chat_hub_sessions(id) ON DELETE CASCADE" +"public.chat_hub_messages" }o--o| "public.chat_hub_messages" : "FOREIGN KEY (#quot;revisionOfMessageId#quot;) REFERENCES chat_hub_messages(id) ON DELETE CASCADE" +"public.chat_hub_messages" }o--o| "public.chat_hub_messages" : "FOREIGN KEY (#quot;retryOfMessageId#quot;) REFERENCES chat_hub_messages(id) ON DELETE CASCADE" +"public.chat_hub_messages" }o--o| "public.chat_hub_messages" : "FOREIGN KEY (#quot;previousMessageId#quot;) REFERENCES chat_hub_messages(id) ON DELETE CASCADE" +"public.chat_hub_messages" }o--o| "public.chat_hub_agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES chat_hub_agents(id) ON DELETE SET NULL" +"public.chat_hub_agents" }o--|| "public.user" : "FOREIGN KEY (#quot;ownerId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.chat_hub_agents" }o--o| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE SET NULL" +"public.oauth_authorization_codes" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.oauth_authorization_codes" }o--|| "public.oauth_clients" : "FOREIGN KEY (#quot;clientId#quot;) REFERENCES oauth_clients(id) ON DELETE CASCADE" +"public.oauth_access_tokens" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.oauth_access_tokens" }o--|| "public.oauth_clients" : "FOREIGN KEY (#quot;clientId#quot;) REFERENCES oauth_clients(id) ON DELETE CASCADE" +"public.oauth_refresh_tokens" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.oauth_refresh_tokens" }o--|| "public.oauth_clients" : "FOREIGN KEY (#quot;clientId#quot;) REFERENCES oauth_clients(id) ON DELETE CASCADE" +"public.oauth_user_consents" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.oauth_user_consents" }o--|| "public.oauth_clients" : "FOREIGN KEY (#quot;clientId#quot;) REFERENCES oauth_clients(id) ON DELETE CASCADE" +"public.workflow_dependency" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.workflow_publish_history" }o--o| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE SET NULL" +"public.workflow_publish_history" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.workflow_publish_history" }o--o| "public.workflow_history" : "FOREIGN KEY (#quot;versionId#quot;) REFERENCES workflow_history(#quot;versionId#quot;) ON DELETE SET NULL" +"public.dynamic_credential_user_entry" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.dynamic_credential_user_entry" }o--|| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE CASCADE" +"public.dynamic_credential_user_entry" }o--|| "public.dynamic_credential_resolver" : "FOREIGN KEY (#quot;resolverId#quot;) REFERENCES dynamic_credential_resolver(id) ON DELETE CASCADE" +"public.project_secrets_provider_access" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.project_secrets_provider_access" }o--|| "public.secrets_provider_connection" : "FOREIGN KEY (#quot;secretsProviderConnectionId#quot;) REFERENCES secrets_provider_connection(id) ON DELETE CASCADE" +"public.workflow_published_version" |o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE RESTRICT" +"public.workflow_published_version" }o--|| "public.workflow_history" : "FOREIGN KEY (#quot;publishedVersionId#quot;) REFERENCES workflow_history(#quot;versionId#quot;) ON DELETE RESTRICT" +"public.dynamic_credential_entry" }o--|| "public.credentials_entity" : "FOREIGN KEY (credential_id) REFERENCES credentials_entity(id) ON DELETE CASCADE" +"public.dynamic_credential_entry" }o--|| "public.dynamic_credential_resolver" : "FOREIGN KEY (resolver_id) REFERENCES dynamic_credential_resolver(id) ON DELETE CASCADE" +"public.chat_hub_tools" }o--|| "public.user" : "FOREIGN KEY (#quot;ownerId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.chat_hub_session_tools" }o--|| "public.chat_hub_sessions" : "FOREIGN KEY (#quot;sessionId#quot;) REFERENCES chat_hub_sessions(id) ON DELETE CASCADE" +"public.chat_hub_session_tools" }o--|| "public.chat_hub_tools" : "FOREIGN KEY (#quot;toolId#quot;) REFERENCES chat_hub_tools(id) ON DELETE CASCADE" +"public.chat_hub_agent_tools" }o--|| "public.chat_hub_agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES chat_hub_agents(id) ON DELETE CASCADE" +"public.chat_hub_agent_tools" }o--|| "public.chat_hub_tools" : "FOREIGN KEY (#quot;toolId#quot;) REFERENCES chat_hub_tools(id) ON DELETE CASCADE" +"public.workflow_builder_session" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.workflow_builder_session" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.role_mapping_rule" }o--|| "public.role" : "FOREIGN KEY (role) REFERENCES role(slug) ON UPDATE CASCADE ON DELETE CASCADE" +"public.role_mapping_rule_project" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.role_mapping_rule_project" }o--|| "public.role_mapping_rule" : "FOREIGN KEY (#quot;roleMappingRuleId#quot;) REFERENCES role_mapping_rule(id) ON DELETE CASCADE" +"public.credential_dependency" }o--|| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE CASCADE" +"public.instance_ai_threads" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.instance_ai_messages" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.instance_ai_observational_memory" }o--o| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE SET NULL" +"public.instance_ai_run_snapshots" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.instance_ai_iteration_logs" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.trusted_key" }o--|| "public.trusted_key_source" : "FOREIGN KEY (#quot;sourceId#quot;) REFERENCES trusted_key_source(id) ON DELETE CASCADE" +"public.user_favorites" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.ai_builder_temporary_workflow" |o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.ai_builder_temporary_workflow" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.evaluation_config" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.evaluation_collection" }o--o| "public.user" : "FOREIGN KEY (#quot;createdById#quot;) REFERENCES #quot;user#quot;(id) ON DELETE SET NULL" +"public.evaluation_collection" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.evaluation_collection" }o--|| "public.evaluation_config" : "FOREIGN KEY (#quot;evaluationConfigId#quot;) REFERENCES evaluation_config(id) ON DELETE CASCADE" +"public.agents" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.agents" }o--o| "public.agent_history" : "FOREIGN KEY (#quot;activeVersionId#quot;) REFERENCES agent_history(#quot;versionId#quot;) ON DELETE SET NULL" +"public.agent_checkpoints" }o--o| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_messages" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" +"public.agent_execution_threads" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.agent_execution_threads" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agent_execution_threads" }o--o| "public.agent_history" : "FOREIGN KEY (#quot;taskVersionId#quot;) REFERENCES agent_history(#quot;versionId#quot;) ON DELETE SET NULL" +"public.agent_execution" }o--|| "public.agent_execution_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES agent_execution_threads(id) ON DELETE CASCADE" +"public.instance_ai_checkpoints" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.agents_observations" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_observations" }o--o| "public.agents_observations" : "FOREIGN KEY (#quot;supersededBy#quot;) REFERENCES agents_observations(id)" +"public.agents_observations" }o--o| "public.agents_observations" : "FOREIGN KEY (#quot;parentId#quot;) REFERENCES agents_observations(id)" +"public.agents_observations" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" +"public.agents_observation_cursors" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_observation_cursors" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" +"public.agents_observation_locks" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_observation_locks" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" +"public.agents_memory_entries" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_memory_entries" }o--|| "public.agents_resources" : "FOREIGN KEY (#quot;resourceId#quot;) REFERENCES agents_resources(id) ON DELETE CASCADE" +"public.agents_memory_entries" }o--o| "public.agents_memory_entries" : "FOREIGN KEY (#quot;supersededBy#quot;) REFERENCES agents_memory_entries(id)" +"public.agents_memory_entry_locks" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_memory_entry_locks" }o--|| "public.agents_resources" : "FOREIGN KEY (#quot;resourceId#quot;) REFERENCES agents_resources(id) ON DELETE CASCADE" +"public.agents_memory_entry_sources" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_memory_entry_sources" }o--|| "public.agents_observations" : "FOREIGN KEY (#quot;observationId#quot;) REFERENCES agents_observations(id) ON DELETE CASCADE" +"public.agents_memory_entry_sources" }o--|| "public.agents_memory_entries" : "FOREIGN KEY (#quot;memoryEntryId#quot;) REFERENCES agents_memory_entries(id) ON DELETE CASCADE" +"public.agents_memory_entry_sources" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" +"public.agents_memory_entry_cursors" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_memory_entry_cursors" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" +"public.agent_history" }o--o| "public.user" : "FOREIGN KEY (#quot;publishedById#quot;) REFERENCES #quot;user#quot;(id) ON DELETE SET NULL" +"public.agent_history" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.instance_ai_observations" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.instance_ai_observations" }o--o| "public.instance_ai_observations" : "FOREIGN KEY (#quot;supersededBy#quot;) REFERENCES instance_ai_observations(id)" +"public.instance_ai_observations" }o--o| "public.instance_ai_observations" : "FOREIGN KEY (#quot;parentId#quot;) REFERENCES instance_ai_observations(id)" +"public.instance_ai_observation_cursors" |o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.instance_ai_observation_locks" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.instance_ai_pending_confirmations" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.instance_ai_pending_confirmations" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.instance_ai_pending_confirmations" }o--o| "public.instance_ai_checkpoints" : "FOREIGN KEY (#quot;checkpointKey#quot;) REFERENCES instance_ai_checkpoints(key) ON DELETE CASCADE" +"public.agent_files" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agent_task_definition" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agent_task_snapshot" }o--|| "public.agent_history" : "FOREIGN KEY (#quot;versionId#quot;) REFERENCES agent_history(#quot;versionId#quot;) ON DELETE CASCADE" +"public.agent_task_run_lock" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.instance_ai_mcp_registry_connections" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.instance_ai_mcp_registry_connections" }o--|| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE CASCADE" +"public.instance_ai_mcp_registry_connections" }o--|| "public.mcp_registry_server" : "FOREIGN KEY (#quot;serverSlug#quot;) REFERENCES mcp_registry_server(slug) ON DELETE CASCADE" + +"public.credentials_entity" { + varchar_128_ name + text data + varchar_128_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ id + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +"public.execution_entity" { + integer id + boolean finished + varchar mode + varchar retryOf + varchar retrySuccessId + timestamp_3__with_time_zone startedAt + timestamp_3__with_time_zone stoppedAt + timestamp_3__with_time_zone waitTill + varchar status + varchar_36_ workflowId FK + timestamp_3__with_time_zone deletedAt + timestamp_3__with_time_zone createdAt + varchar_2_ storedAt + json tracingContext + varchar_255_ deduplicationKey +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +"public.webhook_entity" { + varchar webhookPath + varchar method + varchar node + varchar webhookId + integer pathLength + varchar_36_ workflowId FK +} +"public.tag_entity" { + varchar_24_ name + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ id +} +"public.workflows_tags" { + varchar_36_ workflowId FK + varchar_36_ tagId FK +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"public.settings" { + varchar_255_ key + text value + boolean loadOnStartup +} +"public.installed_packages" { + varchar_214_ packageName + varchar_50_ installedVersion + varchar_70_ authorName + varchar_70_ authorEmail + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.installed_nodes" { + varchar_200_ name + varchar_200_ type + integer latestVersion + varchar_241_ package FK +} +"public.workflow_statistics" { + bigint count + timestamp_3__with_time_zone latestEvent + varchar_128_ name + varchar_36_ workflowId + bigint rootCount + integer id + varchar_128_ workflowName +} +"public.event_destinations" { + uuid id + jsonb destination + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.auth_identity" { + uuid userId FK + varchar_255_ providerId + varchar_32_ providerType + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.auth_provider_sync_history" { + integer id + varchar_32_ providerType + text runMode + text status + timestamp_3__with_time_zone startedAt + timestamp_3__with_time_zone endedAt + integer scanned + integer created + integer updated + integer disabled + text error +} +"public.variables" { + varchar_50_ key + varchar_50_ type + text value + varchar_36_ id + varchar_36_ projectId FK +} +"public.execution_data" { + integer executionId FK + json workflowData + text data + varchar_36_ workflowVersionId +} +"public.workflow_history" { + varchar_36_ versionId + varchar_36_ workflowId FK + varchar_255_ authors + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json nodes + json connections + varchar_128_ name + boolean autosaved + text description + json nodeGroups +} +"public.project" { + varchar_36_ id + varchar_255_ name + varchar_36_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + varchar_512_ description + uuid creatorId FK + json customTelemetryTags +} +"public.project_relation" { + varchar_36_ projectId FK + uuid userId FK + varchar role FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.shared_credentials" { + varchar_36_ credentialsId FK + varchar_36_ projectId FK + text role + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.shared_workflow" { + varchar_36_ workflowId FK + varchar_36_ projectId FK + text role + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.execution_metadata" { + integer id + integer executionId FK + varchar_255_ key + text value +} +"public.invalid_auth_token" { + varchar_512_ token + timestamp_3__with_time_zone expiresAt +} +"public.execution_annotations" { + integer id + integer executionId FK + varchar_6_ vote + text note + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.annotation_tag_entity" { + varchar_16_ id + varchar_24_ name + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.execution_annotation_tags" { + integer annotationId FK + varchar_24_ tagId FK +} +"public.user_api_keys" { + varchar_36_ id + uuid userId FK + varchar_100_ label + varchar apiKey + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json scopes + varchar audience + timestamp_3__with_time_zone lastUsedAt +} +"public.processed_data" { + varchar_36_ workflowId FK + varchar_255_ context + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + text value +} +"public.folder" { + varchar_36_ id + varchar_128_ name + varchar_36_ parentFolderId FK + varchar_36_ projectId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.folder_tag" { + varchar_36_ folderId FK + varchar_36_ tagId FK +} +"public.insights_metadata" { + integer metaId + varchar_36_ workflowId FK + varchar_36_ projectId FK + varchar_128_ workflowName + varchar_255_ projectName +} +"public.insights_raw" { + integer id + integer metaId FK + integer type + bigint value + timestamp_0__with_time_zone timestamp +} +"public.insights_by_period" { + integer id + integer metaId FK + integer type + bigint value + integer periodUnit + timestamp_0__with_time_zone periodStart +} +"public.test_run" { + varchar_36_ id + varchar_36_ workflowId FK + varchar status + varchar errorCode + json errorDetails + timestamp_3__with_time_zone runAt + timestamp_3__with_time_zone completedAt + json metrics + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_255_ runningInstanceId + boolean cancelRequested + varchar_36_ workflowVersionId + varchar_36_ evaluationConfigId FK + jsonb evaluationConfigSnapshot + varchar_36_ collectionId FK +} +"public.test_case_execution" { + varchar_36_ id + varchar_36_ testRunId FK + integer executionId FK + varchar status + timestamp_3__with_time_zone runAt + timestamp_3__with_time_zone completedAt + varchar errorCode + json errorDetails + json metrics + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json inputs + json outputs + integer runIndex +} +"public.scope" { + varchar_128_ slug + text displayName + text description +} +"public.role" { + varchar_128_ slug + text displayName + text description + text roleType + boolean systemRole + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.role_scope" { + varchar_128_ roleSlug FK + varchar_128_ scopeSlug FK +} +"public.data_table" { + varchar_36_ id + varchar_128_ name + varchar_36_ projectId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.data_table_column" { + varchar_36_ id + varchar_128_ name + varchar_32_ type + integer index + varchar_36_ dataTableId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.chat_hub_sessions" { + uuid id + varchar_256_ title + uuid ownerId FK + timestamp_3__with_time_zone lastMessageAt + varchar_36_ credentialId FK + varchar_16_ provider + varchar_256_ model + varchar_36_ workflowId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + uuid agentId FK + varchar_128_ agentName + varchar_16_ type +} +"public.chat_hub_messages" { + uuid id + uuid sessionId FK + uuid previousMessageId FK + uuid revisionOfMessageId FK + uuid retryOfMessageId FK + varchar_16_ type + varchar_128_ name + text content + varchar_16_ provider + varchar_256_ model + varchar_36_ workflowId FK + integer executionId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + uuid agentId FK + varchar_16_ status + json attachments +} +"public.chat_hub_agents" { + uuid id + varchar_256_ name + varchar_512_ description + text systemPrompt + uuid ownerId FK + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + json files + json suggestedPrompts +} +"public.oauth_clients" { + varchar id + varchar_255_ name + json redirectUris + json grantTypes + varchar_255_ clientSecret + bigint clientSecretExpiresAt + varchar_255_ tokenEndpointAuthMethod + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.oauth_authorization_codes" { + varchar_255_ code + varchar clientId FK + uuid userId FK + varchar redirectUri + varchar codeChallenge + varchar_255_ codeChallengeMethod + bigint expiresAt + varchar state + boolean used + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar resource + json scope +} +"public.oauth_access_tokens" { + varchar token + varchar clientId FK + uuid userId FK +} +"public.oauth_refresh_tokens" { + varchar_255_ token + varchar clientId FK + uuid userId FK + bigint expiresAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json scope +} +"public.oauth_user_consents" { + integer id + uuid userId FK + varchar clientId FK + bigint grantedAt +} +"public.workflow_dependency" { + integer id + varchar_36_ workflowId FK + integer workflowVersionId + varchar_32_ dependencyType + varchar_255_ dependencyKey + json dependencyInfo + smallint indexVersionId + timestamp_3__with_time_zone createdAt + varchar_36_ publishedVersionId +} +"public.binary_data" { + uuid fileId + varchar_50_ sourceType + varchar_255_ sourceId + bytea data + varchar_255_ mimeType + varchar_255_ fileName + integer fileSize + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.workflow_publish_history" { + integer id + varchar_36_ workflowId FK + varchar_36_ versionId FK + varchar_36_ event + uuid userId FK + timestamp_3__with_time_zone createdAt +} +"public.dynamic_credential_resolver" { + varchar_16_ id + varchar_128_ name + varchar_128_ type + text config + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.dynamic_credential_user_entry" { + varchar_16_ credentialId FK + uuid userId FK + varchar_16_ resolverId FK + text data + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.secrets_provider_connection" { + integer id + varchar_128_ providerKey + varchar_36_ type + text encryptedSettings + boolean isEnabled + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.project_secrets_provider_access" { + integer secretsProviderConnectionId FK + varchar_36_ projectId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_128_ role +} +"public.workflow_published_version" { + varchar_36_ workflowId FK + varchar_36_ publishedVersionId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.dynamic_credential_entry" { + varchar_16_ credential_id FK + varchar_2048_ subject_id + varchar_16_ resolver_id FK + text data + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.chat_hub_tools" { + uuid id + varchar_255_ name + varchar_255_ type + double_precision typeVersion + uuid ownerId FK + json definition + boolean enabled + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.chat_hub_session_tools" { + uuid sessionId FK + uuid toolId FK +} +"public.chat_hub_agent_tools" { + uuid agentId FK + uuid toolId FK +} +"public.workflow_builder_session" { + uuid id + varchar_36_ workflowId FK + uuid userId FK + json messages + text previousSummary + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_255_ activeVersionCardId + varchar_255_ resumeAfterRestoreMessageId +} +"public.role_mapping_rule" { + varchar_16_ id + text expression + varchar_128_ role FK + varchar_64_ type + integer order + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.role_mapping_rule_project" { + varchar_16_ roleMappingRuleId FK + varchar_36_ projectId FK +} +"public.credential_dependency" { + integer id + varchar_36_ credentialId FK + varchar_64_ dependencyType + varchar_255_ dependencyId + timestamp_3__with_time_zone createdAt +} +"public.instance_version_history" { + integer id + integer major + integer minor + integer patch + timestamp_3__with_time_zone createdAt +} +"public.instance_ai_threads" { + uuid id + varchar_255_ resourceId + text title + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ projectId FK +} +"public.instance_ai_messages" { + varchar_36_ id + uuid threadId FK + text content + varchar_16_ role + varchar_32_ type + varchar_255_ resourceId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_resources" { + varchar_255_ id + text workingMemory + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_observational_memory" { + varchar_36_ id + varchar_255_ lookupKey + varchar_16_ scope + uuid threadId FK + varchar_255_ resourceId + text activeObservations + varchar_32_ originType + text config + integer generationCount + timestamp_3__with_time_zone lastObservedAt + integer pendingMessageTokens + integer totalTokensObserved + integer observationTokenCount + boolean isObserving + boolean isReflecting + json observedMessageIds + varchar observedTimezone + text bufferedObservations + integer bufferedObservationTokens + json bufferedMessageIds + text bufferedReflection + integer bufferedReflectionTokens + integer bufferedReflectionInputTokens + integer reflectedObservationLineCount + json bufferedObservationChunks + boolean isBufferingObservation + boolean isBufferingReflection + integer lastBufferedAtTokens + timestamp_3__with_time_zone lastBufferedAtTime + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_workflow_snapshots" { + varchar_36_ runId + varchar_255_ workflowName + varchar_255_ resourceId + varchar status + text snapshot + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_run_snapshots" { + uuid threadId FK + varchar_36_ runId + varchar_36_ messageGroupId + json runIds + text tree + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ langsmithRunId + varchar_36_ langsmithTraceId + varchar_64_ traceId + varchar_64_ spanId +} +"public.instance_ai_iteration_logs" { + varchar_36_ id + uuid threadId FK + varchar taskKey + text entry + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.token_exchange_jti" { + varchar_255_ jti + timestamp_3__with_time_zone expiresAt + timestamp_3__with_time_zone createdAt +} +"public.trusted_key_source" { + varchar_36_ id + varchar_32_ type + text config + varchar_32_ status + text lastError + timestamp_3__with_time_zone lastRefreshedAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.trusted_key" { + varchar_36_ sourceId FK + varchar_255_ kid + text data + timestamp_3__with_time_zone createdAt +} +"public.user_favorites" { + integer id + uuid userId FK + varchar_255_ resourceId + varchar_64_ resourceType +} +"public.deployment_key" { + varchar_36_ id + varchar_64_ type + text value + varchar_20_ algorithm + varchar_20_ status + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.ai_builder_temporary_workflow" { + varchar_36_ workflowId FK + uuid threadId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.evaluation_config" { + varchar_36_ id + varchar_36_ workflowId FK + varchar_128_ name + varchar_16_ status + varchar_64_ invalidReason + varchar_32_ datasetSource + json datasetRef + varchar_255_ startNodeName + varchar_255_ endNodeName + json metrics + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.evaluation_collection" { + varchar_36_ id + varchar_128_ name + text description + varchar_36_ workflowId FK + varchar_36_ evaluationConfigId FK + uuid createdById FK + json insightsCache + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents" { + varchar_36_ id + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + json integrations + json schema + json tools + json skills + varchar_36_ versionId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ activeVersionId FK +} +"public.agent_checkpoints" { + varchar_255_ runId + varchar_255_ agentId FK + text state + boolean expired + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_resources" { + varchar_255_ id + text metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_threads" { + varchar_128_ id + varchar_255_ resourceId + varchar_255_ title + text metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_messages" { + varchar_36_ id + varchar_255_ threadId FK + varchar_255_ resourceId + varchar_36_ role + varchar_36_ type + json content + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agent_execution_threads" { + varchar_128_ id + varchar_36_ agentId FK + varchar_255_ agentName + varchar_255_ projectId FK + integer sessionNumber + integer totalPromptTokens + integer totalCompletionTokens + double_precision totalCost + integer totalDuration + varchar_255_ title + varchar_8_ emoji + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_32_ taskId + varchar_36_ taskVersionId FK + varchar_128_ parentThreadId + varchar_36_ parentAgentId +} +"public.agent_execution" { + varchar_36_ id + varchar_128_ threadId FK + varchar_16_ status + timestamp_3__with_time_zone startedAt + timestamp_3__with_time_zone stoppedAt + integer duration + text userMessage + text assistantResponse + varchar_255_ model + integer promptTokens + integer completionTokens + integer totalTokens + double_precision cost + json toolCalls + json timeline + text error + varchar_16_ hitlStatus + varchar_32_ source + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_checkpoints" { + varchar_255_ key + varchar_255_ runId + uuid threadId FK + varchar_255_ resourceId + json state + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + timestamp_3__with_time_zone expiredAt +} +"public.agents_observations" { + varchar_36_ id + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_16_ marker + text text + varchar_36_ parentId FK + integer tokenCount + varchar_16_ status + varchar_36_ supersededBy FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_observation_cursors" { + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_36_ lastObservedMessageId + timestamp_3__with_time_zone lastObservedAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_observation_locks" { + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_20_ taskKind + varchar_64_ holderId + timestamp_3__with_time_zone heldUntil + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_memory_entries" { + varchar_36_ id + varchar_36_ agentId FK + varchar_255_ resourceId FK + text content + varchar_64_ contentHash + varchar_16_ status + varchar_36_ supersededBy FK + varchar_128_ embeddingModel + json embedding + json metadata + timestamp_3__with_time_zone lastSeenAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_memory_entry_locks" { + varchar_36_ agentId FK + varchar_255_ resourceId FK + varchar_64_ holderId + timestamp_3__with_time_zone heldUntil + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_memory_entry_sources" { + varchar_36_ id + varchar_36_ agentId FK + varchar_36_ memoryEntryId FK + varchar_36_ observationId FK + varchar_255_ threadId FK + varchar_64_ evidenceHash + text evidenceText + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_memory_entry_cursors" { + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_36_ lastIndexedObservationId + timestamp_3__with_time_zone lastIndexedObservationCreatedAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agent_history" { + varchar_36_ versionId + varchar_36_ agentId FK + json schema + json tools + json skills + uuid publishedById FK + varchar_255_ author + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_observations" { + varchar_36_ id + uuid observationScopeId FK + varchar_16_ marker + text text + varchar_36_ parentId FK + integer tokenCount + varchar_16_ status + varchar_36_ supersededBy FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_observation_cursors" { + uuid observationScopeId FK + varchar_36_ lastObservedMessageId + timestamp_3__with_time_zone lastObservedAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_observation_locks" { + uuid observationScopeId FK + varchar_20_ taskKind + varchar_64_ holderId + timestamp_3__with_time_zone heldUntil + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_pending_confirmations" { + varchar_36_ requestId + uuid threadId FK + uuid userId FK + varchar_16_ kind + varchar_36_ runId + varchar_64_ toolCallId + varchar_36_ messageGroupId + varchar_255_ checkpointKey FK + varchar_36_ checkpointTaskId + timestamp_3__with_time_zone expiresAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.mcp_registry_server" { + varchar_255_ slug + varchar_50_ status + varchar_50_ version + timestamp_3__without_time_zone registryUpdatedAt + json data + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agent_files" { + varchar_16_ id + varchar_36_ agentId FK + text binaryDataId + varchar_255_ fileName + varchar_255_ mimeType + integer fileSizeBytes + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agent_task_definition" { + varchar_32_ id + varchar_36_ agentId FK + varchar_128_ name + text objective + varchar_128_ cronExpression + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agent_task_snapshot" { + varchar_36_ versionId FK + varchar_32_ taskId + boolean enabled + varchar_128_ name + text objective + varchar_128_ cronExpression + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agent_task_run_lock" { + varchar_36_ agentId FK + varchar_32_ taskId + uuid holderId + timestamp_3__with_time_zone heldUntil + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_mcp_registry_connections" { + uuid id + varchar_36_ credentialId FK + varchar_255_ serverSlug FK + json toolFilter + uuid userId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.workflow_publication_outbox" { + integer id + varchar_36_ workflowId + varchar_36_ publishedVersionId + varchar_20_ status + text errorMessage + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agent_checkpoints.md b/docs/generated/postgres-schema/public.agent_checkpoints.md new file mode 100644 index 00000000000..5bd8a586b64 --- /dev/null +++ b/docs/generated/postgres-schema/public.agent_checkpoints.md @@ -0,0 +1,65 @@ +# public.agent_checkpoints + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| runId | varchar(255) | | false | | | | +| agentId | varchar(255) | | true | | [public.agents](public.agents.md) | | +| state | text | | true | | | | +| expired | boolean | false | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agent_checkpoints_createdAt_not_null | n | NOT NULL "createdAt" | +| agent_checkpoints_expired_not_null | n | NOT NULL expired | +| agent_checkpoints_runId_not_null | n | NOT NULL "runId" | +| agent_checkpoints_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_5e31c210f896d539964bf99fe32 | FOREIGN KEY | FOREIGN KEY ("agentId") REFERENCES agents(id) ON DELETE CASCADE | +| PK_50a27cbafa6806c9b162304b5fd | PRIMARY KEY | PRIMARY KEY ("runId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_50a27cbafa6806c9b162304b5fd | CREATE UNIQUE INDEX "PK_50a27cbafa6806c9b162304b5fd" ON public.agent_checkpoints USING btree ("runId") | +| IDX_5e31c210f896d539964bf99fe3 | CREATE INDEX "IDX_5e31c210f896d539964bf99fe3" ON public.agent_checkpoints USING btree ("agentId") | + +## Relations + +```mermaid +erDiagram + +"public.agent_checkpoints" }o--o| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" + +"public.agent_checkpoints" { + varchar_255_ runId + varchar_255_ agentId FK + text state + boolean expired + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents" { + varchar_36_ id + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + json integrations + json schema + json tools + json skills + varchar_36_ versionId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ activeVersionId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agent_execution.md b/docs/generated/postgres-schema/public.agent_execution.md new file mode 100644 index 00000000000..f01bc72e413 --- /dev/null +++ b/docs/generated/postgres-schema/public.agent_execution.md @@ -0,0 +1,104 @@ +# public.agent_execution + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| threadId | varchar(128) | | false | | [public.agent_execution_threads](public.agent_execution_threads.md) | | +| status | varchar(16) | | false | | | | +| startedAt | timestamp(3) with time zone | | true | | | | +| stoppedAt | timestamp(3) with time zone | | true | | | | +| duration | integer | 0 | false | | | | +| userMessage | text | | false | | | | +| assistantResponse | text | | false | | | | +| model | varchar(255) | | true | | | | +| promptTokens | integer | | true | | | | +| completionTokens | integer | | true | | | | +| totalTokens | integer | | true | | | | +| cost | double precision | | true | | | | +| toolCalls | json | | true | | | | +| timeline | json | | true | | | | +| error | text | | true | | | | +| hitlStatus | varchar(16) | | true | | | | +| source | varchar(32) | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| CHK_agent_execution_hitlStatus | CHECK | CHECK ((("hitlStatus")::text = ANY ((ARRAY['suspended'::character varying, 'resumed'::character varying])::text[]))) | +| CHK_agent_execution_status | CHECK | CHECK (((status)::text = ANY ((ARRAY['success'::character varying, 'error'::character varying])::text[]))) | +| agent_execution_assistantResponse_not_null | n | NOT NULL "assistantResponse" | +| agent_execution_createdAt_not_null | n | NOT NULL "createdAt" | +| agent_execution_duration_not_null | n | NOT NULL duration | +| agent_execution_id_not_null | n | NOT NULL id | +| agent_execution_status_not_null | n | NOT NULL status | +| agent_execution_threadId_not_null | n | NOT NULL "threadId" | +| agent_execution_updatedAt_not_null | n | NOT NULL "updatedAt" | +| agent_execution_userMessage_not_null | n | NOT NULL "userMessage" | +| PK_ba438acc8532addc12d1ef17049 | PRIMARY KEY | PRIMARY KEY (id) | +| FK_add2432fb6034cc18b6af299dce | FOREIGN KEY | FOREIGN KEY ("threadId") REFERENCES agent_execution_threads(id) ON DELETE CASCADE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_ba438acc8532addc12d1ef17049 | CREATE UNIQUE INDEX "PK_ba438acc8532addc12d1ef17049" ON public.agent_execution USING btree (id) | +| IDX_63d3c3a68b9cebf05f967f0b1c | CREATE INDEX "IDX_63d3c3a68b9cebf05f967f0b1c" ON public.agent_execution USING btree ("threadId", "createdAt") | + +## Relations + +```mermaid +erDiagram + +"public.agent_execution" }o--|| "public.agent_execution_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES agent_execution_threads(id) ON DELETE CASCADE" + +"public.agent_execution" { + varchar_36_ id + varchar_128_ threadId FK + varchar_16_ status + timestamp_3__with_time_zone startedAt + timestamp_3__with_time_zone stoppedAt + integer duration + text userMessage + text assistantResponse + varchar_255_ model + integer promptTokens + integer completionTokens + integer totalTokens + double_precision cost + json toolCalls + json timeline + text error + varchar_16_ hitlStatus + varchar_32_ source + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agent_execution_threads" { + varchar_128_ id + varchar_36_ agentId FK + varchar_255_ agentName + varchar_255_ projectId FK + integer sessionNumber + integer totalPromptTokens + integer totalCompletionTokens + double_precision totalCost + integer totalDuration + varchar_255_ title + varchar_8_ emoji + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_32_ taskId + varchar_36_ taskVersionId FK + varchar_128_ parentThreadId + varchar_36_ parentAgentId +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agent_execution_threads.md b/docs/generated/postgres-schema/public.agent_execution_threads.md new file mode 100644 index 00000000000..968a6ea6efd --- /dev/null +++ b/docs/generated/postgres-schema/public.agent_execution_threads.md @@ -0,0 +1,145 @@ +# public.agent_execution_threads + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(128) | | false | [public.agent_execution](public.agent_execution.md) | | | +| agentId | varchar(36) | | false | | [public.agents](public.agents.md) | | +| agentName | varchar(255) | | false | | | | +| projectId | varchar(255) | | false | | [public.project](public.project.md) | | +| sessionNumber | integer | 0 | false | | | | +| totalPromptTokens | integer | 0 | false | | | | +| totalCompletionTokens | integer | 0 | false | | | | +| totalCost | double precision | 0 | false | | | | +| totalDuration | integer | 0 | false | | | | +| title | varchar(255) | | true | | | | +| emoji | varchar(8) | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| taskId | varchar(32) | | true | | | Published task ID that triggered this session; not an FK because published runs can outlive draft task definition rows | +| taskVersionId | varchar(36) | | true | | [public.agent_history](public.agent_history.md) | Published agent_history version that supplied the task snapshot | +| parentThreadId | varchar(128) | | true | | | Parent session thread id that delegated this subagent run. | +| parentAgentId | varchar(36) | | true | | | Saved agent id of the parent that delegated this subagent run. | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agent_execution_threads_agentId_not_null | n | NOT NULL "agentId" | +| agent_execution_threads_agentName_not_null | n | NOT NULL "agentName" | +| agent_execution_threads_createdAt_not_null | n | NOT NULL "createdAt" | +| agent_execution_threads_id_not_null | n | NOT NULL id | +| agent_execution_threads_projectId_not_null | n | NOT NULL "projectId" | +| agent_execution_threads_sessionNumber_not_null | n | NOT NULL "sessionNumber" | +| agent_execution_threads_totalCompletionTokens_not_null | n | NOT NULL "totalCompletionTokens" | +| agent_execution_threads_totalCost_not_null | n | NOT NULL "totalCost" | +| agent_execution_threads_totalDuration_not_null | n | NOT NULL "totalDuration" | +| agent_execution_threads_totalPromptTokens_not_null | n | NOT NULL "totalPromptTokens" | +| agent_execution_threads_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_0e2f8bf92a7a9c88b89670f701c | FOREIGN KEY | FOREIGN KEY ("projectId") REFERENCES project(id) ON DELETE CASCADE | +| FK_0468a9dc35597314e641d4722aa | FOREIGN KEY | FOREIGN KEY ("agentId") REFERENCES agents(id) ON DELETE CASCADE | +| FK_f00b52d74fe11838e1fe086deea | FOREIGN KEY | FOREIGN KEY ("taskVersionId") REFERENCES agent_history("versionId") ON DELETE SET NULL | +| PK_22373dbf6ba6929d8ac50093309 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_0468a9dc35597314e641d4722a | CREATE INDEX "IDX_0468a9dc35597314e641d4722a" ON public.agent_execution_threads USING btree ("agentId") | +| IDX_0e2f8bf92a7a9c88b89670f701 | CREATE INDEX "IDX_0e2f8bf92a7a9c88b89670f701" ON public.agent_execution_threads USING btree ("projectId") | +| IDX_agent_execution_threads_taskVersionId | CREATE INDEX "IDX_agent_execution_threads_taskVersionId" ON public.agent_execution_threads USING btree ("taskVersionId") | +| PK_22373dbf6ba6929d8ac50093309 | CREATE UNIQUE INDEX "PK_22373dbf6ba6929d8ac50093309" ON public.agent_execution_threads USING btree (id) | + +## Relations + +```mermaid +erDiagram + +"public.agent_execution" }o--|| "public.agent_execution_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES agent_execution_threads(id) ON DELETE CASCADE" +"public.agent_execution_threads" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agent_execution_threads" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.agent_execution_threads" }o--o| "public.agent_history" : "FOREIGN KEY (#quot;taskVersionId#quot;) REFERENCES agent_history(#quot;versionId#quot;) ON DELETE SET NULL" + +"public.agent_execution_threads" { + varchar_128_ id + varchar_36_ agentId FK + varchar_255_ agentName + varchar_255_ projectId FK + integer sessionNumber + integer totalPromptTokens + integer totalCompletionTokens + double_precision totalCost + integer totalDuration + varchar_255_ title + varchar_8_ emoji + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_32_ taskId + varchar_36_ taskVersionId FK + varchar_128_ parentThreadId + varchar_36_ parentAgentId +} +"public.agent_execution" { + varchar_36_ id + varchar_128_ threadId FK + varchar_16_ status + timestamp_3__with_time_zone startedAt + timestamp_3__with_time_zone stoppedAt + integer duration + text userMessage + text assistantResponse + varchar_255_ model + integer promptTokens + integer completionTokens + integer totalTokens + double_precision cost + json toolCalls + json timeline + text error + varchar_16_ hitlStatus + varchar_32_ source + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents" { + varchar_36_ id + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + json integrations + json schema + json tools + json skills + varchar_36_ versionId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ activeVersionId FK +} +"public.project" { + varchar_36_ id + varchar_255_ name + varchar_36_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + varchar_512_ description + uuid creatorId FK + json customTelemetryTags +} +"public.agent_history" { + varchar_36_ versionId + varchar_36_ agentId FK + json schema + json tools + json skills + uuid publishedById FK + varchar_255_ author + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agent_files.md b/docs/generated/postgres-schema/public.agent_files.md new file mode 100644 index 00000000000..8b1538a3ce2 --- /dev/null +++ b/docs/generated/postgres-schema/public.agent_files.md @@ -0,0 +1,73 @@ +# public.agent_files + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(16) | | false | | | Application-generated n8n nano ID | +| agentId | varchar(36) | | false | | [public.agents](public.agents.md) | Agent that owns this uploaded file | +| binaryDataId | text | | false | | | Opaque BinaryDataService reference (mode-prefixed, e.g. "filesystem-v2:\"); not an FK to binary_data, which only has rows in DB storage mode | +| fileName | varchar(255) | | false | | | | +| mimeType | varchar(255) | | false | | | | +| fileSizeBytes | integer | | false | | | Uploaded file size in bytes | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agent_files_agentId_not_null | n | NOT NULL "agentId" | +| agent_files_binaryDataId_not_null | n | NOT NULL "binaryDataId" | +| agent_files_createdAt_not_null | n | NOT NULL "createdAt" | +| agent_files_fileName_not_null | n | NOT NULL "fileName" | +| agent_files_fileSizeBytes_not_null | n | NOT NULL "fileSizeBytes" | +| agent_files_id_not_null | n | NOT NULL id | +| agent_files_mimeType_not_null | n | NOT NULL "mimeType" | +| agent_files_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_aca4514cb500494b64356c2e164 | FOREIGN KEY | FOREIGN KEY ("agentId") REFERENCES agents(id) ON DELETE CASCADE | +| PK_692920e59217af7d124cd95106f | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_692920e59217af7d124cd95106f | CREATE UNIQUE INDEX "PK_692920e59217af7d124cd95106f" ON public.agent_files USING btree (id) | +| IDX_45dafc48fe2ce95eac30fc8ffd | CREATE INDEX "IDX_45dafc48fe2ce95eac30fc8ffd" ON public.agent_files USING btree ("agentId", "createdAt") | + +## Relations + +```mermaid +erDiagram + +"public.agent_files" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" + +"public.agent_files" { + varchar_16_ id + varchar_36_ agentId FK + text binaryDataId + varchar_255_ fileName + varchar_255_ mimeType + integer fileSizeBytes + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents" { + varchar_36_ id + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + json integrations + json schema + json tools + json skills + varchar_36_ versionId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ activeVersionId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agent_history.md b/docs/generated/postgres-schema/public.agent_history.md new file mode 100644 index 00000000000..b46f5a2a73f --- /dev/null +++ b/docs/generated/postgres-schema/public.agent_history.md @@ -0,0 +1,123 @@ +# public.agent_history + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| versionId | varchar(36) | | false | [public.agents](public.agents.md) [public.agent_execution_threads](public.agent_execution_threads.md) [public.agent_task_snapshot](public.agent_task_snapshot.md) | | | +| agentId | varchar(36) | | false | | [public.agents](public.agents.md) | | +| schema | json | | true | | | Frozen snapshot of the published AgentJsonConfig | +| tools | json | | true | | | Frozen map of `toolId → { code, descriptor }` at publish time | +| skills | json | | true | | | Frozen map of `skillId → AgentSkill` at publish time | +| publishedById | uuid | | true | | [public.user](public.user.md) | | +| author | varchar(255) | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agent_history_agentId_not_null | n | NOT NULL "agentId" | +| agent_history_author_not_null | n | NOT NULL author | +| agent_history_createdAt_not_null | n | NOT NULL "createdAt" | +| agent_history_updatedAt_not_null | n | NOT NULL "updatedAt" | +| agent_history_versionId_not_null | n | NOT NULL "versionId" | +| FK_8771675f44c58fb40e0feb9ee35 | FOREIGN KEY | FOREIGN KEY ("publishedById") REFERENCES "user"(id) ON DELETE SET NULL | +| FK_87cd5a8da20304b089ea2f83fec | FOREIGN KEY | FOREIGN KEY ("agentId") REFERENCES agents(id) ON DELETE CASCADE | +| PK_65ffcfe7a8e112fb826311fb092 | PRIMARY KEY | PRIMARY KEY ("versionId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_65ffcfe7a8e112fb826311fb092 | CREATE UNIQUE INDEX "PK_65ffcfe7a8e112fb826311fb092" ON public.agent_history USING btree ("versionId") | +| IDX_87cd5a8da20304b089ea2f83fe | CREATE INDEX "IDX_87cd5a8da20304b089ea2f83fe" ON public.agent_history USING btree ("agentId") | + +## Relations + +```mermaid +erDiagram + +"public.agents" }o--o| "public.agent_history" : "FOREIGN KEY (#quot;activeVersionId#quot;) REFERENCES agent_history(#quot;versionId#quot;) ON DELETE SET NULL" +"public.agent_execution_threads" }o--o| "public.agent_history" : "FOREIGN KEY (#quot;taskVersionId#quot;) REFERENCES agent_history(#quot;versionId#quot;) ON DELETE SET NULL" +"public.agent_task_snapshot" }o--|| "public.agent_history" : "FOREIGN KEY (#quot;versionId#quot;) REFERENCES agent_history(#quot;versionId#quot;) ON DELETE CASCADE" +"public.agent_history" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agent_history" }o--o| "public.user" : "FOREIGN KEY (#quot;publishedById#quot;) REFERENCES #quot;user#quot;(id) ON DELETE SET NULL" + +"public.agent_history" { + varchar_36_ versionId + varchar_36_ agentId FK + json schema + json tools + json skills + uuid publishedById FK + varchar_255_ author + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents" { + varchar_36_ id + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + json integrations + json schema + json tools + json skills + varchar_36_ versionId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ activeVersionId FK +} +"public.agent_execution_threads" { + varchar_128_ id + varchar_36_ agentId FK + varchar_255_ agentName + varchar_255_ projectId FK + integer sessionNumber + integer totalPromptTokens + integer totalCompletionTokens + double_precision totalCost + integer totalDuration + varchar_255_ title + varchar_8_ emoji + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_32_ taskId + varchar_36_ taskVersionId FK + varchar_128_ parentThreadId + varchar_36_ parentAgentId +} +"public.agent_task_snapshot" { + varchar_36_ versionId FK + varchar_32_ taskId + boolean enabled + varchar_128_ name + text objective + varchar_128_ cronExpression + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agent_task_definition.md b/docs/generated/postgres-schema/public.agent_task_definition.md new file mode 100644 index 00000000000..fa6b52223ab --- /dev/null +++ b/docs/generated/postgres-schema/public.agent_task_definition.md @@ -0,0 +1,70 @@ +# public.agent_task_definition + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(32) | | false | | | Application-generated task ID referenced from agent JSON config | +| agentId | varchar(36) | | false | | [public.agents](public.agents.md) | Owning agent; task definitions are deleted when the agent is deleted | +| name | varchar(128) | | false | | | | +| objective | text | | false | | | User-authored instruction sent to the agent when this task runs | +| cronExpression | varchar(128) | | false | | | Cron schedule evaluated using the instance timezone | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agent_task_definition_agentId_not_null | n | NOT NULL "agentId" | +| agent_task_definition_createdAt_not_null | n | NOT NULL "createdAt" | +| agent_task_definition_cronExpression_not_null | n | NOT NULL "cronExpression" | +| agent_task_definition_id_not_null | n | NOT NULL id | +| agent_task_definition_name_not_null | n | NOT NULL name | +| agent_task_definition_objective_not_null | n | NOT NULL objective | +| agent_task_definition_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_f45d0535a2ed59b6c2dd6da98a0 | FOREIGN KEY | FOREIGN KEY ("agentId") REFERENCES agents(id) ON DELETE CASCADE | +| PK_1756c11c637903e97629a7a784a | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_1756c11c637903e97629a7a784a | CREATE UNIQUE INDEX "PK_1756c11c637903e97629a7a784a" ON public.agent_task_definition USING btree (id) | +| IDX_f45d0535a2ed59b6c2dd6da98a | CREATE INDEX "IDX_f45d0535a2ed59b6c2dd6da98a" ON public.agent_task_definition USING btree ("agentId") | + +## Relations + +```mermaid +erDiagram + +"public.agent_task_definition" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" + +"public.agent_task_definition" { + varchar_32_ id + varchar_36_ agentId FK + varchar_128_ name + text objective + varchar_128_ cronExpression + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents" { + varchar_36_ id + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + json integrations + json schema + json tools + json skills + varchar_36_ versionId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ activeVersionId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agent_task_run_lock.md b/docs/generated/postgres-schema/public.agent_task_run_lock.md new file mode 100644 index 00000000000..34f2fd95e5f --- /dev/null +++ b/docs/generated/postgres-schema/public.agent_task_run_lock.md @@ -0,0 +1,66 @@ +# public.agent_task_run_lock + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| agentId | varchar(36) | | false | | [public.agents](public.agents.md) | Published agent whose scheduled task run is locked | +| taskId | varchar(32) | | false | | | Published task ID whose scheduled run is locked | +| holderId | uuid | | false | | | Ephemeral lock owner token generated by the running main | +| heldUntil | timestamp(3) with time zone | | false | | | Time after which another main can claim this task run lock | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agent_task_run_lock_agentId_not_null | n | NOT NULL "agentId" | +| agent_task_run_lock_createdAt_not_null | n | NOT NULL "createdAt" | +| agent_task_run_lock_heldUntil_not_null | n | NOT NULL "heldUntil" | +| agent_task_run_lock_holderId_not_null | n | NOT NULL "holderId" | +| agent_task_run_lock_taskId_not_null | n | NOT NULL "taskId" | +| agent_task_run_lock_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_b57a2862ae869aab24e54cefd48 | FOREIGN KEY | FOREIGN KEY ("agentId") REFERENCES agents(id) ON DELETE CASCADE | +| PK_f593adaf7230e964d3c25deda64 | PRIMARY KEY | PRIMARY KEY ("agentId", "taskId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_f593adaf7230e964d3c25deda64 | CREATE UNIQUE INDEX "PK_f593adaf7230e964d3c25deda64" ON public.agent_task_run_lock USING btree ("agentId", "taskId") | + +## Relations + +```mermaid +erDiagram + +"public.agent_task_run_lock" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" + +"public.agent_task_run_lock" { + varchar_36_ agentId FK + varchar_32_ taskId + uuid holderId + timestamp_3__with_time_zone heldUntil + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents" { + varchar_36_ id + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + json integrations + json schema + json tools + json skills + varchar_36_ versionId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ activeVersionId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agent_task_snapshot.md b/docs/generated/postgres-schema/public.agent_task_snapshot.md new file mode 100644 index 00000000000..b4a3de4e45a --- /dev/null +++ b/docs/generated/postgres-schema/public.agent_task_snapshot.md @@ -0,0 +1,69 @@ +# public.agent_task_snapshot + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| versionId | varchar(36) | | false | | [public.agent_history](public.agent_history.md) | Published agent_history version this task snapshot belongs to | +| taskId | varchar(32) | | false | | | Stable task ID referenced from the published agent JSON config | +| enabled | boolean | | false | | | Published enabled state for this task at publish time | +| name | varchar(128) | | false | | | | +| objective | text | | false | | | User-authored instruction sent to the agent when this task runs | +| cronExpression | varchar(128) | | false | | | Cron schedule evaluated using the instance timezone | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agent_task_snapshot_createdAt_not_null | n | NOT NULL "createdAt" | +| agent_task_snapshot_cronExpression_not_null | n | NOT NULL "cronExpression" | +| agent_task_snapshot_enabled_not_null | n | NOT NULL enabled | +| agent_task_snapshot_name_not_null | n | NOT NULL name | +| agent_task_snapshot_objective_not_null | n | NOT NULL objective | +| agent_task_snapshot_taskId_not_null | n | NOT NULL "taskId" | +| agent_task_snapshot_updatedAt_not_null | n | NOT NULL "updatedAt" | +| agent_task_snapshot_versionId_not_null | n | NOT NULL "versionId" | +| FK_1acedce6690392ef1611cca8b88 | FOREIGN KEY | FOREIGN KEY ("versionId") REFERENCES agent_history("versionId") ON DELETE CASCADE | +| PK_2142a8bcda2360c3c5e34f82640 | PRIMARY KEY | PRIMARY KEY ("versionId", "taskId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_2142a8bcda2360c3c5e34f82640 | CREATE UNIQUE INDEX "PK_2142a8bcda2360c3c5e34f82640" ON public.agent_task_snapshot USING btree ("versionId", "taskId") | + +## Relations + +```mermaid +erDiagram + +"public.agent_task_snapshot" }o--|| "public.agent_history" : "FOREIGN KEY (#quot;versionId#quot;) REFERENCES agent_history(#quot;versionId#quot;) ON DELETE CASCADE" + +"public.agent_task_snapshot" { + varchar_36_ versionId FK + varchar_32_ taskId + boolean enabled + varchar_128_ name + text objective + varchar_128_ cronExpression + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agent_history" { + varchar_36_ versionId + varchar_36_ agentId FK + json schema + json tools + json skills + uuid publishedById FK + varchar_255_ author + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agents.md b/docs/generated/postgres-schema/public.agents.md new file mode 100644 index 00000000000..714e5d9b44e --- /dev/null +++ b/docs/generated/postgres-schema/public.agents.md @@ -0,0 +1,231 @@ +# public.agents + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [public.agent_checkpoints](public.agent_checkpoints.md) [public.agent_execution_threads](public.agent_execution_threads.md) [public.agents_observations](public.agents_observations.md) [public.agents_observation_cursors](public.agents_observation_cursors.md) [public.agents_observation_locks](public.agents_observation_locks.md) [public.agents_memory_entries](public.agents_memory_entries.md) [public.agents_memory_entry_locks](public.agents_memory_entry_locks.md) [public.agents_memory_entry_sources](public.agents_memory_entry_sources.md) [public.agents_memory_entry_cursors](public.agents_memory_entry_cursors.md) [public.agent_history](public.agent_history.md) [public.agent_files](public.agent_files.md) [public.agent_task_definition](public.agent_task_definition.md) [public.agent_task_run_lock](public.agent_task_run_lock.md) | | | +| name | varchar(128) | | false | | | | +| description | varchar(512) | | true | | | | +| projectId | varchar(255) | | false | | [public.project](public.project.md) | | +| integrations | json | '[]'::json | false | | | | +| schema | json | | true | | | | +| tools | json | '{}'::json | false | | | | +| skills | json | '{}'::json | false | | | | +| versionId | varchar(36) | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| activeVersionId | varchar(36) | | true | | [public.agent_history](public.agent_history.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agents_createdAt_not_null | n | NOT NULL "createdAt" | +| agents_id_not_null | n | NOT NULL id | +| agents_integrations_not_null | n | NOT NULL integrations | +| agents_name_not_null | n | NOT NULL name | +| agents_projectId_not_null | n | NOT NULL "projectId" | +| agents_skills_not_null | n | NOT NULL skills | +| agents_tools_not_null | n | NOT NULL tools | +| agents_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_a30d560207c4071d98aa03c179c | FOREIGN KEY | FOREIGN KEY ("projectId") REFERENCES project(id) ON DELETE CASCADE | +| PK_9c653f28ae19c5884d5baf6a1d9 | PRIMARY KEY | PRIMARY KEY (id) | +| FK_940597dfe9753375309ce6aeea0 | FOREIGN KEY | FOREIGN KEY ("activeVersionId") REFERENCES agent_history("versionId") ON DELETE SET NULL | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_9c653f28ae19c5884d5baf6a1d9 | CREATE UNIQUE INDEX "PK_9c653f28ae19c5884d5baf6a1d9" ON public.agents USING btree (id) | +| IDX_a30d560207c4071d98aa03c179 | CREATE INDEX "IDX_a30d560207c4071d98aa03c179" ON public.agents USING btree ("projectId") | +| IDX_agents_projectId | CREATE INDEX "IDX_agents_projectId" ON public.agents USING btree ("projectId") | + +## Relations + +```mermaid +erDiagram + +"public.agent_checkpoints" }o--o| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agent_execution_threads" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_observations" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_observation_cursors" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_observation_locks" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_memory_entries" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_memory_entry_locks" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_memory_entry_sources" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_memory_entry_cursors" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agent_history" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agent_files" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agent_task_definition" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agent_task_run_lock" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.agents" }o--o| "public.agent_history" : "FOREIGN KEY (#quot;activeVersionId#quot;) REFERENCES agent_history(#quot;versionId#quot;) ON DELETE SET NULL" + +"public.agents" { + varchar_36_ id + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + json integrations + json schema + json tools + json skills + varchar_36_ versionId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ activeVersionId FK +} +"public.agent_checkpoints" { + varchar_255_ runId + varchar_255_ agentId FK + text state + boolean expired + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agent_execution_threads" { + varchar_128_ id + varchar_36_ agentId FK + varchar_255_ agentName + varchar_255_ projectId FK + integer sessionNumber + integer totalPromptTokens + integer totalCompletionTokens + double_precision totalCost + integer totalDuration + varchar_255_ title + varchar_8_ emoji + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_32_ taskId + varchar_36_ taskVersionId FK + varchar_128_ parentThreadId + varchar_36_ parentAgentId +} +"public.agents_observations" { + varchar_36_ id + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_16_ marker + text text + varchar_36_ parentId FK + integer tokenCount + varchar_16_ status + varchar_36_ supersededBy FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_observation_cursors" { + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_36_ lastObservedMessageId + timestamp_3__with_time_zone lastObservedAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_observation_locks" { + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_20_ taskKind + varchar_64_ holderId + timestamp_3__with_time_zone heldUntil + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_memory_entries" { + varchar_36_ id + varchar_36_ agentId FK + varchar_255_ resourceId FK + text content + varchar_64_ contentHash + varchar_16_ status + varchar_36_ supersededBy FK + varchar_128_ embeddingModel + json embedding + json metadata + timestamp_3__with_time_zone lastSeenAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_memory_entry_locks" { + varchar_36_ agentId FK + varchar_255_ resourceId FK + varchar_64_ holderId + timestamp_3__with_time_zone heldUntil + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_memory_entry_sources" { + varchar_36_ id + varchar_36_ agentId FK + varchar_36_ memoryEntryId FK + varchar_36_ observationId FK + varchar_255_ threadId FK + varchar_64_ evidenceHash + text evidenceText + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_memory_entry_cursors" { + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_36_ lastIndexedObservationId + timestamp_3__with_time_zone lastIndexedObservationCreatedAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agent_history" { + varchar_36_ versionId + varchar_36_ agentId FK + json schema + json tools + json skills + uuid publishedById FK + varchar_255_ author + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agent_files" { + varchar_16_ id + varchar_36_ agentId FK + text binaryDataId + varchar_255_ fileName + varchar_255_ mimeType + integer fileSizeBytes + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agent_task_definition" { + varchar_32_ id + varchar_36_ agentId FK + varchar_128_ name + text objective + varchar_128_ cronExpression + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agent_task_run_lock" { + varchar_36_ agentId FK + varchar_32_ taskId + uuid holderId + timestamp_3__with_time_zone heldUntil + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.project" { + varchar_36_ id + varchar_255_ name + varchar_36_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + varchar_512_ description + uuid creatorId FK + json customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agents_memory_entries.md b/docs/generated/postgres-schema/public.agents_memory_entries.md new file mode 100644 index 00000000000..7c19bca6159 --- /dev/null +++ b/docs/generated/postgres-schema/public.agents_memory_entries.md @@ -0,0 +1,110 @@ +# public.agents_memory_entries + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [public.agents_memory_entries](public.agents_memory_entries.md) [public.agents_memory_entry_sources](public.agents_memory_entry_sources.md) | | | +| agentId | varchar(36) | | false | | [public.agents](public.agents.md) | Agent that owns this episodic memory entry | +| resourceId | varchar(255) | | false | | [public.agents_resources](public.agents_resources.md) | agents_resources.id partition used for episodic recall scope | +| content | text | | false | | | | +| contentHash | varchar(64) | | false | | | | +| status | varchar(16) | | false | | | | +| supersededBy | varchar(36) | | true | | [public.agents_memory_entries](public.agents_memory_entries.md) | Self-reference to replacement memory entry | +| embeddingModel | varchar(128) | | true | | | Embedding model used to produce embedding | +| embedding | json | | true | | | Embedding vector for episodic recall | +| metadata | json | | true | | | Optional system metadata for ranking and debugging | +| lastSeenAt | timestamp(3) with time zone | | false | | | Last time equivalent content was observed; updatedAt tracks row mutation time | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| CHK_agents_memory_entries_status | CHECK | CHECK (((status)::text = ANY ((ARRAY['active'::character varying, 'superseded'::character varying, 'dropped'::character varying])::text[]))) | +| agents_memory_entries_agentId_not_null | n | NOT NULL "agentId" | +| agents_memory_entries_contentHash_not_null | n | NOT NULL "contentHash" | +| agents_memory_entries_content_not_null | n | NOT NULL content | +| agents_memory_entries_createdAt_not_null | n | NOT NULL "createdAt" | +| agents_memory_entries_id_not_null | n | NOT NULL id | +| agents_memory_entries_lastSeenAt_not_null | n | NOT NULL "lastSeenAt" | +| agents_memory_entries_resourceId_not_null | n | NOT NULL "resourceId" | +| agents_memory_entries_status_not_null | n | NOT NULL status | +| agents_memory_entries_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_28e981fb675e9b44ce02f0ec1dd | FOREIGN KEY | FOREIGN KEY ("agentId") REFERENCES agents(id) ON DELETE CASCADE | +| FK_1443a75e59adbfb796071d66393 | FOREIGN KEY | FOREIGN KEY ("resourceId") REFERENCES agents_resources(id) ON DELETE CASCADE | +| FK_0edf1226b77ddc525eae4938079 | FOREIGN KEY | FOREIGN KEY ("supersededBy") REFERENCES agents_memory_entries(id) | +| PK_bfbc45dc88f66fae4e4b4a15fec | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_bfbc45dc88f66fae4e4b4a15fec | CREATE UNIQUE INDEX "PK_bfbc45dc88f66fae4e4b4a15fec" ON public.agents_memory_entries USING btree (id) | +| IDX_aff2807b31eccbafe59d0474f0 | CREATE INDEX "IDX_aff2807b31eccbafe59d0474f0" ON public.agents_memory_entries USING btree ("agentId", "resourceId", status, "createdAt", id) | +| IDX_a03e04e94bea8439dd166d4b52 | CREATE UNIQUE INDEX "IDX_a03e04e94bea8439dd166d4b52" ON public.agents_memory_entries USING btree ("agentId", "resourceId", "contentHash") | +| IDX_1443a75e59adbfb796071d6639 | CREATE INDEX "IDX_1443a75e59adbfb796071d6639" ON public.agents_memory_entries USING btree ("resourceId") | +| IDX_0edf1226b77ddc525eae493807 | CREATE INDEX "IDX_0edf1226b77ddc525eae493807" ON public.agents_memory_entries USING btree ("supersededBy") | + +## Relations + +```mermaid +erDiagram + +"public.agents_memory_entries" }o--o| "public.agents_memory_entries" : "FOREIGN KEY (#quot;supersededBy#quot;) REFERENCES agents_memory_entries(id)" +"public.agents_memory_entry_sources" }o--|| "public.agents_memory_entries" : "FOREIGN KEY (#quot;memoryEntryId#quot;) REFERENCES agents_memory_entries(id) ON DELETE CASCADE" +"public.agents_memory_entries" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_memory_entries" }o--|| "public.agents_resources" : "FOREIGN KEY (#quot;resourceId#quot;) REFERENCES agents_resources(id) ON DELETE CASCADE" + +"public.agents_memory_entries" { + varchar_36_ id + varchar_36_ agentId FK + varchar_255_ resourceId FK + text content + varchar_64_ contentHash + varchar_16_ status + varchar_36_ supersededBy FK + varchar_128_ embeddingModel + json embedding + json metadata + timestamp_3__with_time_zone lastSeenAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_memory_entry_sources" { + varchar_36_ id + varchar_36_ agentId FK + varchar_36_ memoryEntryId FK + varchar_36_ observationId FK + varchar_255_ threadId FK + varchar_64_ evidenceHash + text evidenceText + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents" { + varchar_36_ id + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + json integrations + json schema + json tools + json skills + varchar_36_ versionId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ activeVersionId FK +} +"public.agents_resources" { + varchar_255_ id + text metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agents_memory_entry_cursors.md b/docs/generated/postgres-schema/public.agents_memory_entry_cursors.md new file mode 100644 index 00000000000..f1a55ed19a5 --- /dev/null +++ b/docs/generated/postgres-schema/public.agents_memory_entry_cursors.md @@ -0,0 +1,77 @@ +# public.agents_memory_entry_cursors + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| agentId | varchar(36) | | false | | [public.agents](public.agents.md) | Agent that owns this cursor | +| observationScopeId | varchar(255) | | false | | [public.agents_threads](public.agents_threads.md) | agents_threads.id source stream indexed into episodic memory | +| lastIndexedObservationId | varchar(36) | | false | | | Last observation-log row indexed into episodic memory | +| lastIndexedObservationCreatedAt | timestamp(3) with time zone | | false | | | Creation timestamp for the last indexed observation-log row | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agents_memory_entry_cursors_agentId_not_null | n | NOT NULL "agentId" | +| agents_memory_entry_cursors_createdAt_not_null | n | NOT NULL "createdAt" | +| agents_memory_entry_cursors_lastIndexedObservationCrea_not_null | n | NOT NULL "lastIndexedObservationCreatedAt" | +| agents_memory_entry_cursors_lastIndexedObservationId_not_null | n | NOT NULL "lastIndexedObservationId" | +| agents_memory_entry_cursors_observationScopeId_not_null | n | NOT NULL "observationScopeId" | +| agents_memory_entry_cursors_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_746780fd115e5e4352457a3c617 | FOREIGN KEY | FOREIGN KEY ("agentId") REFERENCES agents(id) ON DELETE CASCADE | +| PK_b31a1d5c009a27f4cc5ef8f102a | PRIMARY KEY | PRIMARY KEY ("agentId", "observationScopeId") | +| FK_069e791e428391a5569e7a96b20 | FOREIGN KEY | FOREIGN KEY ("observationScopeId") REFERENCES agents_threads(id) ON DELETE CASCADE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_b31a1d5c009a27f4cc5ef8f102a | CREATE UNIQUE INDEX "PK_b31a1d5c009a27f4cc5ef8f102a" ON public.agents_memory_entry_cursors USING btree ("agentId", "observationScopeId") | +| IDX_069e791e428391a5569e7a96b2 | CREATE INDEX "IDX_069e791e428391a5569e7a96b2" ON public.agents_memory_entry_cursors USING btree ("observationScopeId") | + +## Relations + +```mermaid +erDiagram + +"public.agents_memory_entry_cursors" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_memory_entry_cursors" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" + +"public.agents_memory_entry_cursors" { + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_36_ lastIndexedObservationId + timestamp_3__with_time_zone lastIndexedObservationCreatedAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents" { + varchar_36_ id + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + json integrations + json schema + json tools + json skills + varchar_36_ versionId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ activeVersionId FK +} +"public.agents_threads" { + varchar_128_ id + varchar_255_ resourceId + varchar_255_ title + text metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agents_memory_entry_locks.md b/docs/generated/postgres-schema/public.agents_memory_entry_locks.md new file mode 100644 index 00000000000..7b5eacf4b06 --- /dev/null +++ b/docs/generated/postgres-schema/public.agents_memory_entry_locks.md @@ -0,0 +1,75 @@ +# public.agents_memory_entry_locks + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| agentId | varchar(36) | | false | | [public.agents](public.agents.md) | Agent that owns this lock | +| resourceId | varchar(255) | | false | | [public.agents_resources](public.agents_resources.md) | agents_resources.id partition locked for episodic indexing | +| holderId | varchar(64) | | false | | | Ephemeral background-task lock owner token | +| heldUntil | timestamp(3) with time zone | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agents_memory_entry_locks_agentId_not_null | n | NOT NULL "agentId" | +| agents_memory_entry_locks_createdAt_not_null | n | NOT NULL "createdAt" | +| agents_memory_entry_locks_heldUntil_not_null | n | NOT NULL "heldUntil" | +| agents_memory_entry_locks_holderId_not_null | n | NOT NULL "holderId" | +| agents_memory_entry_locks_resourceId_not_null | n | NOT NULL "resourceId" | +| agents_memory_entry_locks_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_0ccf6d9ea6f44fa1c264fc2f795 | FOREIGN KEY | FOREIGN KEY ("agentId") REFERENCES agents(id) ON DELETE CASCADE | +| FK_9594c0983cfee1c8ff49b05848b | FOREIGN KEY | FOREIGN KEY ("resourceId") REFERENCES agents_resources(id) ON DELETE CASCADE | +| PK_a8e0f570d04a174292bea104ae6 | PRIMARY KEY | PRIMARY KEY ("agentId", "resourceId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_a8e0f570d04a174292bea104ae6 | CREATE UNIQUE INDEX "PK_a8e0f570d04a174292bea104ae6" ON public.agents_memory_entry_locks USING btree ("agentId", "resourceId") | +| IDX_9594c0983cfee1c8ff49b05848 | CREATE INDEX "IDX_9594c0983cfee1c8ff49b05848" ON public.agents_memory_entry_locks USING btree ("resourceId") | + +## Relations + +```mermaid +erDiagram + +"public.agents_memory_entry_locks" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_memory_entry_locks" }o--|| "public.agents_resources" : "FOREIGN KEY (#quot;resourceId#quot;) REFERENCES agents_resources(id) ON DELETE CASCADE" + +"public.agents_memory_entry_locks" { + varchar_36_ agentId FK + varchar_255_ resourceId FK + varchar_64_ holderId + timestamp_3__with_time_zone heldUntil + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents" { + varchar_36_ id + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + json integrations + json schema + json tools + json skills + varchar_36_ versionId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ activeVersionId FK +} +"public.agents_resources" { + varchar_255_ id + text metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agents_memory_entry_sources.md b/docs/generated/postgres-schema/public.agents_memory_entry_sources.md new file mode 100644 index 00000000000..8aa4fff11a8 --- /dev/null +++ b/docs/generated/postgres-schema/public.agents_memory_entry_sources.md @@ -0,0 +1,121 @@ +# public.agents_memory_entry_sources + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| agentId | varchar(36) | | false | | [public.agents](public.agents.md) | Agent that owns the linked episodic memory entry source | +| memoryEntryId | varchar(36) | | false | | [public.agents_memory_entries](public.agents_memory_entries.md) | Episodic memory entry linked to this source evidence | +| observationId | varchar(36) | | false | | [public.agents_observations](public.agents_observations.md) | Observation-log row used as source evidence | +| threadId | varchar(255) | | false | | [public.agents_threads](public.agents_threads.md) | Source conversation thread that produced the linked observation | +| evidenceHash | varchar(64) | | false | | | Bounded hash used to deduplicate exact evidence links | +| evidenceText | text | | false | | | Exact source evidence text from the observation, not recall scope | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agents_memory_entry_sources_agentId_not_null | n | NOT NULL "agentId" | +| agents_memory_entry_sources_createdAt_not_null | n | NOT NULL "createdAt" | +| agents_memory_entry_sources_evidenceHash_not_null | n | NOT NULL "evidenceHash" | +| agents_memory_entry_sources_evidenceText_not_null | n | NOT NULL "evidenceText" | +| agents_memory_entry_sources_id_not_null | n | NOT NULL id | +| agents_memory_entry_sources_memoryEntryId_not_null | n | NOT NULL "memoryEntryId" | +| agents_memory_entry_sources_observationId_not_null | n | NOT NULL "observationId" | +| agents_memory_entry_sources_threadId_not_null | n | NOT NULL "threadId" | +| agents_memory_entry_sources_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_c38e8a57a36b880e39a52ada2e8 | FOREIGN KEY | FOREIGN KEY ("agentId") REFERENCES agents(id) ON DELETE CASCADE | +| FK_cb7c15d22fd068a0806aa57fc03 | FOREIGN KEY | FOREIGN KEY ("observationId") REFERENCES agents_observations(id) ON DELETE CASCADE | +| FK_4706f6223313959b7437a2b48df | FOREIGN KEY | FOREIGN KEY ("memoryEntryId") REFERENCES agents_memory_entries(id) ON DELETE CASCADE | +| PK_278f05e98e74baaaa93f52b4bab | PRIMARY KEY | PRIMARY KEY (id) | +| FK_451d387a182fa8dd8002dfc3a77 | FOREIGN KEY | FOREIGN KEY ("threadId") REFERENCES agents_threads(id) ON DELETE CASCADE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_278f05e98e74baaaa93f52b4bab | CREATE UNIQUE INDEX "PK_278f05e98e74baaaa93f52b4bab" ON public.agents_memory_entry_sources USING btree (id) | +| IDX_a353ac251315ef0af6ad3c9f0a | CREATE UNIQUE INDEX "IDX_a353ac251315ef0af6ad3c9f0a" ON public.agents_memory_entry_sources USING btree ("memoryEntryId", "observationId", "evidenceHash") | +| IDX_cb7c15d22fd068a0806aa57fc0 | CREATE INDEX "IDX_cb7c15d22fd068a0806aa57fc0" ON public.agents_memory_entry_sources USING btree ("observationId") | +| IDX_f9573af4ed653f13b0ba1f7b12 | CREATE INDEX "IDX_f9573af4ed653f13b0ba1f7b12" ON public.agents_memory_entry_sources USING btree ("agentId", "threadId") | +| IDX_451d387a182fa8dd8002dfc3a7 | CREATE INDEX "IDX_451d387a182fa8dd8002dfc3a7" ON public.agents_memory_entry_sources USING btree ("threadId") | + +## Relations + +```mermaid +erDiagram + +"public.agents_memory_entry_sources" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_memory_entry_sources" }o--|| "public.agents_memory_entries" : "FOREIGN KEY (#quot;memoryEntryId#quot;) REFERENCES agents_memory_entries(id) ON DELETE CASCADE" +"public.agents_memory_entry_sources" }o--|| "public.agents_observations" : "FOREIGN KEY (#quot;observationId#quot;) REFERENCES agents_observations(id) ON DELETE CASCADE" +"public.agents_memory_entry_sources" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" + +"public.agents_memory_entry_sources" { + varchar_36_ id + varchar_36_ agentId FK + varchar_36_ memoryEntryId FK + varchar_36_ observationId FK + varchar_255_ threadId FK + varchar_64_ evidenceHash + text evidenceText + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents" { + varchar_36_ id + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + json integrations + json schema + json tools + json skills + varchar_36_ versionId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ activeVersionId FK +} +"public.agents_memory_entries" { + varchar_36_ id + varchar_36_ agentId FK + varchar_255_ resourceId FK + text content + varchar_64_ contentHash + varchar_16_ status + varchar_36_ supersededBy FK + varchar_128_ embeddingModel + json embedding + json metadata + timestamp_3__with_time_zone lastSeenAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_observations" { + varchar_36_ id + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_16_ marker + text text + varchar_36_ parentId FK + integer tokenCount + varchar_16_ status + varchar_36_ supersededBy FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_threads" { + varchar_128_ id + varchar_255_ resourceId + varchar_255_ title + text metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agents_messages.md b/docs/generated/postgres-schema/public.agents_messages.md new file mode 100644 index 00000000000..9b884026283 --- /dev/null +++ b/docs/generated/postgres-schema/public.agents_messages.md @@ -0,0 +1,67 @@ +# public.agents_messages + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| threadId | varchar(255) | | false | | [public.agents_threads](public.agents_threads.md) | | +| resourceId | varchar(255) | | false | | | | +| role | varchar(36) | | false | | | | +| type | varchar(36) | | true | | | | +| content | json | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agents_messages_content_not_null | n | NOT NULL content | +| agents_messages_createdAt_not_null | n | NOT NULL "createdAt" | +| agents_messages_id_not_null | n | NOT NULL id | +| agents_messages_resourceId_not_null | n | NOT NULL "resourceId" | +| agents_messages_role_not_null | n | NOT NULL role | +| agents_messages_threadId_not_null | n | NOT NULL "threadId" | +| agents_messages_updatedAt_not_null | n | NOT NULL "updatedAt" | +| PK_81020dc608dfb0af1ede386d907 | PRIMARY KEY | PRIMARY KEY (id) | +| FK_0a8057a61afabd2999608ffd0d9 | FOREIGN KEY | FOREIGN KEY ("threadId") REFERENCES agents_threads(id) ON DELETE CASCADE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_81020dc608dfb0af1ede386d907 | CREATE UNIQUE INDEX "PK_81020dc608dfb0af1ede386d907" ON public.agents_messages USING btree (id) | +| IDX_fc7bf858660bfafd19181e8e35 | CREATE INDEX "IDX_fc7bf858660bfafd19181e8e35" ON public.agents_messages USING btree ("threadId", "createdAt") | +| IDX_agents_messages_threadId_createdAt | CREATE INDEX "IDX_agents_messages_threadId_createdAt" ON public.agents_messages USING btree ("threadId", "createdAt") | + +## Relations + +```mermaid +erDiagram + +"public.agents_messages" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" + +"public.agents_messages" { + varchar_36_ id + varchar_255_ threadId FK + varchar_255_ resourceId + varchar_36_ role + varchar_36_ type + json content + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_threads" { + varchar_128_ id + varchar_255_ resourceId + varchar_255_ title + text metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agents_observation_cursors.md b/docs/generated/postgres-schema/public.agents_observation_cursors.md new file mode 100644 index 00000000000..2636ec4c849 --- /dev/null +++ b/docs/generated/postgres-schema/public.agents_observation_cursors.md @@ -0,0 +1,77 @@ +# public.agents_observation_cursors + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| agentId | varchar(36) | | false | | [public.agents](public.agents.md) | Agent that owns this cursor | +| observationScopeId | varchar(255) | | false | | [public.agents_threads](public.agents_threads.md) | agents_threads.id source stream checkpointed by this cursor | +| lastObservedMessageId | varchar(36) | | false | | | | +| lastObservedAt | timestamp(3) with time zone | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agents_observation_cursors_agentId_not_null | n | NOT NULL "agentId" | +| agents_observation_cursors_createdAt_not_null | n | NOT NULL "createdAt" | +| agents_observation_cursors_lastObservedAt_not_null | n | NOT NULL "lastObservedAt" | +| agents_observation_cursors_lastObservedMessageId_not_null | n | NOT NULL "lastObservedMessageId" | +| agents_observation_cursors_observationScopeId_not_null | n | NOT NULL "observationScopeId" | +| agents_observation_cursors_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_64e92819f4b413661ed6e2c3c3d | FOREIGN KEY | FOREIGN KEY ("agentId") REFERENCES agents(id) ON DELETE CASCADE | +| PK_eb777ac57ab872d38f8ebd19317 | PRIMARY KEY | PRIMARY KEY ("agentId", "observationScopeId") | +| FK_87aa187d27ea67eafd164905154 | FOREIGN KEY | FOREIGN KEY ("observationScopeId") REFERENCES agents_threads(id) ON DELETE CASCADE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_eb777ac57ab872d38f8ebd19317 | CREATE UNIQUE INDEX "PK_eb777ac57ab872d38f8ebd19317" ON public.agents_observation_cursors USING btree ("agentId", "observationScopeId") | +| IDX_87aa187d27ea67eafd16490515 | CREATE INDEX "IDX_87aa187d27ea67eafd16490515" ON public.agents_observation_cursors USING btree ("observationScopeId") | + +## Relations + +```mermaid +erDiagram + +"public.agents_observation_cursors" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_observation_cursors" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" + +"public.agents_observation_cursors" { + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_36_ lastObservedMessageId + timestamp_3__with_time_zone lastObservedAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents" { + varchar_36_ id + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + json integrations + json schema + json tools + json skills + varchar_36_ versionId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ activeVersionId FK +} +"public.agents_threads" { + varchar_128_ id + varchar_255_ resourceId + varchar_255_ title + text metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agents_observation_locks.md b/docs/generated/postgres-schema/public.agents_observation_locks.md new file mode 100644 index 00000000000..968a44b6034 --- /dev/null +++ b/docs/generated/postgres-schema/public.agents_observation_locks.md @@ -0,0 +1,81 @@ +# public.agents_observation_locks + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| agentId | varchar(36) | | false | | [public.agents](public.agents.md) | Agent that owns this lock | +| observationScopeId | varchar(255) | | false | | [public.agents_threads](public.agents_threads.md) | agents_threads.id source stream locked for observation tasks | +| taskKind | varchar(20) | | false | | | | +| holderId | varchar(64) | | false | | | Ephemeral background-task lock owner token, not a user ID | +| heldUntil | timestamp(3) with time zone | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| CHK_agents_observation_locks_taskKind | CHECK | CHECK ((("taskKind")::text = ANY ((ARRAY['observer'::character varying, 'reflector'::character varying])::text[]))) | +| agents_observation_locks_agentId_not_null | n | NOT NULL "agentId" | +| agents_observation_locks_createdAt_not_null | n | NOT NULL "createdAt" | +| agents_observation_locks_heldUntil_not_null | n | NOT NULL "heldUntil" | +| agents_observation_locks_holderId_not_null | n | NOT NULL "holderId" | +| agents_observation_locks_observationScopeId_not_null | n | NOT NULL "observationScopeId" | +| agents_observation_locks_taskKind_not_null | n | NOT NULL "taskKind" | +| agents_observation_locks_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_093e44ae20f2518e97d83a95433 | FOREIGN KEY | FOREIGN KEY ("agentId") REFERENCES agents(id) ON DELETE CASCADE | +| PK_7e2e315162ac3d80587e15ac2c3 | PRIMARY KEY | PRIMARY KEY ("agentId", "observationScopeId", "taskKind") | +| FK_6b55089892e447c2f82e5ec60ed | FOREIGN KEY | FOREIGN KEY ("observationScopeId") REFERENCES agents_threads(id) ON DELETE CASCADE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_7e2e315162ac3d80587e15ac2c3 | CREATE UNIQUE INDEX "PK_7e2e315162ac3d80587e15ac2c3" ON public.agents_observation_locks USING btree ("agentId", "observationScopeId", "taskKind") | +| IDX_6b55089892e447c2f82e5ec60e | CREATE INDEX "IDX_6b55089892e447c2f82e5ec60e" ON public.agents_observation_locks USING btree ("observationScopeId") | + +## Relations + +```mermaid +erDiagram + +"public.agents_observation_locks" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_observation_locks" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" + +"public.agents_observation_locks" { + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_20_ taskKind + varchar_64_ holderId + timestamp_3__with_time_zone heldUntil + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents" { + varchar_36_ id + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + json integrations + json schema + json tools + json skills + varchar_36_ versionId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ activeVersionId FK +} +"public.agents_threads" { + varchar_128_ id + varchar_255_ resourceId + varchar_255_ title + text metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agents_observations.md b/docs/generated/postgres-schema/public.agents_observations.md new file mode 100644 index 00000000000..caba3bb3117 --- /dev/null +++ b/docs/generated/postgres-schema/public.agents_observations.md @@ -0,0 +1,111 @@ +# public.agents_observations + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [public.agents_observations](public.agents_observations.md) [public.agents_memory_entry_sources](public.agents_memory_entry_sources.md) | | Application-generated n8n string ID, not a database UUID | +| agentId | varchar(36) | | false | | [public.agents](public.agents.md) | Agent that owns this observation row | +| observationScopeId | varchar(255) | | false | | [public.agents_threads](public.agents_threads.md) | agents_threads.id source stream for this observation log | +| marker | varchar(16) | | false | | | | +| text | text | | false | | | | +| parentId | varchar(36) | | true | | [public.agents_observations](public.agents_observations.md) | | +| tokenCount | integer | 0 | false | | | | +| status | varchar(16) | | false | | | | +| supersededBy | varchar(36) | | true | | [public.agents_observations](public.agents_observations.md) | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| CHK_agents_observations_marker | CHECK | CHECK (((marker)::text = ANY ((ARRAY['critical'::character varying, 'important'::character varying, 'info'::character varying, 'completion'::character varying])::text[]))) | +| CHK_agents_observations_status | CHECK | CHECK (((status)::text = ANY ((ARRAY['active'::character varying, 'superseded'::character varying, 'dropped'::character varying])::text[]))) | +| agents_observations_agentId_not_null | n | NOT NULL "agentId" | +| agents_observations_createdAt_not_null | n | NOT NULL "createdAt" | +| agents_observations_id_not_null | n | NOT NULL id | +| agents_observations_marker_not_null | n | NOT NULL marker | +| agents_observations_observationScopeId_not_null | n | NOT NULL "observationScopeId" | +| agents_observations_status_not_null | n | NOT NULL status | +| agents_observations_text_not_null | n | NOT NULL text | +| agents_observations_tokenCount_not_null | n | NOT NULL "tokenCount" | +| agents_observations_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_d206432be97b7ed88d187479b1b | FOREIGN KEY | FOREIGN KEY ("agentId") REFERENCES agents(id) ON DELETE CASCADE | +| FK_127ee1078ffa952bb37b511efad | FOREIGN KEY | FOREIGN KEY ("supersededBy") REFERENCES agents_observations(id) | +| FK_501e2d1701a10e24fb69ab5fc5f | FOREIGN KEY | FOREIGN KEY ("parentId") REFERENCES agents_observations(id) | +| PK_9ad319654d12c2649f7caf27135 | PRIMARY KEY | PRIMARY KEY (id) | +| FK_4cfd8a70ebb0a5b0cf047dca3cf | FOREIGN KEY | FOREIGN KEY ("observationScopeId") REFERENCES agents_threads(id) ON DELETE CASCADE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_9ad319654d12c2649f7caf27135 | CREATE UNIQUE INDEX "PK_9ad319654d12c2649f7caf27135" ON public.agents_observations USING btree (id) | +| IDX_07cb1e4a302629c5fa5d74d2bb | CREATE INDEX "IDX_07cb1e4a302629c5fa5d74d2bb" ON public.agents_observations USING btree ("agentId", "observationScopeId", status) | +| IDX_4cfd8a70ebb0a5b0cf047dca3c | CREATE INDEX "IDX_4cfd8a70ebb0a5b0cf047dca3c" ON public.agents_observations USING btree ("observationScopeId") | +| IDX_501e2d1701a10e24fb69ab5fc5 | CREATE INDEX "IDX_501e2d1701a10e24fb69ab5fc5" ON public.agents_observations USING btree ("parentId") | +| IDX_127ee1078ffa952bb37b511efa | CREATE INDEX "IDX_127ee1078ffa952bb37b511efa" ON public.agents_observations USING btree ("supersededBy") | + +## Relations + +```mermaid +erDiagram + +"public.agents_observations" }o--o| "public.agents_observations" : "FOREIGN KEY (#quot;supersededBy#quot;) REFERENCES agents_observations(id)" +"public.agents_observations" }o--o| "public.agents_observations" : "FOREIGN KEY (#quot;parentId#quot;) REFERENCES agents_observations(id)" +"public.agents_memory_entry_sources" }o--|| "public.agents_observations" : "FOREIGN KEY (#quot;observationId#quot;) REFERENCES agents_observations(id) ON DELETE CASCADE" +"public.agents_observations" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE" +"public.agents_observations" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" + +"public.agents_observations" { + varchar_36_ id + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_16_ marker + text text + varchar_36_ parentId FK + integer tokenCount + varchar_16_ status + varchar_36_ supersededBy FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_memory_entry_sources" { + varchar_36_ id + varchar_36_ agentId FK + varchar_36_ memoryEntryId FK + varchar_36_ observationId FK + varchar_255_ threadId FK + varchar_64_ evidenceHash + text evidenceText + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents" { + varchar_36_ id + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + json integrations + json schema + json tools + json skills + varchar_36_ versionId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ activeVersionId FK +} +"public.agents_threads" { + varchar_128_ id + varchar_255_ resourceId + varchar_255_ title + text metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agents_resources.md b/docs/generated/postgres-schema/public.agents_resources.md new file mode 100644 index 00000000000..71627242b85 --- /dev/null +++ b/docs/generated/postgres-schema/public.agents_resources.md @@ -0,0 +1,68 @@ +# public.agents_resources + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(255) | | false | [public.agents_memory_entries](public.agents_memory_entries.md) [public.agents_memory_entry_locks](public.agents_memory_entry_locks.md) | | | +| metadata | text | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agents_resources_createdAt_not_null | n | NOT NULL "createdAt" | +| agents_resources_id_not_null | n | NOT NULL id | +| agents_resources_updatedAt_not_null | n | NOT NULL "updatedAt" | +| PK_fa6b20b2d31a9991529dbf8ef7d | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_fa6b20b2d31a9991529dbf8ef7d | CREATE UNIQUE INDEX "PK_fa6b20b2d31a9991529dbf8ef7d" ON public.agents_resources USING btree (id) | + +## Relations + +```mermaid +erDiagram + +"public.agents_memory_entries" }o--|| "public.agents_resources" : "FOREIGN KEY (#quot;resourceId#quot;) REFERENCES agents_resources(id) ON DELETE CASCADE" +"public.agents_memory_entry_locks" }o--|| "public.agents_resources" : "FOREIGN KEY (#quot;resourceId#quot;) REFERENCES agents_resources(id) ON DELETE CASCADE" + +"public.agents_resources" { + varchar_255_ id + text metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_memory_entries" { + varchar_36_ id + varchar_36_ agentId FK + varchar_255_ resourceId FK + text content + varchar_64_ contentHash + varchar_16_ status + varchar_36_ supersededBy FK + varchar_128_ embeddingModel + json embedding + json metadata + timestamp_3__with_time_zone lastSeenAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_memory_entry_locks" { + varchar_36_ agentId FK + varchar_255_ resourceId FK + varchar_64_ holderId + timestamp_3__with_time_zone heldUntil + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.agents_threads.md b/docs/generated/postgres-schema/public.agents_threads.md new file mode 100644 index 00000000000..71b84c19260 --- /dev/null +++ b/docs/generated/postgres-schema/public.agents_threads.md @@ -0,0 +1,114 @@ +# public.agents_threads + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(128) | | false | [public.agents_messages](public.agents_messages.md) [public.agents_observations](public.agents_observations.md) [public.agents_observation_cursors](public.agents_observation_cursors.md) [public.agents_observation_locks](public.agents_observation_locks.md) [public.agents_memory_entry_sources](public.agents_memory_entry_sources.md) [public.agents_memory_entry_cursors](public.agents_memory_entry_cursors.md) | | | +| resourceId | varchar(255) | | false | | | | +| title | varchar(255) | | true | | | | +| metadata | text | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agents_threads_createdAt_not_null | n | NOT NULL "createdAt" | +| agents_threads_id_not_null | n | NOT NULL id | +| agents_threads_resourceId_not_null | n | NOT NULL "resourceId" | +| agents_threads_updatedAt_not_null | n | NOT NULL "updatedAt" | +| PK_4a3feb0a13ffe315c009cce64e5 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_54fa1b94f34a409beafae567a4 | CREATE INDEX "IDX_54fa1b94f34a409beafae567a4" ON public.agents_threads USING btree ("resourceId") | +| PK_4a3feb0a13ffe315c009cce64e5 | CREATE UNIQUE INDEX "PK_4a3feb0a13ffe315c009cce64e5" ON public.agents_threads USING btree (id) | + +## Relations + +```mermaid +erDiagram + +"public.agents_messages" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" +"public.agents_observations" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" +"public.agents_observation_cursors" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" +"public.agents_observation_locks" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" +"public.agents_memory_entry_sources" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" +"public.agents_memory_entry_cursors" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE" + +"public.agents_threads" { + varchar_128_ id + varchar_255_ resourceId + varchar_255_ title + text metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_messages" { + varchar_36_ id + varchar_255_ threadId FK + varchar_255_ resourceId + varchar_36_ role + varchar_36_ type + json content + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_observations" { + varchar_36_ id + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_16_ marker + text text + varchar_36_ parentId FK + integer tokenCount + varchar_16_ status + varchar_36_ supersededBy FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_observation_cursors" { + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_36_ lastObservedMessageId + timestamp_3__with_time_zone lastObservedAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_observation_locks" { + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_20_ taskKind + varchar_64_ holderId + timestamp_3__with_time_zone heldUntil + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_memory_entry_sources" { + varchar_36_ id + varchar_36_ agentId FK + varchar_36_ memoryEntryId FK + varchar_36_ observationId FK + varchar_255_ threadId FK + varchar_64_ evidenceHash + text evidenceText + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agents_memory_entry_cursors" { + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_36_ lastIndexedObservationId + timestamp_3__with_time_zone lastIndexedObservationCreatedAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.ai_builder_temporary_workflow.md b/docs/generated/postgres-schema/public.ai_builder_temporary_workflow.md new file mode 100644 index 00000000000..30b4a3b4e5e --- /dev/null +++ b/docs/generated/postgres-schema/public.ai_builder_temporary_workflow.md @@ -0,0 +1,80 @@ +# public.ai_builder_temporary_workflow + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| workflowId | varchar(36) | | false | | [public.workflow_entity](public.workflow_entity.md) | | +| threadId | uuid | | false | | [public.instance_ai_threads](public.instance_ai_threads.md) | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| ai_builder_temporary_workflow_createdAt_not_null | n | NOT NULL "createdAt" | +| ai_builder_temporary_workflow_threadId_not_null | n | NOT NULL "threadId" | +| ai_builder_temporary_workflow_updatedAt_not_null | n | NOT NULL "updatedAt" | +| ai_builder_temporary_workflow_workflowId_not_null | n | NOT NULL "workflowId" | +| FK_85a87a1ba0f61999fe11dc56325 | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE CASCADE | +| FK_39b07732e819fb561d74c38763f | FOREIGN KEY | FOREIGN KEY ("threadId") REFERENCES instance_ai_threads(id) ON DELETE CASCADE | +| PK_85a87a1ba0f61999fe11dc56325 | PRIMARY KEY | PRIMARY KEY ("workflowId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_85a87a1ba0f61999fe11dc56325 | CREATE UNIQUE INDEX "PK_85a87a1ba0f61999fe11dc56325" ON public.ai_builder_temporary_workflow USING btree ("workflowId") | +| IDX_39b07732e819fb561d74c38763 | CREATE INDEX "IDX_39b07732e819fb561d74c38763" ON public.ai_builder_temporary_workflow USING btree ("threadId") | + +## Relations + +```mermaid +erDiagram + +"public.ai_builder_temporary_workflow" |o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.ai_builder_temporary_workflow" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + +"public.ai_builder_temporary_workflow" { + varchar_36_ workflowId FK + uuid threadId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +"public.instance_ai_threads" { + uuid id + varchar_255_ resourceId + text title + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ projectId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.annotation_tag_entity.md b/docs/generated/postgres-schema/public.annotation_tag_entity.md new file mode 100644 index 00000000000..8b89db6576d --- /dev/null +++ b/docs/generated/postgres-schema/public.annotation_tag_entity.md @@ -0,0 +1,50 @@ +# public.annotation_tag_entity + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(16) | | false | [public.execution_annotation_tags](public.execution_annotation_tags.md) | | | +| name | varchar(24) | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| annotation_tag_entity_createdAt_not_null | n | NOT NULL "createdAt" | +| annotation_tag_entity_id_not_null | n | NOT NULL id | +| annotation_tag_entity_name_not_null | n | NOT NULL name | +| annotation_tag_entity_updatedAt_not_null | n | NOT NULL "updatedAt" | +| PK_69dfa041592c30bbc0d4b84aa00 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_69dfa041592c30bbc0d4b84aa00 | CREATE UNIQUE INDEX "PK_69dfa041592c30bbc0d4b84aa00" ON public.annotation_tag_entity USING btree (id) | +| IDX_ae51b54c4bb430cf92f48b623f | CREATE UNIQUE INDEX "IDX_ae51b54c4bb430cf92f48b623f" ON public.annotation_tag_entity USING btree (name) | + +## Relations + +```mermaid +erDiagram + +"public.execution_annotation_tags" }o--|| "public.annotation_tag_entity" : "FOREIGN KEY (#quot;tagId#quot;) REFERENCES annotation_tag_entity(id) ON DELETE CASCADE" + +"public.annotation_tag_entity" { + varchar_16_ id + varchar_24_ name + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.execution_annotation_tags" { + integer annotationId FK + varchar_24_ tagId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.auth_identity.md b/docs/generated/postgres-schema/public.auth_identity.md new file mode 100644 index 00000000000..f38a1aac548 --- /dev/null +++ b/docs/generated/postgres-schema/public.auth_identity.md @@ -0,0 +1,65 @@ +# public.auth_identity + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| userId | uuid | | true | | [public.user](public.user.md) | | +| providerId | varchar(255) | | false | | | | +| providerType | varchar(32) | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| auth_identity_createdAt_not_null | n | NOT NULL "createdAt" | +| auth_identity_providerId_not_null | n | NOT NULL "providerId" | +| auth_identity_providerType_not_null | n | NOT NULL "providerType" | +| auth_identity_updatedAt_not_null | n | NOT NULL "updatedAt" | +| auth_identity_userId_fkey | FOREIGN KEY | FOREIGN KEY ("userId") REFERENCES "user"(id) | +| auth_identity_pkey | PRIMARY KEY | PRIMARY KEY ("providerId", "providerType") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| auth_identity_pkey | CREATE UNIQUE INDEX auth_identity_pkey ON public.auth_identity USING btree ("providerId", "providerType") | + +## Relations + +```mermaid +erDiagram + +"public.auth_identity" }o--o| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id)" + +"public.auth_identity" { + uuid userId FK + varchar_255_ providerId + varchar_32_ providerType + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.auth_provider_sync_history.md b/docs/generated/postgres-schema/public.auth_provider_sync_history.md new file mode 100644 index 00000000000..7213ca01b15 --- /dev/null +++ b/docs/generated/postgres-schema/public.auth_provider_sync_history.md @@ -0,0 +1,64 @@ +# public.auth_provider_sync_history + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | integer | nextval('auth_provider_sync_history_id_seq'::regclass) | false | | | | +| providerType | varchar(32) | | false | | | | +| runMode | text | | false | | | | +| status | text | | false | | | | +| startedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP | false | | | | +| endedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP | false | | | | +| scanned | integer | | false | | | | +| created | integer | | false | | | | +| updated | integer | | false | | | | +| disabled | integer | | false | | | | +| error | text | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| auth_provider_sync_history_created_not_null | n | NOT NULL created | +| auth_provider_sync_history_disabled_not_null | n | NOT NULL disabled | +| auth_provider_sync_history_endedAt_not_null | n | NOT NULL "endedAt" | +| auth_provider_sync_history_id_not_null | n | NOT NULL id | +| auth_provider_sync_history_providerType_not_null | n | NOT NULL "providerType" | +| auth_provider_sync_history_runMode_not_null | n | NOT NULL "runMode" | +| auth_provider_sync_history_scanned_not_null | n | NOT NULL scanned | +| auth_provider_sync_history_startedAt_not_null | n | NOT NULL "startedAt" | +| auth_provider_sync_history_status_not_null | n | NOT NULL status | +| auth_provider_sync_history_updated_not_null | n | NOT NULL updated | +| auth_provider_sync_history_pkey | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| auth_provider_sync_history_pkey | CREATE UNIQUE INDEX auth_provider_sync_history_pkey ON public.auth_provider_sync_history USING btree (id) | + +## Relations + +```mermaid +erDiagram + + +"public.auth_provider_sync_history" { + integer id + varchar_32_ providerType + text runMode + text status + timestamp_3__with_time_zone startedAt + timestamp_3__with_time_zone endedAt + integer scanned + integer created + integer updated + integer disabled + text error +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.binary_data.md b/docs/generated/postgres-schema/public.binary_data.md new file mode 100644 index 00000000000..5dd15b6a717 --- /dev/null +++ b/docs/generated/postgres-schema/public.binary_data.md @@ -0,0 +1,59 @@ +# public.binary_data + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| fileId | uuid | | false | | | | +| sourceType | varchar(50) | | false | | | Source the file belongs to, e.g. 'execution' | +| sourceId | varchar(255) | | false | | | ID of the source, e.g. execution ID | +| data | bytea | | false | | | Raw, not base64 encoded | +| mimeType | varchar(255) | | true | | | | +| fileName | varchar(255) | | true | | | | +| fileSize | integer | | false | | | In bytes | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| CHK_binary_data_sourceType | CHECK | CHECK ((("sourceType")::text = ANY ((ARRAY['execution'::character varying, 'chat_message_attachment'::character varying, 'agent_file'::character varying])::text[]))) | +| binary_data_createdAt_not_null | n | NOT NULL "createdAt" | +| binary_data_data_not_null | n | NOT NULL data | +| binary_data_fileId_not_null | n | NOT NULL "fileId" | +| binary_data_fileSize_not_null | n | NOT NULL "fileSize" | +| binary_data_sourceId_not_null | n | NOT NULL "sourceId" | +| binary_data_sourceType_not_null | n | NOT NULL "sourceType" | +| binary_data_updatedAt_not_null | n | NOT NULL "updatedAt" | +| PK_fc3691585b39408bb0551122af6 | PRIMARY KEY | PRIMARY KEY ("fileId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_fc3691585b39408bb0551122af6 | CREATE UNIQUE INDEX "PK_fc3691585b39408bb0551122af6" ON public.binary_data USING btree ("fileId") | +| IDX_56900edc3cfd16612e2ef2c6a8 | CREATE INDEX "IDX_56900edc3cfd16612e2ef2c6a8" ON public.binary_data USING btree ("sourceType", "sourceId") | + +## Relations + +```mermaid +erDiagram + + +"public.binary_data" { + uuid fileId + varchar_50_ sourceType + varchar_255_ sourceId + bytea data + varchar_255_ mimeType + varchar_255_ fileName + integer fileSize + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.chat_hub_agent_tools.md b/docs/generated/postgres-schema/public.chat_hub_agent_tools.md new file mode 100644 index 00000000000..09fb03d4896 --- /dev/null +++ b/docs/generated/postgres-schema/public.chat_hub_agent_tools.md @@ -0,0 +1,68 @@ +# public.chat_hub_agent_tools + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| agentId | uuid | | false | | [public.chat_hub_agents](public.chat_hub_agents.md) | | +| toolId | uuid | | false | | [public.chat_hub_tools](public.chat_hub_tools.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| chat_hub_agent_tools_agentId_not_null | n | NOT NULL "agentId" | +| chat_hub_agent_tools_toolId_not_null | n | NOT NULL "toolId" | +| FK_2b53d796b3dbae91b1a9553c048 | FOREIGN KEY | FOREIGN KEY ("agentId") REFERENCES chat_hub_agents(id) ON DELETE CASCADE | +| FK_43e70f04c53344f82483d0570f6 | FOREIGN KEY | FOREIGN KEY ("toolId") REFERENCES chat_hub_tools(id) ON DELETE CASCADE | +| PK_cc8806fdea48297a7d497035d72 | PRIMARY KEY | PRIMARY KEY ("agentId", "toolId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_cc8806fdea48297a7d497035d72 | CREATE UNIQUE INDEX "PK_cc8806fdea48297a7d497035d72" ON public.chat_hub_agent_tools USING btree ("agentId", "toolId") | + +## Relations + +```mermaid +erDiagram + +"public.chat_hub_agent_tools" }o--|| "public.chat_hub_agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES chat_hub_agents(id) ON DELETE CASCADE" +"public.chat_hub_agent_tools" }o--|| "public.chat_hub_tools" : "FOREIGN KEY (#quot;toolId#quot;) REFERENCES chat_hub_tools(id) ON DELETE CASCADE" + +"public.chat_hub_agent_tools" { + uuid agentId FK + uuid toolId FK +} +"public.chat_hub_agents" { + uuid id + varchar_256_ name + varchar_512_ description + text systemPrompt + uuid ownerId FK + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + json files + json suggestedPrompts +} +"public.chat_hub_tools" { + uuid id + varchar_255_ name + varchar_255_ type + double_precision typeVersion + uuid ownerId FK + json definition + boolean enabled + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.chat_hub_agents.md b/docs/generated/postgres-schema/public.chat_hub_agents.md new file mode 100644 index 00000000000..8377d382a7c --- /dev/null +++ b/docs/generated/postgres-schema/public.chat_hub_agents.md @@ -0,0 +1,143 @@ +# public.chat_hub_agents + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | uuid | | false | [public.chat_hub_sessions](public.chat_hub_sessions.md) [public.chat_hub_messages](public.chat_hub_messages.md) [public.chat_hub_agent_tools](public.chat_hub_agent_tools.md) | | | +| name | varchar(256) | | false | | | | +| description | varchar(512) | | true | | | | +| systemPrompt | text | | false | | | | +| ownerId | uuid | | false | | [public.user](public.user.md) | | +| credentialId | varchar(36) | | true | | [public.credentials_entity](public.credentials_entity.md) | | +| provider | varchar(16) | | false | | | ChatHubProvider enum: "openai", "anthropic", "google", "n8n" | +| model | varchar(64) | | false | | | Model name used at the respective Model node, ie. "gpt-4" | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| icon | json | | true | | | | +| files | json | '[]'::json | false | | | | +| suggestedPrompts | json | '[]'::json | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| chat_hub_agents_createdAt_not_null | n | NOT NULL "createdAt" | +| chat_hub_agents_files_not_null | n | NOT NULL files | +| chat_hub_agents_id_not_null | n | NOT NULL id | +| chat_hub_agents_model_not_null | n | NOT NULL model | +| chat_hub_agents_name_not_null | n | NOT NULL name | +| chat_hub_agents_ownerId_not_null | n | NOT NULL "ownerId" | +| chat_hub_agents_provider_not_null | n | NOT NULL provider | +| chat_hub_agents_suggestedPrompts_not_null | n | NOT NULL "suggestedPrompts" | +| chat_hub_agents_systemPrompt_not_null | n | NOT NULL "systemPrompt" | +| chat_hub_agents_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_441ba2caba11e077ce3fbfa2cd8 | FOREIGN KEY | FOREIGN KEY ("ownerId") REFERENCES "user"(id) ON DELETE CASCADE | +| FK_9c61ad497dcbae499c96a6a78ba | FOREIGN KEY | FOREIGN KEY ("credentialId") REFERENCES credentials_entity(id) ON DELETE SET NULL | +| PK_f39a3b36bbdf0e2979ddb21cf78 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_f39a3b36bbdf0e2979ddb21cf78 | CREATE UNIQUE INDEX "PK_f39a3b36bbdf0e2979ddb21cf78" ON public.chat_hub_agents USING btree (id) | + +## Relations + +```mermaid +erDiagram + +"public.chat_hub_sessions" }o--o| "public.chat_hub_agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES chat_hub_agents(id) ON DELETE SET NULL" +"public.chat_hub_messages" }o--o| "public.chat_hub_agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES chat_hub_agents(id) ON DELETE SET NULL" +"public.chat_hub_agent_tools" }o--|| "public.chat_hub_agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES chat_hub_agents(id) ON DELETE CASCADE" +"public.chat_hub_agents" }o--|| "public.user" : "FOREIGN KEY (#quot;ownerId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.chat_hub_agents" }o--o| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE SET NULL" + +"public.chat_hub_agents" { + uuid id + varchar_256_ name + varchar_512_ description + text systemPrompt + uuid ownerId FK + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + json files + json suggestedPrompts +} +"public.chat_hub_sessions" { + uuid id + varchar_256_ title + uuid ownerId FK + timestamp_3__with_time_zone lastMessageAt + varchar_36_ credentialId FK + varchar_16_ provider + varchar_256_ model + varchar_36_ workflowId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + uuid agentId FK + varchar_128_ agentName + varchar_16_ type +} +"public.chat_hub_messages" { + uuid id + uuid sessionId FK + uuid previousMessageId FK + uuid revisionOfMessageId FK + uuid retryOfMessageId FK + varchar_16_ type + varchar_128_ name + text content + varchar_16_ provider + varchar_256_ model + varchar_36_ workflowId FK + integer executionId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + uuid agentId FK + varchar_16_ status + json attachments +} +"public.chat_hub_agent_tools" { + uuid agentId FK + uuid toolId FK +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"public.credentials_entity" { + varchar_128_ name + text data + varchar_128_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ id + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.chat_hub_messages.md b/docs/generated/postgres-schema/public.chat_hub_messages.md new file mode 100644 index 00000000000..42fab48c622 --- /dev/null +++ b/docs/generated/postgres-schema/public.chat_hub_messages.md @@ -0,0 +1,158 @@ +# public.chat_hub_messages + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | uuid | | false | [public.chat_hub_messages](public.chat_hub_messages.md) | | | +| sessionId | uuid | | false | | [public.chat_hub_sessions](public.chat_hub_sessions.md) | | +| previousMessageId | uuid | | true | | [public.chat_hub_messages](public.chat_hub_messages.md) | | +| revisionOfMessageId | uuid | | true | | [public.chat_hub_messages](public.chat_hub_messages.md) | | +| retryOfMessageId | uuid | | true | | [public.chat_hub_messages](public.chat_hub_messages.md) | | +| type | varchar(16) | | false | | | ChatHubMessageType enum: "human", "ai", "system", "tool", "generic" | +| name | varchar(128) | | false | | | | +| content | text | | false | | | | +| provider | varchar(16) | | true | | | ChatHubProvider enum: "openai", "anthropic", "google", "n8n" | +| model | varchar(256) | | true | | | Model name used at the respective Model node, ie. "gpt-4" | +| workflowId | varchar(36) | | true | | [public.workflow_entity](public.workflow_entity.md) | | +| executionId | integer | | true | | [public.execution_entity](public.execution_entity.md) | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| agentId | uuid | | true | | [public.chat_hub_agents](public.chat_hub_agents.md) | ID of the custom agent (if provider is "custom-agent") | +| status | varchar(16) | 'success'::character varying | false | | | ChatHubMessageStatus enum, eg. "success", "error", "running", "cancelled" | +| attachments | json | | true | | | File attachments for the message (if any), stored as JSON. Files are stored as base64-encoded data URLs. | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| chat_hub_messages_content_not_null | n | NOT NULL content | +| chat_hub_messages_createdAt_not_null | n | NOT NULL "createdAt" | +| chat_hub_messages_id_not_null | n | NOT NULL id | +| chat_hub_messages_name_not_null | n | NOT NULL name | +| chat_hub_messages_sessionId_not_null | n | NOT NULL "sessionId" | +| chat_hub_messages_status_not_null | n | NOT NULL status | +| chat_hub_messages_type_not_null | n | NOT NULL type | +| chat_hub_messages_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_6afb260449dd7a9b85355d4e0c9 | FOREIGN KEY | FOREIGN KEY ("executionId") REFERENCES execution_entity(id) ON DELETE SET NULL | +| FK_acf8926098f063cdbbad8497fd1 | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE SET NULL | +| FK_e22538eb50a71a17954cd7e076c | FOREIGN KEY | FOREIGN KEY ("sessionId") REFERENCES chat_hub_sessions(id) ON DELETE CASCADE | +| FK_1f4998c8a7dec9e00a9ab15550e | FOREIGN KEY | FOREIGN KEY ("revisionOfMessageId") REFERENCES chat_hub_messages(id) ON DELETE CASCADE | +| FK_25c9736e7f769f3a005eef4b372 | FOREIGN KEY | FOREIGN KEY ("retryOfMessageId") REFERENCES chat_hub_messages(id) ON DELETE CASCADE | +| FK_e5d1fa722c5a8d38ac204746662 | FOREIGN KEY | FOREIGN KEY ("previousMessageId") REFERENCES chat_hub_messages(id) ON DELETE CASCADE | +| PK_7704a5add6baed43eef835f0bfb | PRIMARY KEY | PRIMARY KEY (id) | +| FK_chat_hub_messages_agentId | FOREIGN KEY | FOREIGN KEY ("agentId") REFERENCES chat_hub_agents(id) ON DELETE SET NULL | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_7704a5add6baed43eef835f0bfb | CREATE UNIQUE INDEX "PK_7704a5add6baed43eef835f0bfb" ON public.chat_hub_messages USING btree (id) | +| IDX_chat_hub_messages_sessionId | CREATE INDEX "IDX_chat_hub_messages_sessionId" ON public.chat_hub_messages USING btree ("sessionId") | + +## Relations + +```mermaid +erDiagram + +"public.chat_hub_messages" }o--o| "public.chat_hub_messages" : "FOREIGN KEY (#quot;revisionOfMessageId#quot;) REFERENCES chat_hub_messages(id) ON DELETE CASCADE" +"public.chat_hub_messages" }o--o| "public.chat_hub_messages" : "FOREIGN KEY (#quot;retryOfMessageId#quot;) REFERENCES chat_hub_messages(id) ON DELETE CASCADE" +"public.chat_hub_messages" }o--o| "public.chat_hub_messages" : "FOREIGN KEY (#quot;previousMessageId#quot;) REFERENCES chat_hub_messages(id) ON DELETE CASCADE" +"public.chat_hub_messages" }o--|| "public.chat_hub_sessions" : "FOREIGN KEY (#quot;sessionId#quot;) REFERENCES chat_hub_sessions(id) ON DELETE CASCADE" +"public.chat_hub_messages" }o--o| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE SET NULL" +"public.chat_hub_messages" }o--o| "public.execution_entity" : "FOREIGN KEY (#quot;executionId#quot;) REFERENCES execution_entity(id) ON DELETE SET NULL" +"public.chat_hub_messages" }o--o| "public.chat_hub_agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES chat_hub_agents(id) ON DELETE SET NULL" + +"public.chat_hub_messages" { + uuid id + uuid sessionId FK + uuid previousMessageId FK + uuid revisionOfMessageId FK + uuid retryOfMessageId FK + varchar_16_ type + varchar_128_ name + text content + varchar_16_ provider + varchar_256_ model + varchar_36_ workflowId FK + integer executionId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + uuid agentId FK + varchar_16_ status + json attachments +} +"public.chat_hub_sessions" { + uuid id + varchar_256_ title + uuid ownerId FK + timestamp_3__with_time_zone lastMessageAt + varchar_36_ credentialId FK + varchar_16_ provider + varchar_256_ model + varchar_36_ workflowId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + uuid agentId FK + varchar_128_ agentName + varchar_16_ type +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +"public.execution_entity" { + integer id + boolean finished + varchar mode + varchar retryOf + varchar retrySuccessId + timestamp_3__with_time_zone startedAt + timestamp_3__with_time_zone stoppedAt + timestamp_3__with_time_zone waitTill + varchar status + varchar_36_ workflowId FK + timestamp_3__with_time_zone deletedAt + timestamp_3__with_time_zone createdAt + varchar_2_ storedAt + json tracingContext + varchar_255_ deduplicationKey +} +"public.chat_hub_agents" { + uuid id + varchar_256_ name + varchar_512_ description + text systemPrompt + uuid ownerId FK + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + json files + json suggestedPrompts +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.chat_hub_session_tools.md b/docs/generated/postgres-schema/public.chat_hub_session_tools.md new file mode 100644 index 00000000000..05e65c082b5 --- /dev/null +++ b/docs/generated/postgres-schema/public.chat_hub_session_tools.md @@ -0,0 +1,68 @@ +# public.chat_hub_session_tools + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| sessionId | uuid | | false | | [public.chat_hub_sessions](public.chat_hub_sessions.md) | | +| toolId | uuid | | false | | [public.chat_hub_tools](public.chat_hub_tools.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| chat_hub_session_tools_sessionId_not_null | n | NOT NULL "sessionId" | +| chat_hub_session_tools_toolId_not_null | n | NOT NULL "toolId" | +| FK_e649bf1295f4ed8d4299ed290f9 | FOREIGN KEY | FOREIGN KEY ("sessionId") REFERENCES chat_hub_sessions(id) ON DELETE CASCADE | +| FK_6596a328affd8d4967ffb303eee | FOREIGN KEY | FOREIGN KEY ("toolId") REFERENCES chat_hub_tools(id) ON DELETE CASCADE | +| PK_87aea76ff4c274c4a5ac838ebe3 | PRIMARY KEY | PRIMARY KEY ("sessionId", "toolId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_87aea76ff4c274c4a5ac838ebe3 | CREATE UNIQUE INDEX "PK_87aea76ff4c274c4a5ac838ebe3" ON public.chat_hub_session_tools USING btree ("sessionId", "toolId") | + +## Relations + +```mermaid +erDiagram + +"public.chat_hub_session_tools" }o--|| "public.chat_hub_sessions" : "FOREIGN KEY (#quot;sessionId#quot;) REFERENCES chat_hub_sessions(id) ON DELETE CASCADE" +"public.chat_hub_session_tools" }o--|| "public.chat_hub_tools" : "FOREIGN KEY (#quot;toolId#quot;) REFERENCES chat_hub_tools(id) ON DELETE CASCADE" + +"public.chat_hub_session_tools" { + uuid sessionId FK + uuid toolId FK +} +"public.chat_hub_sessions" { + uuid id + varchar_256_ title + uuid ownerId FK + timestamp_3__with_time_zone lastMessageAt + varchar_36_ credentialId FK + varchar_16_ provider + varchar_256_ model + varchar_36_ workflowId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + uuid agentId FK + varchar_128_ agentName + varchar_16_ type +} +"public.chat_hub_tools" { + uuid id + varchar_255_ name + varchar_255_ type + double_precision typeVersion + uuid ownerId FK + json definition + boolean enabled + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.chat_hub_sessions.md b/docs/generated/postgres-schema/public.chat_hub_sessions.md new file mode 100644 index 00000000000..285f828710a --- /dev/null +++ b/docs/generated/postgres-schema/public.chat_hub_sessions.md @@ -0,0 +1,167 @@ +# public.chat_hub_sessions + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | uuid | | false | [public.chat_hub_messages](public.chat_hub_messages.md) [public.chat_hub_session_tools](public.chat_hub_session_tools.md) | | | +| title | varchar(256) | | false | | | | +| ownerId | uuid | | false | | [public.user](public.user.md) | | +| lastMessageAt | timestamp(3) with time zone | | false | | | | +| credentialId | varchar(36) | | true | | [public.credentials_entity](public.credentials_entity.md) | | +| provider | varchar(16) | | true | | | ChatHubProvider enum: "openai", "anthropic", "google", "n8n" | +| model | varchar(256) | | true | | | Model name used at the respective Model node, ie. "gpt-4" | +| workflowId | varchar(36) | | true | | [public.workflow_entity](public.workflow_entity.md) | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| agentId | uuid | | true | | [public.chat_hub_agents](public.chat_hub_agents.md) | ID of the custom agent (if provider is "custom-agent") | +| agentName | varchar(128) | | true | | | Cached name of the custom agent (if provider is "custom-agent") | +| type | varchar(16) | 'production'::character varying | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| CHK_chat_hub_sessions_type | CHECK | CHECK (((type)::text = ANY ((ARRAY['production'::character varying, 'manual'::character varying])::text[]))) | +| chat_hub_sessions_createdAt_not_null | n | NOT NULL "createdAt" | +| chat_hub_sessions_id_not_null | n | NOT NULL id | +| chat_hub_sessions_lastMessageAt_not_null | n | NOT NULL "lastMessageAt" | +| chat_hub_sessions_ownerId_not_null | n | NOT NULL "ownerId" | +| chat_hub_sessions_title_not_null | n | NOT NULL title | +| chat_hub_sessions_type_not_null | n | NOT NULL type | +| chat_hub_sessions_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_e9ecf8ede7d989fcd18790fe36a | FOREIGN KEY | FOREIGN KEY ("ownerId") REFERENCES "user"(id) ON DELETE CASCADE | +| FK_9f9293d9f552496c40e0d1a8f80 | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE SET NULL | +| FK_7bc13b4c7e6afbfaf9be326c189 | FOREIGN KEY | FOREIGN KEY ("credentialId") REFERENCES credentials_entity(id) ON DELETE SET NULL | +| PK_1eafef1273c70e4464fec703412 | PRIMARY KEY | PRIMARY KEY (id) | +| FK_chat_hub_sessions_agentId | FOREIGN KEY | FOREIGN KEY ("agentId") REFERENCES chat_hub_agents(id) ON DELETE SET NULL | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_1eafef1273c70e4464fec703412 | CREATE UNIQUE INDEX "PK_1eafef1273c70e4464fec703412" ON public.chat_hub_sessions USING btree (id) | +| IDX_chat_hub_sessions_owner_lastmsg_id | CREATE INDEX "IDX_chat_hub_sessions_owner_lastmsg_id" ON public.chat_hub_sessions USING btree ("ownerId", "lastMessageAt" DESC, id) | + +## Relations + +```mermaid +erDiagram + +"public.chat_hub_messages" }o--|| "public.chat_hub_sessions" : "FOREIGN KEY (#quot;sessionId#quot;) REFERENCES chat_hub_sessions(id) ON DELETE CASCADE" +"public.chat_hub_session_tools" }o--|| "public.chat_hub_sessions" : "FOREIGN KEY (#quot;sessionId#quot;) REFERENCES chat_hub_sessions(id) ON DELETE CASCADE" +"public.chat_hub_sessions" }o--|| "public.user" : "FOREIGN KEY (#quot;ownerId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.chat_hub_sessions" }o--o| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE SET NULL" +"public.chat_hub_sessions" }o--o| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE SET NULL" +"public.chat_hub_sessions" }o--o| "public.chat_hub_agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES chat_hub_agents(id) ON DELETE SET NULL" + +"public.chat_hub_sessions" { + uuid id + varchar_256_ title + uuid ownerId FK + timestamp_3__with_time_zone lastMessageAt + varchar_36_ credentialId FK + varchar_16_ provider + varchar_256_ model + varchar_36_ workflowId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + uuid agentId FK + varchar_128_ agentName + varchar_16_ type +} +"public.chat_hub_messages" { + uuid id + uuid sessionId FK + uuid previousMessageId FK + uuid revisionOfMessageId FK + uuid retryOfMessageId FK + varchar_16_ type + varchar_128_ name + text content + varchar_16_ provider + varchar_256_ model + varchar_36_ workflowId FK + integer executionId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + uuid agentId FK + varchar_16_ status + json attachments +} +"public.chat_hub_session_tools" { + uuid sessionId FK + uuid toolId FK +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"public.credentials_entity" { + varchar_128_ name + text data + varchar_128_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ id + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +"public.chat_hub_agents" { + uuid id + varchar_256_ name + varchar_512_ description + text systemPrompt + uuid ownerId FK + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + json files + json suggestedPrompts +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.chat_hub_tools.md b/docs/generated/postgres-schema/public.chat_hub_tools.md new file mode 100644 index 00000000000..7dc2312079c --- /dev/null +++ b/docs/generated/postgres-schema/public.chat_hub_tools.md @@ -0,0 +1,89 @@ +# public.chat_hub_tools + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | uuid | | false | [public.chat_hub_session_tools](public.chat_hub_session_tools.md) [public.chat_hub_agent_tools](public.chat_hub_agent_tools.md) | | | +| name | varchar(255) | | false | | | | +| type | varchar(255) | | false | | | | +| typeVersion | double precision | | false | | | | +| ownerId | uuid | | false | | [public.user](public.user.md) | | +| definition | json | | false | | | | +| enabled | boolean | true | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| chat_hub_tools_createdAt_not_null | n | NOT NULL "createdAt" | +| chat_hub_tools_definition_not_null | n | NOT NULL definition | +| chat_hub_tools_enabled_not_null | n | NOT NULL enabled | +| chat_hub_tools_id_not_null | n | NOT NULL id | +| chat_hub_tools_name_not_null | n | NOT NULL name | +| chat_hub_tools_ownerId_not_null | n | NOT NULL "ownerId" | +| chat_hub_tools_typeVersion_not_null | n | NOT NULL "typeVersion" | +| chat_hub_tools_type_not_null | n | NOT NULL type | +| chat_hub_tools_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_b8030b47af9213f1fd15450fb7f | FOREIGN KEY | FOREIGN KEY ("ownerId") REFERENCES "user"(id) ON DELETE CASCADE | +| PK_696d26426c704fba79b2c195ef5 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_696d26426c704fba79b2c195ef5 | CREATE UNIQUE INDEX "PK_696d26426c704fba79b2c195ef5" ON public.chat_hub_tools USING btree (id) | +| IDX_4c72ebdb265d1775bf61147af0 | CREATE UNIQUE INDEX "IDX_4c72ebdb265d1775bf61147af0" ON public.chat_hub_tools USING btree ("ownerId", name) | + +## Relations + +```mermaid +erDiagram + +"public.chat_hub_session_tools" }o--|| "public.chat_hub_tools" : "FOREIGN KEY (#quot;toolId#quot;) REFERENCES chat_hub_tools(id) ON DELETE CASCADE" +"public.chat_hub_agent_tools" }o--|| "public.chat_hub_tools" : "FOREIGN KEY (#quot;toolId#quot;) REFERENCES chat_hub_tools(id) ON DELETE CASCADE" +"public.chat_hub_tools" }o--|| "public.user" : "FOREIGN KEY (#quot;ownerId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" + +"public.chat_hub_tools" { + uuid id + varchar_255_ name + varchar_255_ type + double_precision typeVersion + uuid ownerId FK + json definition + boolean enabled + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.chat_hub_session_tools" { + uuid sessionId FK + uuid toolId FK +} +"public.chat_hub_agent_tools" { + uuid agentId FK + uuid toolId FK +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.credential_dependency.md b/docs/generated/postgres-schema/public.credential_dependency.md new file mode 100644 index 00000000000..0d64ec95402 --- /dev/null +++ b/docs/generated/postgres-schema/public.credential_dependency.md @@ -0,0 +1,65 @@ +# public.credential_dependency + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | integer | | false | | | | +| credentialId | varchar(36) | | false | | [public.credentials_entity](public.credentials_entity.md) | | +| dependencyType | varchar(64) | | false | | | | +| dependencyId | varchar(255) | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| credential_dependency_createdAt_not_null | n | NOT NULL "createdAt" | +| credential_dependency_credentialId_not_null | n | NOT NULL "credentialId" | +| credential_dependency_dependencyId_not_null | n | NOT NULL "dependencyId" | +| credential_dependency_dependencyType_not_null | n | NOT NULL "dependencyType" | +| credential_dependency_id_not_null | n | NOT NULL id | +| FK_5ec8e8c8d3539f3696cf73b43bf | FOREIGN KEY | FOREIGN KEY ("credentialId") REFERENCES credentials_entity(id) ON DELETE CASCADE | +| PK_80212729ed0ffa0709417ab28f4 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_80212729ed0ffa0709417ab28f4 | CREATE UNIQUE INDEX "PK_80212729ed0ffa0709417ab28f4" ON public.credential_dependency USING btree (id) | +| IDX_5ec8e8c8d3539f3696cf73b43b | CREATE INDEX "IDX_5ec8e8c8d3539f3696cf73b43b" ON public.credential_dependency USING btree ("credentialId") | +| IDX_91ee85fa9619dd6776725e117b | CREATE INDEX "IDX_91ee85fa9619dd6776725e117b" ON public.credential_dependency USING btree ("dependencyType", "dependencyId") | +| IDX_credential_dependency_credentialId_dependencyType_dependenc | CREATE UNIQUE INDEX "IDX_credential_dependency_credentialId_dependencyType_dependenc" ON public.credential_dependency USING btree ("credentialId", "dependencyType", "dependencyId") | + +## Relations + +```mermaid +erDiagram + +"public.credential_dependency" }o--|| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE CASCADE" + +"public.credential_dependency" { + integer id + varchar_36_ credentialId FK + varchar_64_ dependencyType + varchar_255_ dependencyId + timestamp_3__with_time_zone createdAt +} +"public.credentials_entity" { + varchar_128_ name + text data + varchar_128_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ id + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.credentials_entity.md b/docs/generated/postgres-schema/public.credentials_entity.md new file mode 100644 index 00000000000..2c447130464 --- /dev/null +++ b/docs/generated/postgres-schema/public.credentials_entity.md @@ -0,0 +1,152 @@ +# public.credentials_entity + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| name | varchar(128) | | false | | | | +| data | text | | false | | | | +| type | varchar(128) | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| id | varchar(36) | | false | [public.shared_credentials](public.shared_credentials.md) [public.chat_hub_sessions](public.chat_hub_sessions.md) [public.chat_hub_agents](public.chat_hub_agents.md) [public.dynamic_credential_user_entry](public.dynamic_credential_user_entry.md) [public.dynamic_credential_entry](public.dynamic_credential_entry.md) [public.credential_dependency](public.credential_dependency.md) [public.instance_ai_mcp_registry_connections](public.instance_ai_mcp_registry_connections.md) | | | +| isManaged | boolean | false | false | | | | +| isGlobal | boolean | false | false | | | | +| isResolvable | boolean | false | false | | | | +| resolvableAllowFallback | boolean | false | false | | | | +| resolverId | varchar(16) | | true | | [public.dynamic_credential_resolver](public.dynamic_credential_resolver.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| credentials_entity_createdAt_not_null | n | NOT NULL "createdAt" | +| credentials_entity_data_not_null | n | NOT NULL data | +| credentials_entity_id_not_null1 | n | NOT NULL id | +| credentials_entity_isGlobal_not_null | n | NOT NULL "isGlobal" | +| credentials_entity_isManaged_not_null | n | NOT NULL "isManaged" | +| credentials_entity_isResolvable_not_null | n | NOT NULL "isResolvable" | +| credentials_entity_name_not_null | n | NOT NULL name | +| credentials_entity_resolvableAllowFallback_not_null | n | NOT NULL "resolvableAllowFallback" | +| credentials_entity_type_not_null | n | NOT NULL type | +| credentials_entity_updatedAt_not_null | n | NOT NULL "updatedAt" | +| credentials_entity_pkey | PRIMARY KEY | PRIMARY KEY (id) | +| credentials_entity_resolverId_foreign | FOREIGN KEY | FOREIGN KEY ("resolverId") REFERENCES dynamic_credential_resolver(id) ON DELETE SET NULL | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| idx_07fde106c0b471d8cc80a64fc8 | CREATE INDEX idx_07fde106c0b471d8cc80a64fc8 ON public.credentials_entity USING btree (type) | +| pk_credentials_entity_id | CREATE UNIQUE INDEX pk_credentials_entity_id ON public.credentials_entity USING btree (id) | +| credentials_entity_pkey | CREATE UNIQUE INDEX credentials_entity_pkey ON public.credentials_entity USING btree (id) | + +## Relations + +```mermaid +erDiagram + +"public.shared_credentials" }o--|| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialsId#quot;) REFERENCES credentials_entity(id) ON DELETE CASCADE" +"public.chat_hub_sessions" }o--o| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE SET NULL" +"public.chat_hub_agents" }o--o| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE SET NULL" +"public.dynamic_credential_user_entry" }o--|| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE CASCADE" +"public.dynamic_credential_entry" }o--|| "public.credentials_entity" : "FOREIGN KEY (credential_id) REFERENCES credentials_entity(id) ON DELETE CASCADE" +"public.credential_dependency" }o--|| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE CASCADE" +"public.instance_ai_mcp_registry_connections" }o--|| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE CASCADE" +"public.credentials_entity" }o--o| "public.dynamic_credential_resolver" : "FOREIGN KEY (#quot;resolverId#quot;) REFERENCES dynamic_credential_resolver(id) ON DELETE SET NULL" + +"public.credentials_entity" { + varchar_128_ name + text data + varchar_128_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ id + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +"public.shared_credentials" { + varchar_36_ credentialsId FK + varchar_36_ projectId FK + text role + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.chat_hub_sessions" { + uuid id + varchar_256_ title + uuid ownerId FK + timestamp_3__with_time_zone lastMessageAt + varchar_36_ credentialId FK + varchar_16_ provider + varchar_256_ model + varchar_36_ workflowId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + uuid agentId FK + varchar_128_ agentName + varchar_16_ type +} +"public.chat_hub_agents" { + uuid id + varchar_256_ name + varchar_512_ description + text systemPrompt + uuid ownerId FK + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + json files + json suggestedPrompts +} +"public.dynamic_credential_user_entry" { + varchar_16_ credentialId FK + uuid userId FK + varchar_16_ resolverId FK + text data + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.dynamic_credential_entry" { + varchar_16_ credential_id FK + varchar_2048_ subject_id + varchar_16_ resolver_id FK + text data + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.credential_dependency" { + integer id + varchar_36_ credentialId FK + varchar_64_ dependencyType + varchar_255_ dependencyId + timestamp_3__with_time_zone createdAt +} +"public.instance_ai_mcp_registry_connections" { + uuid id + varchar_36_ credentialId FK + varchar_255_ serverSlug FK + json toolFilter + uuid userId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.dynamic_credential_resolver" { + varchar_16_ id + varchar_128_ name + varchar_128_ type + text config + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.data_table.md b/docs/generated/postgres-schema/public.data_table.md new file mode 100644 index 00000000000..60928cb1987 --- /dev/null +++ b/docs/generated/postgres-schema/public.data_table.md @@ -0,0 +1,72 @@ +# public.data_table + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [public.data_table_column](public.data_table_column.md) | | | +| name | varchar(128) | | false | | | | +| projectId | varchar(36) | | false | | [public.project](public.project.md) | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| data_table_createdAt_not_null | n | NOT NULL "createdAt" | +| data_table_id_not_null | n | NOT NULL id | +| data_table_name_not_null | n | NOT NULL name | +| data_table_projectId_not_null | n | NOT NULL "projectId" | +| data_table_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_c2a794257dee48af7c9abf681de | FOREIGN KEY | FOREIGN KEY ("projectId") REFERENCES project(id) ON DELETE CASCADE | +| PK_e226d0001b9e6097cbfe70617cb | PRIMARY KEY | PRIMARY KEY (id) | +| UQ_b23096ef747281ac944d28e8b0d | UNIQUE | UNIQUE ("projectId", name) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_e226d0001b9e6097cbfe70617cb | CREATE UNIQUE INDEX "PK_e226d0001b9e6097cbfe70617cb" ON public.data_table USING btree (id) | +| UQ_b23096ef747281ac944d28e8b0d | CREATE UNIQUE INDEX "UQ_b23096ef747281ac944d28e8b0d" ON public.data_table USING btree ("projectId", name) | + +## Relations + +```mermaid +erDiagram + +"public.data_table_column" }o--|| "public.data_table" : "FOREIGN KEY (#quot;dataTableId#quot;) REFERENCES data_table(id) ON DELETE CASCADE" +"public.data_table" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" + +"public.data_table" { + varchar_36_ id + varchar_128_ name + varchar_36_ projectId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.data_table_column" { + varchar_36_ id + varchar_128_ name + varchar_32_ type + integer index + varchar_36_ dataTableId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.project" { + varchar_36_ id + varchar_255_ name + varchar_36_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + varchar_512_ description + uuid creatorId FK + json customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.data_table_column.md b/docs/generated/postgres-schema/public.data_table_column.md new file mode 100644 index 00000000000..12a1f1f7b85 --- /dev/null +++ b/docs/generated/postgres-schema/public.data_table_column.md @@ -0,0 +1,64 @@ +# public.data_table_column + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| name | varchar(128) | | false | | | | +| type | varchar(32) | | false | | | Expected: string, number, boolean, or date (not enforced as a constraint) | +| index | integer | | false | | | Column order, starting from 0 (0 = first column) | +| dataTableId | varchar(36) | | false | | [public.data_table](public.data_table.md) | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| data_table_column_createdAt_not_null | n | NOT NULL "createdAt" | +| data_table_column_dataTableId_not_null | n | NOT NULL "dataTableId" | +| data_table_column_id_not_null | n | NOT NULL id | +| data_table_column_index_not_null | n | NOT NULL index | +| data_table_column_name_not_null | n | NOT NULL name | +| data_table_column_type_not_null | n | NOT NULL type | +| data_table_column_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_930b6e8faaf88294cef23484160 | FOREIGN KEY | FOREIGN KEY ("dataTableId") REFERENCES data_table(id) ON DELETE CASCADE | +| PK_673cb121ee4a8a5e27850c72c51 | PRIMARY KEY | PRIMARY KEY (id) | +| UQ_8082ec4890f892f0bc77473a123 | UNIQUE | UNIQUE ("dataTableId", name) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_673cb121ee4a8a5e27850c72c51 | CREATE UNIQUE INDEX "PK_673cb121ee4a8a5e27850c72c51" ON public.data_table_column USING btree (id) | +| UQ_8082ec4890f892f0bc77473a123 | CREATE UNIQUE INDEX "UQ_8082ec4890f892f0bc77473a123" ON public.data_table_column USING btree ("dataTableId", name) | + +## Relations + +```mermaid +erDiagram + +"public.data_table_column" }o--|| "public.data_table" : "FOREIGN KEY (#quot;dataTableId#quot;) REFERENCES data_table(id) ON DELETE CASCADE" + +"public.data_table_column" { + varchar_36_ id + varchar_128_ name + varchar_32_ type + integer index + varchar_36_ dataTableId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.data_table" { + varchar_36_ id + varchar_128_ name + varchar_36_ projectId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.deployment_key.md b/docs/generated/postgres-schema/public.deployment_key.md new file mode 100644 index 00000000000..7d747f52e82 --- /dev/null +++ b/docs/generated/postgres-schema/public.deployment_key.md @@ -0,0 +1,58 @@ +# public.deployment_key + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| type | varchar(64) | | false | | | | +| value | text | | false | | | | +| algorithm | varchar(20) | | true | | | | +| status | varchar(20) | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| deployment_key_createdAt_not_null | n | NOT NULL "createdAt" | +| deployment_key_id_not_null | n | NOT NULL id | +| deployment_key_status_not_null | n | NOT NULL status | +| deployment_key_type_not_null | n | NOT NULL type | +| deployment_key_updatedAt_not_null | n | NOT NULL "updatedAt" | +| deployment_key_value_not_null | n | NOT NULL value | +| PK_94bb7aeb5def5a0284a5fe9f9a0 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_94bb7aeb5def5a0284a5fe9f9a0 | CREATE UNIQUE INDEX "PK_94bb7aeb5def5a0284a5fe9f9a0" ON public.deployment_key USING btree (id) | +| IDX_deployment_key_data_encryption_active | CREATE UNIQUE INDEX "IDX_deployment_key_data_encryption_active" ON public.deployment_key USING btree (type) WHERE (((status)::text = 'active'::text) AND ((type)::text = 'data_encryption'::text)) | +| IDX_deployment_key_instance_id_active | CREATE UNIQUE INDEX "IDX_deployment_key_instance_id_active" ON public.deployment_key USING btree (type) WHERE (((status)::text = 'active'::text) AND ((type)::text = 'instance.id'::text)) | +| IDX_deployment_key_signing_jwt_active | CREATE UNIQUE INDEX "IDX_deployment_key_signing_jwt_active" ON public.deployment_key USING btree (type) WHERE (((status)::text = 'active'::text) AND ((type)::text = 'signing.jwt'::text)) | +| IDX_deployment_key_signing_hmac_active | CREATE UNIQUE INDEX "IDX_deployment_key_signing_hmac_active" ON public.deployment_key USING btree (type) WHERE (((status)::text = 'active'::text) AND ((type)::text = 'signing.hmac'::text)) | +| IDX_deployment_key_signing_binary_data_active | CREATE UNIQUE INDEX "IDX_deployment_key_signing_binary_data_active" ON public.deployment_key USING btree (type) WHERE (((status)::text = 'active'::text) AND ((type)::text = 'signing.binary_data'::text)) | +| IDX_deployment_key_jwe_private_key_active | CREATE UNIQUE INDEX "IDX_deployment_key_jwe_private_key_active" ON public.deployment_key USING btree (type, algorithm) WHERE (((status)::text = 'active'::text) AND ((type)::text = 'jwe.private-key'::text)) | + +## Relations + +```mermaid +erDiagram + + +"public.deployment_key" { + varchar_36_ id + varchar_64_ type + text value + varchar_20_ algorithm + varchar_20_ status + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.dynamic_credential_entry.md b/docs/generated/postgres-schema/public.dynamic_credential_entry.md new file mode 100644 index 00000000000..9566d2d7dfa --- /dev/null +++ b/docs/generated/postgres-schema/public.dynamic_credential_entry.md @@ -0,0 +1,77 @@ +# public.dynamic_credential_entry + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| credential_id | varchar(16) | | false | | [public.credentials_entity](public.credentials_entity.md) | | +| subject_id | varchar(2048) | | false | | | | +| resolver_id | varchar(16) | | false | | [public.dynamic_credential_resolver](public.dynamic_credential_resolver.md) | | +| data | text | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| tmp_dynamic_credential_entry_createdAt_not_null | n | NOT NULL "createdAt" | +| tmp_dynamic_credential_entry_credential_id_not_null | n | NOT NULL credential_id | +| tmp_dynamic_credential_entry_data_not_null | n | NOT NULL data | +| tmp_dynamic_credential_entry_resolver_id_not_null | n | NOT NULL resolver_id | +| tmp_dynamic_credential_entry_subject_id_not_null | n | NOT NULL subject_id | +| tmp_dynamic_credential_entry_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_a6d1dd080958304a47a02952aab | FOREIGN KEY | FOREIGN KEY (credential_id) REFERENCES credentials_entity(id) ON DELETE CASCADE | +| FK_d61a12235d268a49af6a3c09c13 | FOREIGN KEY | FOREIGN KEY (resolver_id) REFERENCES dynamic_credential_resolver(id) ON DELETE CASCADE | +| PK_5135ffcabecad4727ff6b9b803d | PRIMARY KEY | PRIMARY KEY (credential_id, subject_id, resolver_id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_5135ffcabecad4727ff6b9b803d | CREATE UNIQUE INDEX "PK_5135ffcabecad4727ff6b9b803d" ON public.dynamic_credential_entry USING btree (credential_id, subject_id, resolver_id) | +| IDX_62476b94b56d9dc7ed9ed75d3d | CREATE INDEX "IDX_62476b94b56d9dc7ed9ed75d3d" ON public.dynamic_credential_entry USING btree (subject_id) | +| IDX_d61a12235d268a49af6a3c09c1 | CREATE INDEX "IDX_d61a12235d268a49af6a3c09c1" ON public.dynamic_credential_entry USING btree (resolver_id) | + +## Relations + +```mermaid +erDiagram + +"public.dynamic_credential_entry" }o--|| "public.credentials_entity" : "FOREIGN KEY (credential_id) REFERENCES credentials_entity(id) ON DELETE CASCADE" +"public.dynamic_credential_entry" }o--|| "public.dynamic_credential_resolver" : "FOREIGN KEY (resolver_id) REFERENCES dynamic_credential_resolver(id) ON DELETE CASCADE" + +"public.dynamic_credential_entry" { + varchar_16_ credential_id FK + varchar_2048_ subject_id + varchar_16_ resolver_id FK + text data + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.credentials_entity" { + varchar_128_ name + text data + varchar_128_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ id + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +"public.dynamic_credential_resolver" { + varchar_16_ id + varchar_128_ name + varchar_128_ type + text config + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.dynamic_credential_resolver.md b/docs/generated/postgres-schema/public.dynamic_credential_resolver.md new file mode 100644 index 00000000000..59b66b7665c --- /dev/null +++ b/docs/generated/postgres-schema/public.dynamic_credential_resolver.md @@ -0,0 +1,83 @@ +# public.dynamic_credential_resolver + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(16) | | false | [public.credentials_entity](public.credentials_entity.md) [public.dynamic_credential_user_entry](public.dynamic_credential_user_entry.md) [public.dynamic_credential_entry](public.dynamic_credential_entry.md) | | | +| name | varchar(128) | | false | | | | +| type | varchar(128) | | false | | | | +| config | text | | false | | | Encrypted resolver configuration (JSON encrypted as string) | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| dynamic_credential_resolver_config_not_null | n | NOT NULL config | +| dynamic_credential_resolver_createdAt_not_null | n | NOT NULL "createdAt" | +| dynamic_credential_resolver_id_not_null | n | NOT NULL id | +| dynamic_credential_resolver_name_not_null | n | NOT NULL name | +| dynamic_credential_resolver_type_not_null | n | NOT NULL type | +| dynamic_credential_resolver_updatedAt_not_null | n | NOT NULL "updatedAt" | +| PK_b76cfb088dcdaf5275e9980bb64 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_b76cfb088dcdaf5275e9980bb64 | CREATE UNIQUE INDEX "PK_b76cfb088dcdaf5275e9980bb64" ON public.dynamic_credential_resolver USING btree (id) | +| IDX_9c9ee9df586e60bb723234e499 | CREATE INDEX "IDX_9c9ee9df586e60bb723234e499" ON public.dynamic_credential_resolver USING btree (type) | + +## Relations + +```mermaid +erDiagram + +"public.credentials_entity" }o--o| "public.dynamic_credential_resolver" : "FOREIGN KEY (#quot;resolverId#quot;) REFERENCES dynamic_credential_resolver(id) ON DELETE SET NULL" +"public.dynamic_credential_user_entry" }o--|| "public.dynamic_credential_resolver" : "FOREIGN KEY (#quot;resolverId#quot;) REFERENCES dynamic_credential_resolver(id) ON DELETE CASCADE" +"public.dynamic_credential_entry" }o--|| "public.dynamic_credential_resolver" : "FOREIGN KEY (resolver_id) REFERENCES dynamic_credential_resolver(id) ON DELETE CASCADE" + +"public.dynamic_credential_resolver" { + varchar_16_ id + varchar_128_ name + varchar_128_ type + text config + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.credentials_entity" { + varchar_128_ name + text data + varchar_128_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ id + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +"public.dynamic_credential_user_entry" { + varchar_16_ credentialId FK + uuid userId FK + varchar_16_ resolverId FK + text data + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.dynamic_credential_entry" { + varchar_16_ credential_id FK + varchar_2048_ subject_id + varchar_16_ resolver_id FK + text data + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.dynamic_credential_user_entry.md b/docs/generated/postgres-schema/public.dynamic_credential_user_entry.md new file mode 100644 index 00000000000..f8ee0380fc2 --- /dev/null +++ b/docs/generated/postgres-schema/public.dynamic_credential_user_entry.md @@ -0,0 +1,96 @@ +# public.dynamic_credential_user_entry + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| credentialId | varchar(16) | | false | | [public.credentials_entity](public.credentials_entity.md) | | +| userId | uuid | | false | | [public.user](public.user.md) | | +| resolverId | varchar(16) | | false | | [public.dynamic_credential_resolver](public.dynamic_credential_resolver.md) | | +| data | text | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| dynamic_credential_user_entry_createdAt_not_null | n | NOT NULL "createdAt" | +| dynamic_credential_user_entry_credentialId_not_null | n | NOT NULL "credentialId" | +| dynamic_credential_user_entry_data_not_null | n | NOT NULL data | +| dynamic_credential_user_entry_resolverId_not_null | n | NOT NULL "resolverId" | +| dynamic_credential_user_entry_updatedAt_not_null | n | NOT NULL "updatedAt" | +| dynamic_credential_user_entry_userId_not_null | n | NOT NULL "userId" | +| FK_a36dc616fabc3f736bb82410a22 | FOREIGN KEY | FOREIGN KEY ("userId") REFERENCES "user"(id) ON DELETE CASCADE | +| FK_945ba70b342a066d1306b12ccd2 | FOREIGN KEY | FOREIGN KEY ("credentialId") REFERENCES credentials_entity(id) ON DELETE CASCADE | +| FK_6edec973a6450990977bb854c38 | FOREIGN KEY | FOREIGN KEY ("resolverId") REFERENCES dynamic_credential_resolver(id) ON DELETE CASCADE | +| PK_74f548e633abc66dc27c8f0ca77 | PRIMARY KEY | PRIMARY KEY ("credentialId", "userId", "resolverId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_74f548e633abc66dc27c8f0ca77 | CREATE UNIQUE INDEX "PK_74f548e633abc66dc27c8f0ca77" ON public.dynamic_credential_user_entry USING btree ("credentialId", "userId", "resolverId") | +| IDX_a36dc616fabc3f736bb82410a2 | CREATE INDEX "IDX_a36dc616fabc3f736bb82410a2" ON public.dynamic_credential_user_entry USING btree ("userId") | +| IDX_6edec973a6450990977bb854c3 | CREATE INDEX "IDX_6edec973a6450990977bb854c3" ON public.dynamic_credential_user_entry USING btree ("resolverId") | + +## Relations + +```mermaid +erDiagram + +"public.dynamic_credential_user_entry" }o--|| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE CASCADE" +"public.dynamic_credential_user_entry" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.dynamic_credential_user_entry" }o--|| "public.dynamic_credential_resolver" : "FOREIGN KEY (#quot;resolverId#quot;) REFERENCES dynamic_credential_resolver(id) ON DELETE CASCADE" + +"public.dynamic_credential_user_entry" { + varchar_16_ credentialId FK + uuid userId FK + varchar_16_ resolverId FK + text data + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.credentials_entity" { + varchar_128_ name + text data + varchar_128_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ id + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"public.dynamic_credential_resolver" { + varchar_16_ id + varchar_128_ name + varchar_128_ type + text config + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.evaluation_collection.md b/docs/generated/postgres-schema/public.evaluation_collection.md new file mode 100644 index 00000000000..6d18bd52aa3 --- /dev/null +++ b/docs/generated/postgres-schema/public.evaluation_collection.md @@ -0,0 +1,136 @@ +# public.evaluation_collection + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [public.test_run](public.test_run.md) | | | +| name | varchar(128) | | false | | | | +| description | text | | true | | | | +| workflowId | varchar(36) | | false | | [public.workflow_entity](public.workflow_entity.md) | | +| evaluationConfigId | varchar(36) | | false | | [public.evaluation_config](public.evaluation_config.md) | | +| createdById | uuid | | true | | [public.user](public.user.md) | | +| insightsCache | json | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| evaluation_collection_createdAt_not_null | n | NOT NULL "createdAt" | +| evaluation_collection_evaluationConfigId_not_null | n | NOT NULL "evaluationConfigId" | +| evaluation_collection_id_not_null | n | NOT NULL id | +| evaluation_collection_name_not_null | n | NOT NULL name | +| evaluation_collection_updatedAt_not_null | n | NOT NULL "updatedAt" | +| evaluation_collection_workflowId_not_null | n | NOT NULL "workflowId" | +| FK_f4561f38b5a22a4f090d5cd3eae | FOREIGN KEY | FOREIGN KEY ("createdById") REFERENCES "user"(id) ON DELETE SET NULL | +| FK_a48ce930c3bc7604894b8f0eaad | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE CASCADE | +| FK_d634a0c93fd7de68a87eab951b2 | FOREIGN KEY | FOREIGN KEY ("evaluationConfigId") REFERENCES evaluation_config(id) ON DELETE CASCADE | +| PK_e720b6efc1e45b878ebb0b2ca30 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_e720b6efc1e45b878ebb0b2ca30 | CREATE UNIQUE INDEX "PK_e720b6efc1e45b878ebb0b2ca30" ON public.evaluation_collection USING btree (id) | +| IDX_a48ce930c3bc7604894b8f0eaa | CREATE INDEX "IDX_a48ce930c3bc7604894b8f0eaa" ON public.evaluation_collection USING btree ("workflowId") | +| IDX_d634a0c93fd7de68a87eab951b | CREATE INDEX "IDX_d634a0c93fd7de68a87eab951b" ON public.evaluation_collection USING btree ("evaluationConfigId") | + +## Relations + +```mermaid +erDiagram + +"public.test_run" }o--o| "public.evaluation_collection" : "FOREIGN KEY (#quot;collectionId#quot;) REFERENCES evaluation_collection(id) ON DELETE SET NULL" +"public.evaluation_collection" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.evaluation_collection" }o--|| "public.evaluation_config" : "FOREIGN KEY (#quot;evaluationConfigId#quot;) REFERENCES evaluation_config(id) ON DELETE CASCADE" +"public.evaluation_collection" }o--o| "public.user" : "FOREIGN KEY (#quot;createdById#quot;) REFERENCES #quot;user#quot;(id) ON DELETE SET NULL" + +"public.evaluation_collection" { + varchar_36_ id + varchar_128_ name + text description + varchar_36_ workflowId FK + varchar_36_ evaluationConfigId FK + uuid createdById FK + json insightsCache + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.test_run" { + varchar_36_ id + varchar_36_ workflowId FK + varchar status + varchar errorCode + json errorDetails + timestamp_3__with_time_zone runAt + timestamp_3__with_time_zone completedAt + json metrics + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_255_ runningInstanceId + boolean cancelRequested + varchar_36_ workflowVersionId + varchar_36_ evaluationConfigId FK + jsonb evaluationConfigSnapshot + varchar_36_ collectionId FK +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +"public.evaluation_config" { + varchar_36_ id + varchar_36_ workflowId FK + varchar_128_ name + varchar_16_ status + varchar_64_ invalidReason + varchar_32_ datasetSource + json datasetRef + varchar_255_ startNodeName + varchar_255_ endNodeName + json metrics + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.evaluation_config.md b/docs/generated/postgres-schema/public.evaluation_config.md new file mode 100644 index 00000000000..6c88ca36885 --- /dev/null +++ b/docs/generated/postgres-schema/public.evaluation_config.md @@ -0,0 +1,125 @@ +# public.evaluation_config + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [public.test_run](public.test_run.md) [public.evaluation_collection](public.evaluation_collection.md) | | | +| workflowId | varchar(36) | | false | | [public.workflow_entity](public.workflow_entity.md) | | +| name | varchar(128) | | false | | | | +| status | varchar(16) | 'valid'::character varying | false | | | | +| invalidReason | varchar(64) | | true | | | | +| datasetSource | varchar(32) | | false | | | | +| datasetRef | json | | false | | | | +| startNodeName | varchar(255) | | false | | | | +| endNodeName | varchar(255) | | false | | | | +| metrics | json | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| evaluation_config_createdAt_not_null | n | NOT NULL "createdAt" | +| evaluation_config_datasetRef_not_null | n | NOT NULL "datasetRef" | +| evaluation_config_datasetSource_not_null | n | NOT NULL "datasetSource" | +| evaluation_config_endNodeName_not_null | n | NOT NULL "endNodeName" | +| evaluation_config_id_not_null | n | NOT NULL id | +| evaluation_config_metrics_not_null | n | NOT NULL metrics | +| evaluation_config_name_not_null | n | NOT NULL name | +| evaluation_config_startNodeName_not_null | n | NOT NULL "startNodeName" | +| evaluation_config_status_not_null | n | NOT NULL status | +| evaluation_config_updatedAt_not_null | n | NOT NULL "updatedAt" | +| evaluation_config_workflowId_not_null | n | NOT NULL "workflowId" | +| FK_fd7542bb123074760285dc1bbf3 | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE CASCADE | +| PK_59c14dccf8989df94070c2dcfda | PRIMARY KEY | PRIMARY KEY (id) | +| UQ_3c3c99a712e971835c52292e44c | UNIQUE | UNIQUE ("workflowId", name) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_59c14dccf8989df94070c2dcfda | CREATE UNIQUE INDEX "PK_59c14dccf8989df94070c2dcfda" ON public.evaluation_config USING btree (id) | +| UQ_3c3c99a712e971835c52292e44c | CREATE UNIQUE INDEX "UQ_3c3c99a712e971835c52292e44c" ON public.evaluation_config USING btree ("workflowId", name) | +| IDX_fd7542bb123074760285dc1bbf | CREATE INDEX "IDX_fd7542bb123074760285dc1bbf" ON public.evaluation_config USING btree ("workflowId") | + +## Relations + +```mermaid +erDiagram + +"public.test_run" }o--o| "public.evaluation_config" : "FOREIGN KEY (#quot;evaluationConfigId#quot;) REFERENCES evaluation_config(id) ON DELETE SET NULL" +"public.evaluation_collection" }o--|| "public.evaluation_config" : "FOREIGN KEY (#quot;evaluationConfigId#quot;) REFERENCES evaluation_config(id) ON DELETE CASCADE" +"public.evaluation_config" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" + +"public.evaluation_config" { + varchar_36_ id + varchar_36_ workflowId FK + varchar_128_ name + varchar_16_ status + varchar_64_ invalidReason + varchar_32_ datasetSource + json datasetRef + varchar_255_ startNodeName + varchar_255_ endNodeName + json metrics + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.test_run" { + varchar_36_ id + varchar_36_ workflowId FK + varchar status + varchar errorCode + json errorDetails + timestamp_3__with_time_zone runAt + timestamp_3__with_time_zone completedAt + json metrics + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_255_ runningInstanceId + boolean cancelRequested + varchar_36_ workflowVersionId + varchar_36_ evaluationConfigId FK + jsonb evaluationConfigSnapshot + varchar_36_ collectionId FK +} +"public.evaluation_collection" { + varchar_36_ id + varchar_128_ name + text description + varchar_36_ workflowId FK + varchar_36_ evaluationConfigId FK + uuid createdById FK + json insightsCache + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.event_destinations.md b/docs/generated/postgres-schema/public.event_destinations.md new file mode 100644 index 00000000000..4a40ea23c62 --- /dev/null +++ b/docs/generated/postgres-schema/public.event_destinations.md @@ -0,0 +1,44 @@ +# public.event_destinations + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | uuid | | false | | | | +| destination | jsonb | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| event_destinations_createdAt_not_null | n | NOT NULL "createdAt" | +| event_destinations_destination_not_null | n | NOT NULL destination | +| event_destinations_id_not_null | n | NOT NULL id | +| event_destinations_updatedAt_not_null | n | NOT NULL "updatedAt" | +| event_destinations_pkey | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| event_destinations_pkey | CREATE UNIQUE INDEX event_destinations_pkey ON public.event_destinations USING btree (id) | + +## Relations + +```mermaid +erDiagram + + +"public.event_destinations" { + uuid id + jsonb destination + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.execution_annotation_tags.md b/docs/generated/postgres-schema/public.execution_annotation_tags.md new file mode 100644 index 00000000000..ccaeea80fe6 --- /dev/null +++ b/docs/generated/postgres-schema/public.execution_annotation_tags.md @@ -0,0 +1,58 @@ +# public.execution_annotation_tags + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| annotationId | integer | | false | | [public.execution_annotations](public.execution_annotations.md) | | +| tagId | varchar(24) | | false | | [public.annotation_tag_entity](public.annotation_tag_entity.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| execution_annotation_tags_annotationId_not_null | n | NOT NULL "annotationId" | +| execution_annotation_tags_tagId_not_null | n | NOT NULL "tagId" | +| FK_c1519757391996eb06064f0e7c8 | FOREIGN KEY | FOREIGN KEY ("annotationId") REFERENCES execution_annotations(id) ON DELETE CASCADE | +| FK_a3697779b366e131b2bbdae2976 | FOREIGN KEY | FOREIGN KEY ("tagId") REFERENCES annotation_tag_entity(id) ON DELETE CASCADE | +| PK_979ec03d31294cca484be65d11f | PRIMARY KEY | PRIMARY KEY ("annotationId", "tagId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_979ec03d31294cca484be65d11f | CREATE UNIQUE INDEX "PK_979ec03d31294cca484be65d11f" ON public.execution_annotation_tags USING btree ("annotationId", "tagId") | +| IDX_a3697779b366e131b2bbdae297 | CREATE INDEX "IDX_a3697779b366e131b2bbdae297" ON public.execution_annotation_tags USING btree ("tagId") | +| IDX_c1519757391996eb06064f0e7c | CREATE INDEX "IDX_c1519757391996eb06064f0e7c" ON public.execution_annotation_tags USING btree ("annotationId") | + +## Relations + +```mermaid +erDiagram + +"public.execution_annotation_tags" }o--|| "public.execution_annotations" : "FOREIGN KEY (#quot;annotationId#quot;) REFERENCES execution_annotations(id) ON DELETE CASCADE" +"public.execution_annotation_tags" }o--|| "public.annotation_tag_entity" : "FOREIGN KEY (#quot;tagId#quot;) REFERENCES annotation_tag_entity(id) ON DELETE CASCADE" + +"public.execution_annotation_tags" { + integer annotationId FK + varchar_24_ tagId FK +} +"public.execution_annotations" { + integer id + integer executionId FK + varchar_6_ vote + text note + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.annotation_tag_entity" { + varchar_16_ id + varchar_24_ name + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.execution_annotations.md b/docs/generated/postgres-schema/public.execution_annotations.md new file mode 100644 index 00000000000..176afcac563 --- /dev/null +++ b/docs/generated/postgres-schema/public.execution_annotations.md @@ -0,0 +1,73 @@ +# public.execution_annotations + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | integer | nextval('execution_annotations_id_seq'::regclass) | false | [public.execution_annotation_tags](public.execution_annotation_tags.md) | | | +| executionId | integer | | false | | [public.execution_entity](public.execution_entity.md) | | +| vote | varchar(6) | | true | | | | +| note | text | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| execution_annotations_createdAt_not_null | n | NOT NULL "createdAt" | +| execution_annotations_executionId_not_null | n | NOT NULL "executionId" | +| execution_annotations_id_not_null | n | NOT NULL id | +| execution_annotations_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_97f863fa83c4786f19565084960 | FOREIGN KEY | FOREIGN KEY ("executionId") REFERENCES execution_entity(id) ON DELETE CASCADE | +| PK_7afcf93ffa20c4252869a7c6a23 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_7afcf93ffa20c4252869a7c6a23 | CREATE UNIQUE INDEX "PK_7afcf93ffa20c4252869a7c6a23" ON public.execution_annotations USING btree (id) | +| IDX_97f863fa83c4786f1956508496 | CREATE UNIQUE INDEX "IDX_97f863fa83c4786f1956508496" ON public.execution_annotations USING btree ("executionId") | + +## Relations + +```mermaid +erDiagram + +"public.execution_annotation_tags" }o--|| "public.execution_annotations" : "FOREIGN KEY (#quot;annotationId#quot;) REFERENCES execution_annotations(id) ON DELETE CASCADE" +"public.execution_annotations" }o--|| "public.execution_entity" : "FOREIGN KEY (#quot;executionId#quot;) REFERENCES execution_entity(id) ON DELETE CASCADE" + +"public.execution_annotations" { + integer id + integer executionId FK + varchar_6_ vote + text note + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.execution_annotation_tags" { + integer annotationId FK + varchar_24_ tagId FK +} +"public.execution_entity" { + integer id + boolean finished + varchar mode + varchar retryOf + varchar retrySuccessId + timestamp_3__with_time_zone startedAt + timestamp_3__with_time_zone stoppedAt + timestamp_3__with_time_zone waitTill + varchar status + varchar_36_ workflowId FK + timestamp_3__with_time_zone deletedAt + timestamp_3__with_time_zone createdAt + varchar_2_ storedAt + json tracingContext + varchar_255_ deduplicationKey +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.execution_data.md b/docs/generated/postgres-schema/public.execution_data.md new file mode 100644 index 00000000000..39e943c75d2 --- /dev/null +++ b/docs/generated/postgres-schema/public.execution_data.md @@ -0,0 +1,62 @@ +# public.execution_data + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| executionId | integer | | false | | [public.execution_entity](public.execution_entity.md) | | +| workflowData | json | | false | | | | +| data | text | | false | | | | +| workflowVersionId | varchar(36) | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| execution_data_data_not_null | n | NOT NULL data | +| execution_data_executionId_not_null | n | NOT NULL "executionId" | +| execution_data_workflowData_not_null | n | NOT NULL "workflowData" | +| execution_data_fk | FOREIGN KEY | FOREIGN KEY ("executionId") REFERENCES execution_entity(id) ON DELETE CASCADE | +| execution_data_pkey | PRIMARY KEY | PRIMARY KEY ("executionId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| execution_data_pkey | CREATE UNIQUE INDEX execution_data_pkey ON public.execution_data USING btree ("executionId") | + +## Relations + +```mermaid +erDiagram + +"public.execution_data" |o--|| "public.execution_entity" : "FOREIGN KEY (#quot;executionId#quot;) REFERENCES execution_entity(id) ON DELETE CASCADE" + +"public.execution_data" { + integer executionId FK + json workflowData + text data + varchar_36_ workflowVersionId +} +"public.execution_entity" { + integer id + boolean finished + varchar mode + varchar retryOf + varchar retrySuccessId + timestamp_3__with_time_zone startedAt + timestamp_3__with_time_zone stoppedAt + timestamp_3__with_time_zone waitTill + varchar status + varchar_36_ workflowId FK + timestamp_3__with_time_zone deletedAt + timestamp_3__with_time_zone createdAt + varchar_2_ storedAt + json tracingContext + varchar_255_ deduplicationKey +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.execution_entity.md b/docs/generated/postgres-schema/public.execution_entity.md new file mode 100644 index 00000000000..15d85bb452f --- /dev/null +++ b/docs/generated/postgres-schema/public.execution_entity.md @@ -0,0 +1,159 @@ +# public.execution_entity + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | integer | nextval('execution_entity_id_seq'::regclass) | false | [public.execution_data](public.execution_data.md) [public.execution_metadata](public.execution_metadata.md) [public.execution_annotations](public.execution_annotations.md) [public.test_case_execution](public.test_case_execution.md) [public.chat_hub_messages](public.chat_hub_messages.md) | | | +| finished | boolean | | false | | | | +| mode | varchar | | false | | | | +| retryOf | varchar | | true | | | | +| retrySuccessId | varchar | | true | | | | +| startedAt | timestamp(3) with time zone | | true | | | | +| stoppedAt | timestamp(3) with time zone | | true | | | | +| waitTill | timestamp(3) with time zone | | true | | | | +| status | varchar | | false | | | | +| workflowId | varchar(36) | | false | | [public.workflow_entity](public.workflow_entity.md) | | +| deletedAt | timestamp(3) with time zone | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| storedAt | varchar(2) | 'db'::character varying | false | | | | +| tracingContext | json | | true | | | | +| deduplicationKey | varchar(255) | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| execution_entity_createdAt_not_null | n | NOT NULL "createdAt" | +| execution_entity_finished_not_null | n | NOT NULL finished | +| execution_entity_id_not_null | n | NOT NULL id | +| execution_entity_mode_not_null | n | NOT NULL mode | +| execution_entity_status_not_null | n | NOT NULL status | +| execution_entity_storedAt_check | CHECK | CHECK ((("storedAt")::text = ANY ((ARRAY['db'::character varying, 'fs'::character varying, 's3'::character varying])::text[]))) | +| execution_entity_storedAt_not_null | n | NOT NULL "storedAt" | +| execution_entity_workflowId_not_null | n | NOT NULL "workflowId" | +| pk_e3e63bbf986767844bbe1166d4e | PRIMARY KEY | PRIMARY KEY (id) | +| fk_execution_entity_workflow_id | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE CASCADE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| pk_e3e63bbf986767844bbe1166d4e | CREATE UNIQUE INDEX pk_e3e63bbf986767844bbe1166d4e ON public.execution_entity USING btree (id) | +| IDX_execution_entity_deletedAt | CREATE INDEX "IDX_execution_entity_deletedAt" ON public.execution_entity USING btree ("deletedAt") | +| idx_execution_entity_workflow_id_started_at | CREATE INDEX idx_execution_entity_workflow_id_started_at ON public.execution_entity USING btree ("workflowId", "startedAt") WHERE (("startedAt" IS NOT NULL) AND ("deletedAt" IS NULL)) | +| idx_execution_entity_wait_till_status_deleted_at | CREATE INDEX idx_execution_entity_wait_till_status_deleted_at ON public.execution_entity USING btree ("waitTill", status, "deletedAt") WHERE (("waitTill" IS NOT NULL) AND ("deletedAt" IS NULL)) | +| idx_execution_entity_stopped_at_status_deleted_at | CREATE INDEX idx_execution_entity_stopped_at_status_deleted_at ON public.execution_entity USING btree ("stoppedAt", status, "deletedAt") WHERE (("stoppedAt" IS NOT NULL) AND ("deletedAt" IS NULL)) | +| IDX_execution_entity_deduplicationKey | CREATE UNIQUE INDEX "IDX_execution_entity_deduplicationKey" ON public.execution_entity USING btree ("deduplicationKey") WHERE ("deduplicationKey" IS NOT NULL) | + +## Relations + +```mermaid +erDiagram + +"public.execution_data" |o--|| "public.execution_entity" : "FOREIGN KEY (#quot;executionId#quot;) REFERENCES execution_entity(id) ON DELETE CASCADE" +"public.execution_metadata" }o--|| "public.execution_entity" : "FOREIGN KEY (#quot;executionId#quot;) REFERENCES execution_entity(id) ON DELETE CASCADE" +"public.execution_annotations" }o--|| "public.execution_entity" : "FOREIGN KEY (#quot;executionId#quot;) REFERENCES execution_entity(id) ON DELETE CASCADE" +"public.test_case_execution" }o--o| "public.execution_entity" : "FOREIGN KEY (#quot;executionId#quot;) REFERENCES execution_entity(id) ON DELETE SET NULL" +"public.chat_hub_messages" }o--o| "public.execution_entity" : "FOREIGN KEY (#quot;executionId#quot;) REFERENCES execution_entity(id) ON DELETE SET NULL" +"public.execution_entity" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" + +"public.execution_entity" { + integer id + boolean finished + varchar mode + varchar retryOf + varchar retrySuccessId + timestamp_3__with_time_zone startedAt + timestamp_3__with_time_zone stoppedAt + timestamp_3__with_time_zone waitTill + varchar status + varchar_36_ workflowId FK + timestamp_3__with_time_zone deletedAt + timestamp_3__with_time_zone createdAt + varchar_2_ storedAt + json tracingContext + varchar_255_ deduplicationKey +} +"public.execution_data" { + integer executionId FK + json workflowData + text data + varchar_36_ workflowVersionId +} +"public.execution_metadata" { + integer id + integer executionId FK + varchar_255_ key + text value +} +"public.execution_annotations" { + integer id + integer executionId FK + varchar_6_ vote + text note + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.test_case_execution" { + varchar_36_ id + varchar_36_ testRunId FK + integer executionId FK + varchar status + timestamp_3__with_time_zone runAt + timestamp_3__with_time_zone completedAt + varchar errorCode + json errorDetails + json metrics + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json inputs + json outputs + integer runIndex +} +"public.chat_hub_messages" { + uuid id + uuid sessionId FK + uuid previousMessageId FK + uuid revisionOfMessageId FK + uuid retryOfMessageId FK + varchar_16_ type + varchar_128_ name + text content + varchar_16_ provider + varchar_256_ model + varchar_36_ workflowId FK + integer executionId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + uuid agentId FK + varchar_16_ status + json attachments +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.execution_metadata.md b/docs/generated/postgres-schema/public.execution_metadata.md new file mode 100644 index 00000000000..52f1d74c94e --- /dev/null +++ b/docs/generated/postgres-schema/public.execution_metadata.md @@ -0,0 +1,64 @@ +# public.execution_metadata + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | integer | nextval('execution_metadata_temp_id_seq'::regclass) | false | | | | +| executionId | integer | | false | | [public.execution_entity](public.execution_entity.md) | | +| key | varchar(255) | | false | | | | +| value | text | | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| execution_metadata_temp_executionId_not_null | n | NOT NULL "executionId" | +| execution_metadata_temp_id_not_null | n | NOT NULL id | +| execution_metadata_temp_key_not_null | n | NOT NULL key | +| execution_metadata_temp_value_not_null | n | NOT NULL value | +| FK_31d0b4c93fb85ced26f6005cda3 | FOREIGN KEY | FOREIGN KEY ("executionId") REFERENCES execution_entity(id) ON DELETE CASCADE | +| PK_17a0b6284f8d626aae88e1c16e4 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_17a0b6284f8d626aae88e1c16e4 | CREATE UNIQUE INDEX "PK_17a0b6284f8d626aae88e1c16e4" ON public.execution_metadata USING btree (id) | +| IDX_cec8eea3bf49551482ccb4933e | CREATE UNIQUE INDEX "IDX_cec8eea3bf49551482ccb4933e" ON public.execution_metadata USING btree ("executionId", key) | + +## Relations + +```mermaid +erDiagram + +"public.execution_metadata" }o--|| "public.execution_entity" : "FOREIGN KEY (#quot;executionId#quot;) REFERENCES execution_entity(id) ON DELETE CASCADE" + +"public.execution_metadata" { + integer id + integer executionId FK + varchar_255_ key + text value +} +"public.execution_entity" { + integer id + boolean finished + varchar mode + varchar retryOf + varchar retrySuccessId + timestamp_3__with_time_zone startedAt + timestamp_3__with_time_zone stoppedAt + timestamp_3__with_time_zone waitTill + varchar status + varchar_36_ workflowId FK + timestamp_3__with_time_zone deletedAt + timestamp_3__with_time_zone createdAt + varchar_2_ storedAt + json tracingContext + varchar_255_ deduplicationKey +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.folder.md b/docs/generated/postgres-schema/public.folder.md new file mode 100644 index 00000000000..95769a310b3 --- /dev/null +++ b/docs/generated/postgres-schema/public.folder.md @@ -0,0 +1,93 @@ +# public.folder + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [public.workflow_entity](public.workflow_entity.md) [public.folder](public.folder.md) [public.folder_tag](public.folder_tag.md) | | | +| name | varchar(128) | | false | | | | +| parentFolderId | varchar(36) | | true | | [public.folder](public.folder.md) | | +| projectId | varchar(36) | | false | | [public.project](public.project.md) | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| folder_createdAt_not_null | n | NOT NULL "createdAt" | +| folder_id_not_null | n | NOT NULL id | +| folder_name_not_null | n | NOT NULL name | +| folder_projectId_not_null | n | NOT NULL "projectId" | +| folder_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_a8260b0b36939c6247f385b8221 | FOREIGN KEY | FOREIGN KEY ("projectId") REFERENCES project(id) ON DELETE CASCADE | +| FK_804ea52f6729e3940498bd54d78 | FOREIGN KEY | FOREIGN KEY ("parentFolderId") REFERENCES folder(id) ON DELETE CASCADE | +| PK_6278a41a706740c94c02e288df8 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_6278a41a706740c94c02e288df8 | CREATE UNIQUE INDEX "PK_6278a41a706740c94c02e288df8" ON public.folder USING btree (id) | +| IDX_14f68deffaf858465715995508 | CREATE UNIQUE INDEX "IDX_14f68deffaf858465715995508" ON public.folder USING btree ("projectId", id) | + +## Relations + +```mermaid +erDiagram + +"public.workflow_entity" }o--o| "public.folder" : "FOREIGN KEY (#quot;parentFolderId#quot;) REFERENCES folder(id) ON DELETE CASCADE" +"public.folder" }o--o| "public.folder" : "FOREIGN KEY (#quot;parentFolderId#quot;) REFERENCES folder(id) ON DELETE CASCADE" +"public.folder_tag" }o--|| "public.folder" : "FOREIGN KEY (#quot;folderId#quot;) REFERENCES folder(id) ON DELETE CASCADE" +"public.folder" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" + +"public.folder" { + varchar_36_ id + varchar_128_ name + varchar_36_ parentFolderId FK + varchar_36_ projectId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +"public.folder_tag" { + varchar_36_ folderId FK + varchar_36_ tagId FK +} +"public.project" { + varchar_36_ id + varchar_255_ name + varchar_36_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + varchar_512_ description + uuid creatorId FK + json customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.folder_tag.md b/docs/generated/postgres-schema/public.folder_tag.md new file mode 100644 index 00000000000..992409750eb --- /dev/null +++ b/docs/generated/postgres-schema/public.folder_tag.md @@ -0,0 +1,56 @@ +# public.folder_tag + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| folderId | varchar(36) | | false | | [public.folder](public.folder.md) | | +| tagId | varchar(36) | | false | | [public.tag_entity](public.tag_entity.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| folder_tag_folderId_not_null | n | NOT NULL "folderId" | +| folder_tag_tagId_not_null | n | NOT NULL "tagId" | +| FK_dc88164176283de80af47621746 | FOREIGN KEY | FOREIGN KEY ("tagId") REFERENCES tag_entity(id) ON DELETE CASCADE | +| FK_94a60854e06f2897b2e0d39edba | FOREIGN KEY | FOREIGN KEY ("folderId") REFERENCES folder(id) ON DELETE CASCADE | +| PK_27e4e00852f6b06a925a4d83a3e | PRIMARY KEY | PRIMARY KEY ("folderId", "tagId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_27e4e00852f6b06a925a4d83a3e | CREATE UNIQUE INDEX "PK_27e4e00852f6b06a925a4d83a3e" ON public.folder_tag USING btree ("folderId", "tagId") | + +## Relations + +```mermaid +erDiagram + +"public.folder_tag" }o--|| "public.folder" : "FOREIGN KEY (#quot;folderId#quot;) REFERENCES folder(id) ON DELETE CASCADE" +"public.folder_tag" }o--|| "public.tag_entity" : "FOREIGN KEY (#quot;tagId#quot;) REFERENCES tag_entity(id) ON DELETE CASCADE" + +"public.folder_tag" { + varchar_36_ folderId FK + varchar_36_ tagId FK +} +"public.folder" { + varchar_36_ id + varchar_128_ name + varchar_36_ parentFolderId FK + varchar_36_ projectId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.tag_entity" { + varchar_24_ name + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ id +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.insights_by_period.md b/docs/generated/postgres-schema/public.insights_by_period.md new file mode 100644 index 00000000000..b88c3eaf7c2 --- /dev/null +++ b/docs/generated/postgres-schema/public.insights_by_period.md @@ -0,0 +1,59 @@ +# public.insights_by_period + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | integer | | false | | | | +| metaId | integer | | false | | [public.insights_metadata](public.insights_metadata.md) | | +| type | integer | | false | | | 0: time_saved_minutes, 1: runtime_milliseconds, 2: success, 3: failure | +| value | bigint | | false | | | | +| periodUnit | integer | | false | | | 0: hour, 1: day, 2: week | +| periodStart | timestamp(0) with time zone | CURRENT_TIMESTAMP | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| insights_by_period_id_not_null | n | NOT NULL id | +| insights_by_period_metaId_not_null | n | NOT NULL "metaId" | +| insights_by_period_periodUnit_not_null | n | NOT NULL "periodUnit" | +| insights_by_period_type_not_null | n | NOT NULL type | +| insights_by_period_value_not_null | n | NOT NULL value | +| FK_6414cfed98daabbfdd61a1cfbc0 | FOREIGN KEY | FOREIGN KEY ("metaId") REFERENCES insights_metadata("metaId") ON DELETE CASCADE | +| PK_b606942249b90cc39b0265f0575 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_b606942249b90cc39b0265f0575 | CREATE UNIQUE INDEX "PK_b606942249b90cc39b0265f0575" ON public.insights_by_period USING btree (id) | +| IDX_60b6a84299eeb3f671dfec7693 | CREATE UNIQUE INDEX "IDX_60b6a84299eeb3f671dfec7693" ON public.insights_by_period USING btree ("periodStart", type, "periodUnit", "metaId") | + +## Relations + +```mermaid +erDiagram + +"public.insights_by_period" }o--|| "public.insights_metadata" : "FOREIGN KEY (#quot;metaId#quot;) REFERENCES insights_metadata(#quot;metaId#quot;) ON DELETE CASCADE" + +"public.insights_by_period" { + integer id + integer metaId FK + integer type + bigint value + integer periodUnit + timestamp_0__with_time_zone periodStart +} +"public.insights_metadata" { + integer metaId + varchar_36_ workflowId FK + varchar_36_ projectId FK + varchar_128_ workflowName + varchar_255_ projectName +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.insights_metadata.md b/docs/generated/postgres-schema/public.insights_metadata.md new file mode 100644 index 00000000000..b917c8175b5 --- /dev/null +++ b/docs/generated/postgres-schema/public.insights_metadata.md @@ -0,0 +1,100 @@ +# public.insights_metadata + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| metaId | integer | | false | [public.insights_raw](public.insights_raw.md) [public.insights_by_period](public.insights_by_period.md) | | | +| workflowId | varchar(36) | | true | | [public.workflow_entity](public.workflow_entity.md) | | +| projectId | varchar(36) | | true | | [public.project](public.project.md) | | +| workflowName | varchar(128) | | false | | | | +| projectName | varchar(255) | | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| insights_metadata_metaId_not_null | n | NOT NULL "metaId" | +| insights_metadata_projectName_not_null | n | NOT NULL "projectName" | +| insights_metadata_workflowName_not_null | n | NOT NULL "workflowName" | +| FK_1d8ab99d5861c9388d2dc1cf733 | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE SET NULL | +| FK_2375a1eda085adb16b24615b69c | FOREIGN KEY | FOREIGN KEY ("projectId") REFERENCES project(id) ON DELETE SET NULL | +| PK_f448a94c35218b6208ce20cf5a1 | PRIMARY KEY | PRIMARY KEY ("metaId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_f448a94c35218b6208ce20cf5a1 | CREATE UNIQUE INDEX "PK_f448a94c35218b6208ce20cf5a1" ON public.insights_metadata USING btree ("metaId") | +| IDX_1d8ab99d5861c9388d2dc1cf73 | CREATE UNIQUE INDEX "IDX_1d8ab99d5861c9388d2dc1cf73" ON public.insights_metadata USING btree ("workflowId") | + +## Relations + +```mermaid +erDiagram + +"public.insights_raw" }o--|| "public.insights_metadata" : "FOREIGN KEY (#quot;metaId#quot;) REFERENCES insights_metadata(#quot;metaId#quot;) ON DELETE CASCADE" +"public.insights_by_period" }o--|| "public.insights_metadata" : "FOREIGN KEY (#quot;metaId#quot;) REFERENCES insights_metadata(#quot;metaId#quot;) ON DELETE CASCADE" +"public.insights_metadata" }o--o| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE SET NULL" +"public.insights_metadata" }o--o| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE SET NULL" + +"public.insights_metadata" { + integer metaId + varchar_36_ workflowId FK + varchar_36_ projectId FK + varchar_128_ workflowName + varchar_255_ projectName +} +"public.insights_raw" { + integer id + integer metaId FK + integer type + bigint value + timestamp_0__with_time_zone timestamp +} +"public.insights_by_period" { + integer id + integer metaId FK + integer type + bigint value + integer periodUnit + timestamp_0__with_time_zone periodStart +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +"public.project" { + varchar_36_ id + varchar_255_ name + varchar_36_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + varchar_512_ description + uuid creatorId FK + json customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.insights_raw.md b/docs/generated/postgres-schema/public.insights_raw.md new file mode 100644 index 00000000000..a2072e847bd --- /dev/null +++ b/docs/generated/postgres-schema/public.insights_raw.md @@ -0,0 +1,57 @@ +# public.insights_raw + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | integer | | false | | | | +| metaId | integer | | false | | [public.insights_metadata](public.insights_metadata.md) | | +| type | integer | | false | | | 0: time_saved_minutes, 1: runtime_milliseconds, 2: success, 3: failure | +| value | bigint | | false | | | | +| timestamp | timestamp(0) with time zone | CURRENT_TIMESTAMP | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| insights_raw_id_not_null | n | NOT NULL id | +| insights_raw_metaId_not_null | n | NOT NULL "metaId" | +| insights_raw_timestamp_not_null | n | NOT NULL "timestamp" | +| insights_raw_type_not_null | n | NOT NULL type | +| insights_raw_value_not_null | n | NOT NULL value | +| FK_6e2e33741adef2a7c5d66befa4e | FOREIGN KEY | FOREIGN KEY ("metaId") REFERENCES insights_metadata("metaId") ON DELETE CASCADE | +| PK_ec15125755151e3a7e00e00014f | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_ec15125755151e3a7e00e00014f | CREATE UNIQUE INDEX "PK_ec15125755151e3a7e00e00014f" ON public.insights_raw USING btree (id) | +| IDX_insights_raw_timestamp_id | CREATE INDEX "IDX_insights_raw_timestamp_id" ON public.insights_raw USING btree ("timestamp", id) | + +## Relations + +```mermaid +erDiagram + +"public.insights_raw" }o--|| "public.insights_metadata" : "FOREIGN KEY (#quot;metaId#quot;) REFERENCES insights_metadata(#quot;metaId#quot;) ON DELETE CASCADE" + +"public.insights_raw" { + integer id + integer metaId FK + integer type + bigint value + timestamp_0__with_time_zone timestamp +} +"public.insights_metadata" { + integer metaId + varchar_36_ workflowId FK + varchar_36_ projectId FK + varchar_128_ workflowName + varchar_255_ projectName +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.installed_nodes.md b/docs/generated/postgres-schema/public.installed_nodes.md new file mode 100644 index 00000000000..4f583b5d99a --- /dev/null +++ b/docs/generated/postgres-schema/public.installed_nodes.md @@ -0,0 +1,54 @@ +# public.installed_nodes + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| name | varchar(200) | | false | | | | +| type | varchar(200) | | false | | | | +| latestVersion | integer | 1 | false | | | | +| package | varchar(241) | | false | | [public.installed_packages](public.installed_packages.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| installed_nodes_latestVersion_not_null | n | NOT NULL "latestVersion" | +| installed_nodes_name_not_null | n | NOT NULL name | +| installed_nodes_package_not_null | n | NOT NULL package | +| installed_nodes_type_not_null | n | NOT NULL type | +| FK_73f857fc5dce682cef8a99c11dbddbc969618951 | FOREIGN KEY | FOREIGN KEY (package) REFERENCES installed_packages("packageName") ON UPDATE CASCADE ON DELETE CASCADE | +| PK_8ebd28194e4f792f96b5933423fc439df97d9689 | PRIMARY KEY | PRIMARY KEY (name) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_8ebd28194e4f792f96b5933423fc439df97d9689 | CREATE UNIQUE INDEX "PK_8ebd28194e4f792f96b5933423fc439df97d9689" ON public.installed_nodes USING btree (name) | + +## Relations + +```mermaid +erDiagram + +"public.installed_nodes" }o--|| "public.installed_packages" : "FOREIGN KEY (package) REFERENCES installed_packages(#quot;packageName#quot;) ON UPDATE CASCADE ON DELETE CASCADE" + +"public.installed_nodes" { + varchar_200_ name + varchar_200_ type + integer latestVersion + varchar_241_ package FK +} +"public.installed_packages" { + varchar_214_ packageName + varchar_50_ installedVersion + varchar_70_ authorName + varchar_70_ authorEmail + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.installed_packages.md b/docs/generated/postgres-schema/public.installed_packages.md new file mode 100644 index 00000000000..033ca09a638 --- /dev/null +++ b/docs/generated/postgres-schema/public.installed_packages.md @@ -0,0 +1,55 @@ +# public.installed_packages + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| packageName | varchar(214) | | false | [public.installed_nodes](public.installed_nodes.md) | | | +| installedVersion | varchar(50) | | false | | | | +| authorName | varchar(70) | | true | | | | +| authorEmail | varchar(70) | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| installed_packages_createdAt_not_null | n | NOT NULL "createdAt" | +| installed_packages_installedVersion_not_null | n | NOT NULL "installedVersion" | +| installed_packages_packageName_not_null | n | NOT NULL "packageName" | +| installed_packages_updatedAt_not_null | n | NOT NULL "updatedAt" | +| PK_08cc9197c39b028c1e9beca225940576fd1a5804 | PRIMARY KEY | PRIMARY KEY ("packageName") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_08cc9197c39b028c1e9beca225940576fd1a5804 | CREATE UNIQUE INDEX "PK_08cc9197c39b028c1e9beca225940576fd1a5804" ON public.installed_packages USING btree ("packageName") | + +## Relations + +```mermaid +erDiagram + +"public.installed_nodes" }o--|| "public.installed_packages" : "FOREIGN KEY (package) REFERENCES installed_packages(#quot;packageName#quot;) ON UPDATE CASCADE ON DELETE CASCADE" + +"public.installed_packages" { + varchar_214_ packageName + varchar_50_ installedVersion + varchar_70_ authorName + varchar_70_ authorEmail + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.installed_nodes" { + varchar_200_ name + varchar_200_ type + integer latestVersion + varchar_241_ package FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.instance_ai_checkpoints.md b/docs/generated/postgres-schema/public.instance_ai_checkpoints.md new file mode 100644 index 00000000000..81da6d37e8b --- /dev/null +++ b/docs/generated/postgres-schema/public.instance_ai_checkpoints.md @@ -0,0 +1,82 @@ +# public.instance_ai_checkpoints + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| key | varchar(255) | | false | [public.instance_ai_pending_confirmations](public.instance_ai_pending_confirmations.md) | | Opaque checkpoint key from the agent runtime. | +| runId | varchar(255) | | true | | | Run ID parsed from the checkpoint key when available. | +| threadId | uuid | | false | | [public.instance_ai_threads](public.instance_ai_threads.md) | Instance AI thread that owns the checkpoint. | +| resourceId | varchar(255) | | true | | | Resource ID recorded by the agent runtime. | +| state | json | | true | | | Serializable agent state snapshot stored as JSON. | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| expiredAt | timestamp(3) with time zone | | true | | | Soft-delete timestamp: null means live; non-null marks the row as a tombstone. | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| instance_ai_checkpoints_createdAt_not_null | n | NOT NULL "createdAt" | +| instance_ai_checkpoints_key_not_null | n | NOT NULL key | +| instance_ai_checkpoints_state_tombstone_check | CHECK | CHECK (((("expiredAt" IS NOT NULL) AND (state IS NULL)) OR ("expiredAt" IS NULL))) | +| instance_ai_checkpoints_threadId_not_null | n | NOT NULL "threadId" | +| instance_ai_checkpoints_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_2b23f3f24a70bebb990203b011e | FOREIGN KEY | FOREIGN KEY ("threadId") REFERENCES instance_ai_threads(id) ON DELETE CASCADE | +| PK_5315a45f0846d1f9d128c18a2ed | PRIMARY KEY | PRIMARY KEY (key) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_5315a45f0846d1f9d128c18a2ed | CREATE UNIQUE INDEX "PK_5315a45f0846d1f9d128c18a2ed" ON public.instance_ai_checkpoints USING btree (key) | +| IDX_768189b506cc26c4fe878b87cb | CREATE INDEX "IDX_768189b506cc26c4fe878b87cb" ON public.instance_ai_checkpoints USING btree ("runId") | +| IDX_2b23f3f24a70bebb990203b011 | CREATE INDEX "IDX_2b23f3f24a70bebb990203b011" ON public.instance_ai_checkpoints USING btree ("threadId") | +| IDX_be9d0eca0b19fb93d4eb74b327 | CREATE INDEX "IDX_be9d0eca0b19fb93d4eb74b327" ON public.instance_ai_checkpoints USING btree ("resourceId") | + +## Relations + +```mermaid +erDiagram + +"public.instance_ai_pending_confirmations" }o--o| "public.instance_ai_checkpoints" : "FOREIGN KEY (#quot;checkpointKey#quot;) REFERENCES instance_ai_checkpoints(key) ON DELETE CASCADE" +"public.instance_ai_checkpoints" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + +"public.instance_ai_checkpoints" { + varchar_255_ key + varchar_255_ runId + uuid threadId FK + varchar_255_ resourceId + json state + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + timestamp_3__with_time_zone expiredAt +} +"public.instance_ai_pending_confirmations" { + varchar_36_ requestId + uuid threadId FK + uuid userId FK + varchar_16_ kind + varchar_36_ runId + varchar_64_ toolCallId + varchar_36_ messageGroupId + varchar_255_ checkpointKey FK + varchar_36_ checkpointTaskId + timestamp_3__with_time_zone expiresAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_threads" { + uuid id + varchar_255_ resourceId + text title + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ projectId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.instance_ai_iteration_logs.md b/docs/generated/postgres-schema/public.instance_ai_iteration_logs.md new file mode 100644 index 00000000000..a4ec8539e96 --- /dev/null +++ b/docs/generated/postgres-schema/public.instance_ai_iteration_logs.md @@ -0,0 +1,62 @@ +# public.instance_ai_iteration_logs + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| threadId | uuid | | false | | [public.instance_ai_threads](public.instance_ai_threads.md) | | +| taskKey | varchar | | false | | | | +| entry | text | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| instance_ai_iteration_logs_createdAt_not_null | n | NOT NULL "createdAt" | +| instance_ai_iteration_logs_entry_not_null | n | NOT NULL entry | +| instance_ai_iteration_logs_id_not_null | n | NOT NULL id | +| instance_ai_iteration_logs_taskKey_not_null | n | NOT NULL "taskKey" | +| instance_ai_iteration_logs_threadId_not_null | n | NOT NULL "threadId" | +| instance_ai_iteration_logs_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_8bfcc6c51fd3d69b1eae8aebd49 | FOREIGN KEY | FOREIGN KEY ("threadId") REFERENCES instance_ai_threads(id) ON DELETE CASCADE | +| PK_21c2b214b44bc6c34a6d3551c90 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_21c2b214b44bc6c34a6d3551c90 | CREATE UNIQUE INDEX "PK_21c2b214b44bc6c34a6d3551c90" ON public.instance_ai_iteration_logs USING btree (id) | +| IDX_02751202c9a2ad75f2d8e14f5e | CREATE INDEX "IDX_02751202c9a2ad75f2d8e14f5e" ON public.instance_ai_iteration_logs USING btree ("threadId", "taskKey", "createdAt") | + +## Relations + +```mermaid +erDiagram + +"public.instance_ai_iteration_logs" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + +"public.instance_ai_iteration_logs" { + varchar_36_ id + uuid threadId FK + varchar taskKey + text entry + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_threads" { + uuid id + varchar_255_ resourceId + text title + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ projectId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.instance_ai_mcp_registry_connections.md b/docs/generated/postgres-schema/public.instance_ai_mcp_registry_connections.md new file mode 100644 index 00000000000..db321893029 --- /dev/null +++ b/docs/generated/postgres-schema/public.instance_ai_mcp_registry_connections.md @@ -0,0 +1,98 @@ +# public.instance_ai_mcp_registry_connections + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | uuid | | false | | | | +| credentialId | varchar(36) | | false | | [public.credentials_entity](public.credentials_entity.md) | | +| serverSlug | varchar(255) | | false | | [public.mcp_registry_server](public.mcp_registry_server.md) | | +| toolFilter | json | | true | | | Optional MCP tool filter per registry connection: { mode: "allow" \| "exclude", tools: string[] } | +| userId | uuid | | false | | [public.user](public.user.md) | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| instance_ai_mcp_registry_connections_createdAt_not_null | n | NOT NULL "createdAt" | +| instance_ai_mcp_registry_connections_credentialId_not_null | n | NOT NULL "credentialId" | +| instance_ai_mcp_registry_connections_id_not_null | n | NOT NULL id | +| instance_ai_mcp_registry_connections_serverSlug_not_null | n | NOT NULL "serverSlug" | +| instance_ai_mcp_registry_connections_updatedAt_not_null | n | NOT NULL "updatedAt" | +| instance_ai_mcp_registry_connections_userId_not_null | n | NOT NULL "userId" | +| FK_8b42c08a531d76410980c639a5b | FOREIGN KEY | FOREIGN KEY ("userId") REFERENCES "user"(id) ON DELETE CASCADE | +| FK_1e826120e7e53ebc4681f026de8 | FOREIGN KEY | FOREIGN KEY ("credentialId") REFERENCES credentials_entity(id) ON DELETE CASCADE | +| FK_1d25707354d2012da256eb2ec0a | FOREIGN KEY | FOREIGN KEY ("serverSlug") REFERENCES mcp_registry_server(slug) ON DELETE CASCADE | +| PK_e34e4d15d78eabbe8217e33ef03 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_e34e4d15d78eabbe8217e33ef03 | CREATE UNIQUE INDEX "PK_e34e4d15d78eabbe8217e33ef03" ON public.instance_ai_mcp_registry_connections USING btree (id) | +| IDX_16db3adb7b19df1ee55ff06b27 | CREATE UNIQUE INDEX "IDX_16db3adb7b19df1ee55ff06b27" ON public.instance_ai_mcp_registry_connections USING btree ("userId", "serverSlug", "credentialId") | + +## Relations + +```mermaid +erDiagram + +"public.instance_ai_mcp_registry_connections" }o--|| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE CASCADE" +"public.instance_ai_mcp_registry_connections" }o--|| "public.mcp_registry_server" : "FOREIGN KEY (#quot;serverSlug#quot;) REFERENCES mcp_registry_server(slug) ON DELETE CASCADE" +"public.instance_ai_mcp_registry_connections" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" + +"public.instance_ai_mcp_registry_connections" { + uuid id + varchar_36_ credentialId FK + varchar_255_ serverSlug FK + json toolFilter + uuid userId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.credentials_entity" { + varchar_128_ name + text data + varchar_128_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ id + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +"public.mcp_registry_server" { + varchar_255_ slug + varchar_50_ status + varchar_50_ version + timestamp_3__without_time_zone registryUpdatedAt + json data + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.instance_ai_messages.md b/docs/generated/postgres-schema/public.instance_ai_messages.md new file mode 100644 index 00000000000..26476946d14 --- /dev/null +++ b/docs/generated/postgres-schema/public.instance_ai_messages.md @@ -0,0 +1,67 @@ +# public.instance_ai_messages + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| threadId | uuid | | false | | [public.instance_ai_threads](public.instance_ai_threads.md) | | +| content | text | | false | | | | +| role | varchar(16) | | false | | | | +| type | varchar(32) | | true | | | | +| resourceId | varchar(255) | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| instance_ai_messages_content_not_null | n | NOT NULL content | +| instance_ai_messages_createdAt_not_null | n | NOT NULL "createdAt" | +| instance_ai_messages_id_not_null | n | NOT NULL id | +| instance_ai_messages_role_not_null | n | NOT NULL role | +| instance_ai_messages_threadId_not_null | n | NOT NULL "threadId" | +| instance_ai_messages_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_1eeb64cb9d66a927988de759e6e | FOREIGN KEY | FOREIGN KEY ("threadId") REFERENCES instance_ai_threads(id) ON DELETE CASCADE | +| PK_156c6f287225e9befe0181bb02b | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_156c6f287225e9befe0181bb02b | CREATE UNIQUE INDEX "PK_156c6f287225e9befe0181bb02b" ON public.instance_ai_messages USING btree (id) | +| IDX_1eeb64cb9d66a927988de759e6 | CREATE INDEX "IDX_1eeb64cb9d66a927988de759e6" ON public.instance_ai_messages USING btree ("threadId") | +| IDX_76e212c6867fbaa06bf0decd6f | CREATE INDEX "IDX_76e212c6867fbaa06bf0decd6f" ON public.instance_ai_messages USING btree ("resourceId") | + +## Relations + +```mermaid +erDiagram + +"public.instance_ai_messages" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + +"public.instance_ai_messages" { + varchar_36_ id + uuid threadId FK + text content + varchar_16_ role + varchar_32_ type + varchar_255_ resourceId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_threads" { + uuid id + varchar_255_ resourceId + text title + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ projectId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.instance_ai_observation_cursors.md b/docs/generated/postgres-schema/public.instance_ai_observation_cursors.md new file mode 100644 index 00000000000..eed63efb54b --- /dev/null +++ b/docs/generated/postgres-schema/public.instance_ai_observation_cursors.md @@ -0,0 +1,58 @@ +# public.instance_ai_observation_cursors + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| observationScopeId | uuid | | false | | [public.instance_ai_threads](public.instance_ai_threads.md) | instance_ai_threads.id source stream checkpointed by this cursor | +| lastObservedMessageId | varchar(36) | | false | | | | +| lastObservedAt | timestamp(3) with time zone | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| instance_ai_observation_cursors_createdAt_not_null | n | NOT NULL "createdAt" | +| instance_ai_observation_cursors_lastObservedAt_not_null | n | NOT NULL "lastObservedAt" | +| instance_ai_observation_cursors_lastObservedMessageId_not_null | n | NOT NULL "lastObservedMessageId" | +| instance_ai_observation_cursors_observationScopeId_not_null | n | NOT NULL "observationScopeId" | +| instance_ai_observation_cursors_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_5b6319b2e9a37c1064a72428f9a | FOREIGN KEY | FOREIGN KEY ("observationScopeId") REFERENCES instance_ai_threads(id) ON DELETE CASCADE | +| PK_5b6319b2e9a37c1064a72428f9a | PRIMARY KEY | PRIMARY KEY ("observationScopeId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_5b6319b2e9a37c1064a72428f9a | CREATE UNIQUE INDEX "PK_5b6319b2e9a37c1064a72428f9a" ON public.instance_ai_observation_cursors USING btree ("observationScopeId") | + +## Relations + +```mermaid +erDiagram + +"public.instance_ai_observation_cursors" |o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + +"public.instance_ai_observation_cursors" { + uuid observationScopeId FK + varchar_36_ lastObservedMessageId + timestamp_3__with_time_zone lastObservedAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_threads" { + uuid id + varchar_255_ resourceId + text title + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ projectId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.instance_ai_observation_locks.md b/docs/generated/postgres-schema/public.instance_ai_observation_locks.md new file mode 100644 index 00000000000..d8c36162e2c --- /dev/null +++ b/docs/generated/postgres-schema/public.instance_ai_observation_locks.md @@ -0,0 +1,62 @@ +# public.instance_ai_observation_locks + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| observationScopeId | uuid | | false | | [public.instance_ai_threads](public.instance_ai_threads.md) | instance_ai_threads.id source stream locked for observation tasks | +| taskKind | varchar(20) | | false | | | | +| holderId | varchar(64) | | false | | | Ephemeral background-task lock owner token, not a user ID | +| heldUntil | timestamp(3) with time zone | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| CHK_instance_ai_observation_locks_taskKind | CHECK | CHECK ((("taskKind")::text = ANY ((ARRAY['observer'::character varying, 'reflector'::character varying])::text[]))) | +| instance_ai_observation_locks_createdAt_not_null | n | NOT NULL "createdAt" | +| instance_ai_observation_locks_heldUntil_not_null | n | NOT NULL "heldUntil" | +| instance_ai_observation_locks_holderId_not_null | n | NOT NULL "holderId" | +| instance_ai_observation_locks_observationScopeId_not_null | n | NOT NULL "observationScopeId" | +| instance_ai_observation_locks_taskKind_not_null | n | NOT NULL "taskKind" | +| instance_ai_observation_locks_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_103e2e5f454860b28ea05a82c74 | FOREIGN KEY | FOREIGN KEY ("observationScopeId") REFERENCES instance_ai_threads(id) ON DELETE CASCADE | +| PK_fc491dd378b9448655c3c683f85 | PRIMARY KEY | PRIMARY KEY ("observationScopeId", "taskKind") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_fc491dd378b9448655c3c683f85 | CREATE UNIQUE INDEX "PK_fc491dd378b9448655c3c683f85" ON public.instance_ai_observation_locks USING btree ("observationScopeId", "taskKind") | + +## Relations + +```mermaid +erDiagram + +"public.instance_ai_observation_locks" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + +"public.instance_ai_observation_locks" { + uuid observationScopeId FK + varchar_20_ taskKind + varchar_64_ holderId + timestamp_3__with_time_zone heldUntil + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_threads" { + uuid id + varchar_255_ resourceId + text title + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ projectId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.instance_ai_observational_memory.md b/docs/generated/postgres-schema/public.instance_ai_observational_memory.md new file mode 100644 index 00000000000..12751c2634c --- /dev/null +++ b/docs/generated/postgres-schema/public.instance_ai_observational_memory.md @@ -0,0 +1,127 @@ +# public.instance_ai_observational_memory + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| lookupKey | varchar(255) | | false | | | | +| scope | varchar(16) | | false | | | | +| threadId | uuid | | true | | [public.instance_ai_threads](public.instance_ai_threads.md) | | +| resourceId | varchar(255) | | false | | | | +| activeObservations | text | ''::text | false | | | | +| originType | varchar(32) | | false | | | | +| config | text | | false | | | | +| generationCount | integer | 0 | false | | | | +| lastObservedAt | timestamp(3) with time zone | | true | | | | +| pendingMessageTokens | integer | 0 | false | | | | +| totalTokensObserved | integer | 0 | false | | | | +| observationTokenCount | integer | 0 | false | | | | +| isObserving | boolean | false | false | | | | +| isReflecting | boolean | false | false | | | | +| observedMessageIds | json | | true | | | | +| observedTimezone | varchar | | true | | | | +| bufferedObservations | text | | true | | | | +| bufferedObservationTokens | integer | | true | | | | +| bufferedMessageIds | json | | true | | | | +| bufferedReflection | text | | true | | | | +| bufferedReflectionTokens | integer | | true | | | | +| bufferedReflectionInputTokens | integer | | true | | | | +| reflectedObservationLineCount | integer | | true | | | | +| bufferedObservationChunks | json | | true | | | | +| isBufferingObservation | boolean | false | false | | | | +| isBufferingReflection | boolean | false | false | | | | +| lastBufferedAtTokens | integer | 0 | false | | | | +| lastBufferedAtTime | timestamp(3) with time zone | | true | | | | +| metadata | json | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| instance_ai_observational_memor_isBufferingObservation_not_null | n | NOT NULL "isBufferingObservation" | +| instance_ai_observational_memory_activeObservations_not_null | n | NOT NULL "activeObservations" | +| instance_ai_observational_memory_config_not_null | n | NOT NULL config | +| instance_ai_observational_memory_createdAt_not_null | n | NOT NULL "createdAt" | +| instance_ai_observational_memory_generationCount_not_null | n | NOT NULL "generationCount" | +| instance_ai_observational_memory_id_not_null | n | NOT NULL id | +| instance_ai_observational_memory_isBufferingReflection_not_null | n | NOT NULL "isBufferingReflection" | +| instance_ai_observational_memory_isObserving_not_null | n | NOT NULL "isObserving" | +| instance_ai_observational_memory_isReflecting_not_null | n | NOT NULL "isReflecting" | +| instance_ai_observational_memory_lastBufferedAtTokens_not_null | n | NOT NULL "lastBufferedAtTokens" | +| instance_ai_observational_memory_lookupKey_not_null | n | NOT NULL "lookupKey" | +| instance_ai_observational_memory_observationTokenCount_not_null | n | NOT NULL "observationTokenCount" | +| instance_ai_observational_memory_originType_not_null | n | NOT NULL "originType" | +| instance_ai_observational_memory_pendingMessageTokens_not_null | n | NOT NULL "pendingMessageTokens" | +| instance_ai_observational_memory_resourceId_not_null | n | NOT NULL "resourceId" | +| instance_ai_observational_memory_scope_not_null | n | NOT NULL scope | +| instance_ai_observational_memory_totalTokensObserved_not_null | n | NOT NULL "totalTokensObserved" | +| instance_ai_observational_memory_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_34018c303885cd37093458e6409 | FOREIGN KEY | FOREIGN KEY ("threadId") REFERENCES instance_ai_threads(id) ON DELETE SET NULL | +| PK_7192dd00cddba039bf1d3e6a098 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_7192dd00cddba039bf1d3e6a098 | CREATE UNIQUE INDEX "PK_7192dd00cddba039bf1d3e6a098" ON public.instance_ai_observational_memory USING btree (id) | +| IDX_92f13cb6bc694227e069447f7b | CREATE INDEX "IDX_92f13cb6bc694227e069447f7b" ON public.instance_ai_observational_memory USING btree ("lookupKey") | +| IDX_a680ac96aae02dc887bbaac512 | CREATE UNIQUE INDEX "IDX_a680ac96aae02dc887bbaac512" ON public.instance_ai_observational_memory USING btree (scope, "threadId", "resourceId") | + +## Relations + +```mermaid +erDiagram + +"public.instance_ai_observational_memory" }o--o| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE SET NULL" + +"public.instance_ai_observational_memory" { + varchar_36_ id + varchar_255_ lookupKey + varchar_16_ scope + uuid threadId FK + varchar_255_ resourceId + text activeObservations + varchar_32_ originType + text config + integer generationCount + timestamp_3__with_time_zone lastObservedAt + integer pendingMessageTokens + integer totalTokensObserved + integer observationTokenCount + boolean isObserving + boolean isReflecting + json observedMessageIds + varchar observedTimezone + text bufferedObservations + integer bufferedObservationTokens + json bufferedMessageIds + text bufferedReflection + integer bufferedReflectionTokens + integer bufferedReflectionInputTokens + integer reflectedObservationLineCount + json bufferedObservationChunks + boolean isBufferingObservation + boolean isBufferingReflection + integer lastBufferedAtTokens + timestamp_3__with_time_zone lastBufferedAtTime + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_threads" { + uuid id + varchar_255_ resourceId + text title + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ projectId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.instance_ai_observations.md b/docs/generated/postgres-schema/public.instance_ai_observations.md new file mode 100644 index 00000000000..2cbe003dde6 --- /dev/null +++ b/docs/generated/postgres-schema/public.instance_ai_observations.md @@ -0,0 +1,80 @@ +# public.instance_ai_observations + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [public.instance_ai_observations](public.instance_ai_observations.md) | | Application-generated n8n string ID, not a database UUID | +| observationScopeId | uuid | | false | | [public.instance_ai_threads](public.instance_ai_threads.md) | instance_ai_threads.id source stream for this observation log | +| marker | varchar(16) | | false | | | | +| text | text | | false | | | | +| parentId | varchar(36) | | true | | [public.instance_ai_observations](public.instance_ai_observations.md) | | +| tokenCount | integer | 0 | false | | | | +| status | varchar(16) | | false | | | | +| supersededBy | varchar(36) | | true | | [public.instance_ai_observations](public.instance_ai_observations.md) | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| CHK_instance_ai_observations_marker | CHECK | CHECK (((marker)::text = ANY ((ARRAY['critical'::character varying, 'important'::character varying, 'info'::character varying, 'completion'::character varying])::text[]))) | +| CHK_instance_ai_observations_status | CHECK | CHECK (((status)::text = ANY ((ARRAY['active'::character varying, 'superseded'::character varying, 'dropped'::character varying])::text[]))) | +| instance_ai_observations_createdAt_not_null | n | NOT NULL "createdAt" | +| instance_ai_observations_id_not_null | n | NOT NULL id | +| instance_ai_observations_marker_not_null | n | NOT NULL marker | +| instance_ai_observations_observationScopeId_not_null | n | NOT NULL "observationScopeId" | +| instance_ai_observations_status_not_null | n | NOT NULL status | +| instance_ai_observations_text_not_null | n | NOT NULL text | +| instance_ai_observations_tokenCount_not_null | n | NOT NULL "tokenCount" | +| instance_ai_observations_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_d54fc84a6c8ac91b5e0db0378a4 | FOREIGN KEY | FOREIGN KEY ("observationScopeId") REFERENCES instance_ai_threads(id) ON DELETE CASCADE | +| FK_a80e0ee839a2f10ba4b86e19998 | FOREIGN KEY | FOREIGN KEY ("supersededBy") REFERENCES instance_ai_observations(id) | +| FK_daef2195a4a846eb70eed15e039 | FOREIGN KEY | FOREIGN KEY ("parentId") REFERENCES instance_ai_observations(id) | +| PK_4d9b514cdf0f0b577650caf2ac2 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_4d9b514cdf0f0b577650caf2ac2 | CREATE UNIQUE INDEX "PK_4d9b514cdf0f0b577650caf2ac2" ON public.instance_ai_observations USING btree (id) | +| IDX_0d5db648188d338df7fb2a8064 | CREATE INDEX "IDX_0d5db648188d338df7fb2a8064" ON public.instance_ai_observations USING btree ("observationScopeId", status, "createdAt", id) | +| IDX_daef2195a4a846eb70eed15e03 | CREATE INDEX "IDX_daef2195a4a846eb70eed15e03" ON public.instance_ai_observations USING btree ("parentId") | +| IDX_a80e0ee839a2f10ba4b86e1999 | CREATE INDEX "IDX_a80e0ee839a2f10ba4b86e1999" ON public.instance_ai_observations USING btree ("supersededBy") | + +## Relations + +```mermaid +erDiagram + +"public.instance_ai_observations" }o--o| "public.instance_ai_observations" : "FOREIGN KEY (#quot;supersededBy#quot;) REFERENCES instance_ai_observations(id)" +"public.instance_ai_observations" }o--o| "public.instance_ai_observations" : "FOREIGN KEY (#quot;parentId#quot;) REFERENCES instance_ai_observations(id)" +"public.instance_ai_observations" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + +"public.instance_ai_observations" { + varchar_36_ id + uuid observationScopeId FK + varchar_16_ marker + text text + varchar_36_ parentId FK + integer tokenCount + varchar_16_ status + varchar_36_ supersededBy FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_threads" { + uuid id + varchar_255_ resourceId + text title + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ projectId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.instance_ai_pending_confirmations.md b/docs/generated/postgres-schema/public.instance_ai_pending_confirmations.md new file mode 100644 index 00000000000..4b669775af3 --- /dev/null +++ b/docs/generated/postgres-schema/public.instance_ai_pending_confirmations.md @@ -0,0 +1,110 @@ +# public.instance_ai_pending_confirmations + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| requestId | varchar(36) | | false | | | HITL confirmation request identifier. | +| threadId | uuid | | false | | [public.instance_ai_threads](public.instance_ai_threads.md) | Instance AI thread that owns the confirmation. | +| userId | uuid | | false | | [public.user](public.user.md) | User who is expected to confirm or cancel. | +| kind | varchar(16) | | false | | | 'suspended' (resumable from checkpoint) or 'inline' (orchestrator-held Promise). | +| runId | varchar(36) | | false | | | External run ID; reused on resume for SSE correlation. | +| toolCallId | varchar(64) | | true | | | Suspended tool call awaiting confirmation. | +| messageGroupId | varchar(36) | | true | | | SSE event correlation group. | +| checkpointKey | varchar(255) | | true | | [public.instance_ai_checkpoints](public.instance_ai_checkpoints.md) | FK to instance_ai_checkpoints.key; also the SDK runId used to resume. | +| checkpointTaskId | varchar(36) | | true | | | Set when the suspended run was a planned-task checkpoint follow-up. | +| expiresAt | timestamp(3) with time zone | | true | | | TTL for the leader-only sweep; null disables auto-expiry. | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| CHK_instance_ai_pending_confirmations_kind | CHECK | CHECK (((kind)::text = ANY ((ARRAY['suspended'::character varying, 'inline'::character varying])::text[]))) | +| instance_ai_pending_confirmations_createdAt_not_null | n | NOT NULL "createdAt" | +| instance_ai_pending_confirmations_kind_not_null | n | NOT NULL kind | +| instance_ai_pending_confirmations_requestId_not_null | n | NOT NULL "requestId" | +| instance_ai_pending_confirmations_runId_not_null | n | NOT NULL "runId" | +| instance_ai_pending_confirmations_threadId_not_null | n | NOT NULL "threadId" | +| instance_ai_pending_confirmations_updatedAt_not_null | n | NOT NULL "updatedAt" | +| instance_ai_pending_confirmations_userId_not_null | n | NOT NULL "userId" | +| FK_df5fd25c8bbfd2b042602600d8e | FOREIGN KEY | FOREIGN KEY ("userId") REFERENCES "user"(id) ON DELETE CASCADE | +| FK_ba67ee8dc311830a2eea89b6e96 | FOREIGN KEY | FOREIGN KEY ("threadId") REFERENCES instance_ai_threads(id) ON DELETE CASCADE | +| FK_0babdf6e3b897a86fe4678355eb | FOREIGN KEY | FOREIGN KEY ("checkpointKey") REFERENCES instance_ai_checkpoints(key) ON DELETE CASCADE | +| PK_25c38179c8d45095b168adfff80 | PRIMARY KEY | PRIMARY KEY ("requestId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_25c38179c8d45095b168adfff80 | CREATE UNIQUE INDEX "PK_25c38179c8d45095b168adfff80" ON public.instance_ai_pending_confirmations USING btree ("requestId") | +| IDX_ba67ee8dc311830a2eea89b6e9 | CREATE INDEX "IDX_ba67ee8dc311830a2eea89b6e9" ON public.instance_ai_pending_confirmations USING btree ("threadId") | +| IDX_df5fd25c8bbfd2b042602600d8 | CREATE INDEX "IDX_df5fd25c8bbfd2b042602600d8" ON public.instance_ai_pending_confirmations USING btree ("userId") | +| IDX_0babdf6e3b897a86fe4678355e | CREATE INDEX "IDX_0babdf6e3b897a86fe4678355e" ON public.instance_ai_pending_confirmations USING btree ("checkpointKey") | +| IDX_d7a4aba7440449865e2b924377 | CREATE INDEX "IDX_d7a4aba7440449865e2b924377" ON public.instance_ai_pending_confirmations USING btree ("expiresAt") | + +## Relations + +```mermaid +erDiagram + +"public.instance_ai_pending_confirmations" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.instance_ai_pending_confirmations" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.instance_ai_pending_confirmations" }o--o| "public.instance_ai_checkpoints" : "FOREIGN KEY (#quot;checkpointKey#quot;) REFERENCES instance_ai_checkpoints(key) ON DELETE CASCADE" + +"public.instance_ai_pending_confirmations" { + varchar_36_ requestId + uuid threadId FK + uuid userId FK + varchar_16_ kind + varchar_36_ runId + varchar_64_ toolCallId + varchar_36_ messageGroupId + varchar_255_ checkpointKey FK + varchar_36_ checkpointTaskId + timestamp_3__with_time_zone expiresAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_threads" { + uuid id + varchar_255_ resourceId + text title + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ projectId FK +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"public.instance_ai_checkpoints" { + varchar_255_ key + varchar_255_ runId + uuid threadId FK + varchar_255_ resourceId + json state + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + timestamp_3__with_time_zone expiredAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.instance_ai_resources.md b/docs/generated/postgres-schema/public.instance_ai_resources.md new file mode 100644 index 00000000000..bca6c5cf9c3 --- /dev/null +++ b/docs/generated/postgres-schema/public.instance_ai_resources.md @@ -0,0 +1,45 @@ +# public.instance_ai_resources + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(255) | | false | | | | +| workingMemory | text | | true | | | | +| metadata | json | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| instance_ai_resources_createdAt_not_null | n | NOT NULL "createdAt" | +| instance_ai_resources_id_not_null | n | NOT NULL id | +| instance_ai_resources_updatedAt_not_null | n | NOT NULL "updatedAt" | +| PK_45b5b0b6f715dae4292b86603d8 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_45b5b0b6f715dae4292b86603d8 | CREATE UNIQUE INDEX "PK_45b5b0b6f715dae4292b86603d8" ON public.instance_ai_resources USING btree (id) | + +## Relations + +```mermaid +erDiagram + + +"public.instance_ai_resources" { + varchar_255_ id + text workingMemory + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.instance_ai_run_snapshots.md b/docs/generated/postgres-schema/public.instance_ai_run_snapshots.md new file mode 100644 index 00000000000..2aff5176c7c --- /dev/null +++ b/docs/generated/postgres-schema/public.instance_ai_run_snapshots.md @@ -0,0 +1,72 @@ +# public.instance_ai_run_snapshots + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| threadId | uuid | | false | | [public.instance_ai_threads](public.instance_ai_threads.md) | | +| runId | varchar(36) | | false | | | | +| messageGroupId | varchar(36) | | true | | | | +| runIds | json | | true | | | | +| tree | text | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| langsmithRunId | varchar(36) | | true | | | LangSmith run ID (UUID v4, e.g. "f47ac10b-58cc-4372-a567-0e02b2c3d479"). | +| langsmithTraceId | varchar(36) | | true | | | LangSmith trace ID (UUID v4, e.g. "f47ac10b-58cc-4372-a567-0e02b2c3d479"). | +| traceId | varchar(64) | | true | | | OpenTelemetry trace ID for the root Instance AI run. | +| spanId | varchar(64) | | true | | | OpenTelemetry span ID for the root Instance AI run. | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| instance_ai_run_snapshots_createdAt_not_null | n | NOT NULL "createdAt" | +| instance_ai_run_snapshots_runId_not_null | n | NOT NULL "runId" | +| instance_ai_run_snapshots_threadId_not_null | n | NOT NULL "threadId" | +| instance_ai_run_snapshots_tree_not_null | n | NOT NULL tree | +| instance_ai_run_snapshots_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_2f63fa21d09d7918f347ddbdf70 | FOREIGN KEY | FOREIGN KEY ("threadId") REFERENCES instance_ai_threads(id) ON DELETE CASCADE | +| PK_0a5fc9690a84950ebf1416fb146 | PRIMARY KEY | PRIMARY KEY ("threadId", "runId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_0a5fc9690a84950ebf1416fb146 | CREATE UNIQUE INDEX "PK_0a5fc9690a84950ebf1416fb146" ON public.instance_ai_run_snapshots USING btree ("threadId", "runId") | +| IDX_d926c16c2ad9728cb9a81790c0 | CREATE INDEX "IDX_d926c16c2ad9728cb9a81790c0" ON public.instance_ai_run_snapshots USING btree ("threadId", "messageGroupId") | +| IDX_d3a2bc880e7a8626802e5474ad | CREATE INDEX "IDX_d3a2bc880e7a8626802e5474ad" ON public.instance_ai_run_snapshots USING btree ("threadId", "createdAt") | + +## Relations + +```mermaid +erDiagram + +"public.instance_ai_run_snapshots" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + +"public.instance_ai_run_snapshots" { + uuid threadId FK + varchar_36_ runId + varchar_36_ messageGroupId + json runIds + text tree + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ langsmithRunId + varchar_36_ langsmithTraceId + varchar_64_ traceId + varchar_64_ spanId +} +"public.instance_ai_threads" { + uuid id + varchar_255_ resourceId + text title + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ projectId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.instance_ai_threads.md b/docs/generated/postgres-schema/public.instance_ai_threads.md new file mode 100644 index 00000000000..b5c692e557e --- /dev/null +++ b/docs/generated/postgres-schema/public.instance_ai_threads.md @@ -0,0 +1,199 @@ +# public.instance_ai_threads + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | uuid | | false | [public.instance_ai_messages](public.instance_ai_messages.md) [public.instance_ai_observational_memory](public.instance_ai_observational_memory.md) [public.instance_ai_run_snapshots](public.instance_ai_run_snapshots.md) [public.instance_ai_iteration_logs](public.instance_ai_iteration_logs.md) [public.ai_builder_temporary_workflow](public.ai_builder_temporary_workflow.md) [public.instance_ai_checkpoints](public.instance_ai_checkpoints.md) [public.instance_ai_observations](public.instance_ai_observations.md) [public.instance_ai_observation_cursors](public.instance_ai_observation_cursors.md) [public.instance_ai_observation_locks](public.instance_ai_observation_locks.md) [public.instance_ai_pending_confirmations](public.instance_ai_pending_confirmations.md) | | | +| resourceId | varchar(255) | | false | | | | +| title | text | ''::text | false | | | | +| metadata | json | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| projectId | varchar(36) | | false | | [public.project](public.project.md) | Project this thread is scoped to | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| instance_ai_threads_createdAt_not_null | n | NOT NULL "createdAt" | +| instance_ai_threads_id_not_null | n | NOT NULL id | +| instance_ai_threads_projectId_not_null | n | NOT NULL "projectId" | +| instance_ai_threads_resourceId_not_null | n | NOT NULL "resourceId" | +| instance_ai_threads_title_not_null | n | NOT NULL title | +| instance_ai_threads_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_instance_ai_threads_projectId | FOREIGN KEY | FOREIGN KEY ("projectId") REFERENCES project(id) ON DELETE CASCADE | +| PK_35575100e45cdedeb89ae0643e9 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_35575100e45cdedeb89ae0643e9 | CREATE UNIQUE INDEX "PK_35575100e45cdedeb89ae0643e9" ON public.instance_ai_threads USING btree (id) | +| IDX_f36dea4d38fe92e0e8f44d5a56 | CREATE INDEX "IDX_f36dea4d38fe92e0e8f44d5a56" ON public.instance_ai_threads USING btree ("resourceId") | +| IDX_instance_ai_threads_projectId | CREATE INDEX "IDX_instance_ai_threads_projectId" ON public.instance_ai_threads USING btree ("projectId") | + +## Relations + +```mermaid +erDiagram + +"public.instance_ai_messages" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.instance_ai_observational_memory" }o--o| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE SET NULL" +"public.instance_ai_run_snapshots" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.instance_ai_iteration_logs" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.ai_builder_temporary_workflow" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.instance_ai_checkpoints" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.instance_ai_observations" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.instance_ai_observation_cursors" |o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.instance_ai_observation_locks" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;observationScopeId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.instance_ai_pending_confirmations" }o--|| "public.instance_ai_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES instance_ai_threads(id) ON DELETE CASCADE" +"public.instance_ai_threads" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" + +"public.instance_ai_threads" { + uuid id + varchar_255_ resourceId + text title + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ projectId FK +} +"public.instance_ai_messages" { + varchar_36_ id + uuid threadId FK + text content + varchar_16_ role + varchar_32_ type + varchar_255_ resourceId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_observational_memory" { + varchar_36_ id + varchar_255_ lookupKey + varchar_16_ scope + uuid threadId FK + varchar_255_ resourceId + text activeObservations + varchar_32_ originType + text config + integer generationCount + timestamp_3__with_time_zone lastObservedAt + integer pendingMessageTokens + integer totalTokensObserved + integer observationTokenCount + boolean isObserving + boolean isReflecting + json observedMessageIds + varchar observedTimezone + text bufferedObservations + integer bufferedObservationTokens + json bufferedMessageIds + text bufferedReflection + integer bufferedReflectionTokens + integer bufferedReflectionInputTokens + integer reflectedObservationLineCount + json bufferedObservationChunks + boolean isBufferingObservation + boolean isBufferingReflection + integer lastBufferedAtTokens + timestamp_3__with_time_zone lastBufferedAtTime + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_run_snapshots" { + uuid threadId FK + varchar_36_ runId + varchar_36_ messageGroupId + json runIds + text tree + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ langsmithRunId + varchar_36_ langsmithTraceId + varchar_64_ traceId + varchar_64_ spanId +} +"public.instance_ai_iteration_logs" { + varchar_36_ id + uuid threadId FK + varchar taskKey + text entry + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.ai_builder_temporary_workflow" { + varchar_36_ workflowId FK + uuid threadId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_checkpoints" { + varchar_255_ key + varchar_255_ runId + uuid threadId FK + varchar_255_ resourceId + json state + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + timestamp_3__with_time_zone expiredAt +} +"public.instance_ai_observations" { + varchar_36_ id + uuid observationScopeId FK + varchar_16_ marker + text text + varchar_36_ parentId FK + integer tokenCount + varchar_16_ status + varchar_36_ supersededBy FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_observation_cursors" { + uuid observationScopeId FK + varchar_36_ lastObservedMessageId + timestamp_3__with_time_zone lastObservedAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_observation_locks" { + uuid observationScopeId FK + varchar_20_ taskKind + varchar_64_ holderId + timestamp_3__with_time_zone heldUntil + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_pending_confirmations" { + varchar_36_ requestId + uuid threadId FK + uuid userId FK + varchar_16_ kind + varchar_36_ runId + varchar_64_ toolCallId + varchar_36_ messageGroupId + varchar_255_ checkpointKey FK + varchar_36_ checkpointTaskId + timestamp_3__with_time_zone expiresAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.project" { + varchar_36_ id + varchar_255_ name + varchar_36_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + varchar_512_ description + uuid creatorId FK + json customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.instance_ai_workflow_snapshots.md b/docs/generated/postgres-schema/public.instance_ai_workflow_snapshots.md new file mode 100644 index 00000000000..3bcb39ef852 --- /dev/null +++ b/docs/generated/postgres-schema/public.instance_ai_workflow_snapshots.md @@ -0,0 +1,52 @@ +# public.instance_ai_workflow_snapshots + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| runId | varchar(36) | | false | | | | +| workflowName | varchar(255) | | false | | | | +| resourceId | varchar(255) | | true | | | | +| status | varchar | | true | | | | +| snapshot | text | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| instance_ai_workflow_snapshots_createdAt_not_null | n | NOT NULL "createdAt" | +| instance_ai_workflow_snapshots_runId_not_null | n | NOT NULL "runId" | +| instance_ai_workflow_snapshots_snapshot_not_null | n | NOT NULL snapshot | +| instance_ai_workflow_snapshots_updatedAt_not_null | n | NOT NULL "updatedAt" | +| instance_ai_workflow_snapshots_workflowName_not_null | n | NOT NULL "workflowName" | +| PK_93f2696eb321dfe1d7defe7073f | PRIMARY KEY | PRIMARY KEY ("runId", "workflowName") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_93f2696eb321dfe1d7defe7073f | CREATE UNIQUE INDEX "PK_93f2696eb321dfe1d7defe7073f" ON public.instance_ai_workflow_snapshots USING btree ("runId", "workflowName") | +| IDX_a371ee6b8e0ebb5635f8baa46d | CREATE INDEX "IDX_a371ee6b8e0ebb5635f8baa46d" ON public.instance_ai_workflow_snapshots USING btree ("workflowName", status) | + +## Relations + +```mermaid +erDiagram + + +"public.instance_ai_workflow_snapshots" { + varchar_36_ runId + varchar_255_ workflowName + varchar_255_ resourceId + varchar status + text snapshot + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.instance_version_history.md b/docs/generated/postgres-schema/public.instance_version_history.md new file mode 100644 index 00000000000..e7d8313d57b --- /dev/null +++ b/docs/generated/postgres-schema/public.instance_version_history.md @@ -0,0 +1,47 @@ +# public.instance_version_history + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | integer | nextval('instance_version_history_id_seq'::regclass) | false | | | | +| major | integer | | false | | | | +| minor | integer | | false | | | | +| patch | integer | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| instance_version_history_createdAt_not_null | n | NOT NULL "createdAt" | +| instance_version_history_id_not_null | n | NOT NULL id | +| instance_version_history_major_not_null | n | NOT NULL major | +| instance_version_history_minor_not_null | n | NOT NULL minor | +| instance_version_history_patch_not_null | n | NOT NULL patch | +| PK_874f58cb616935bf49d9dbd67e9 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_874f58cb616935bf49d9dbd67e9 | CREATE UNIQUE INDEX "PK_874f58cb616935bf49d9dbd67e9" ON public.instance_version_history USING btree (id) | + +## Relations + +```mermaid +erDiagram + + +"public.instance_version_history" { + integer id + integer major + integer minor + integer patch + timestamp_3__with_time_zone createdAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.invalid_auth_token.md b/docs/generated/postgres-schema/public.invalid_auth_token.md new file mode 100644 index 00000000000..d28639e19bd --- /dev/null +++ b/docs/generated/postgres-schema/public.invalid_auth_token.md @@ -0,0 +1,38 @@ +# public.invalid_auth_token + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| token | varchar(512) | | false | | | | +| expiresAt | timestamp(3) with time zone | | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| invalid_auth_token_expiresAt_not_null | n | NOT NULL "expiresAt" | +| invalid_auth_token_token_not_null | n | NOT NULL token | +| PK_5779069b7235b256d91f7af1a15 | PRIMARY KEY | PRIMARY KEY (token) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_5779069b7235b256d91f7af1a15 | CREATE UNIQUE INDEX "PK_5779069b7235b256d91f7af1a15" ON public.invalid_auth_token USING btree (token) | + +## Relations + +```mermaid +erDiagram + + +"public.invalid_auth_token" { + varchar_512_ token + timestamp_3__with_time_zone expiresAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.mcp_registry_server.md b/docs/generated/postgres-schema/public.mcp_registry_server.md new file mode 100644 index 00000000000..dd24260fd52 --- /dev/null +++ b/docs/generated/postgres-schema/public.mcp_registry_server.md @@ -0,0 +1,64 @@ +# public.mcp_registry_server + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| slug | varchar(255) | | false | [public.instance_ai_mcp_registry_connections](public.instance_ai_mcp_registry_connections.md) | | | +| status | varchar(50) | | false | | | Server status in the MCP registry. Deprecated servers are not surfaced to users. | +| version | varchar(50) | | false | | | | +| registryUpdatedAt | timestamp(3) without time zone | | false | | | | +| data | json | '{}'::json | false | | | JSON object containing server metadata (icons, remotes, tools, etc.) | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| CHK_tmp_mcp_registry_server_status | CHECK | CHECK (((status)::text = ANY ((ARRAY['active'::character varying, 'deprecated'::character varying])::text[]))) | +| tmp_mcp_registry_server_createdAt_not_null | n | NOT NULL "createdAt" | +| tmp_mcp_registry_server_data_not_null | n | NOT NULL data | +| tmp_mcp_registry_server_registryUpdatedAt_not_null | n | NOT NULL "registryUpdatedAt" | +| tmp_mcp_registry_server_slug_not_null | n | NOT NULL slug | +| tmp_mcp_registry_server_status_not_null | n | NOT NULL status | +| tmp_mcp_registry_server_updatedAt_not_null | n | NOT NULL "updatedAt" | +| tmp_mcp_registry_server_version_not_null | n | NOT NULL version | +| PK_12fd89a1fb8489513b0a91f5d31 | PRIMARY KEY | PRIMARY KEY (slug) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_12fd89a1fb8489513b0a91f5d31 | CREATE UNIQUE INDEX "PK_12fd89a1fb8489513b0a91f5d31" ON public.mcp_registry_server USING btree (slug) | + +## Relations + +```mermaid +erDiagram + +"public.instance_ai_mcp_registry_connections" }o--|| "public.mcp_registry_server" : "FOREIGN KEY (#quot;serverSlug#quot;) REFERENCES mcp_registry_server(slug) ON DELETE CASCADE" + +"public.mcp_registry_server" { + varchar_255_ slug + varchar_50_ status + varchar_50_ version + timestamp_3__without_time_zone registryUpdatedAt + json data + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_mcp_registry_connections" { + uuid id + varchar_36_ credentialId FK + varchar_255_ serverSlug FK + json toolFilter + uuid userId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.oauth_access_tokens.md b/docs/generated/postgres-schema/public.oauth_access_tokens.md new file mode 100644 index 00000000000..25ec88420f4 --- /dev/null +++ b/docs/generated/postgres-schema/public.oauth_access_tokens.md @@ -0,0 +1,73 @@ +# public.oauth_access_tokens + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| token | varchar | | false | | | | +| clientId | varchar | | false | | [public.oauth_clients](public.oauth_clients.md) | | +| userId | uuid | | false | | [public.user](public.user.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| oauth_access_tokens_clientId_not_null | n | NOT NULL "clientId" | +| oauth_access_tokens_token_not_null | n | NOT NULL token | +| oauth_access_tokens_userId_not_null | n | NOT NULL "userId" | +| FK_7234a36d8e49a1fa85095328845 | FOREIGN KEY | FOREIGN KEY ("userId") REFERENCES "user"(id) ON DELETE CASCADE | +| FK_78b26968132b7e5e45b75876481 | FOREIGN KEY | FOREIGN KEY ("clientId") REFERENCES oauth_clients(id) ON DELETE CASCADE | +| PK_dcd71f96a5d5f4bf79e67d322bf | PRIMARY KEY | PRIMARY KEY (token) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_dcd71f96a5d5f4bf79e67d322bf | CREATE UNIQUE INDEX "PK_dcd71f96a5d5f4bf79e67d322bf" ON public.oauth_access_tokens USING btree (token) | + +## Relations + +```mermaid +erDiagram + +"public.oauth_access_tokens" }o--|| "public.oauth_clients" : "FOREIGN KEY (#quot;clientId#quot;) REFERENCES oauth_clients(id) ON DELETE CASCADE" +"public.oauth_access_tokens" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" + +"public.oauth_access_tokens" { + varchar token + varchar clientId FK + uuid userId FK +} +"public.oauth_clients" { + varchar id + varchar_255_ name + json redirectUris + json grantTypes + varchar_255_ clientSecret + bigint clientSecretExpiresAt + varchar_255_ tokenEndpointAuthMethod + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.oauth_authorization_codes.md b/docs/generated/postgres-schema/public.oauth_authorization_codes.md new file mode 100644 index 00000000000..a05232abf72 --- /dev/null +++ b/docs/generated/postgres-schema/public.oauth_authorization_codes.md @@ -0,0 +1,101 @@ +# public.oauth_authorization_codes + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| code | varchar(255) | | false | | | | +| clientId | varchar | | false | | [public.oauth_clients](public.oauth_clients.md) | | +| userId | uuid | | false | | [public.user](public.user.md) | | +| redirectUri | varchar | | false | | | | +| codeChallenge | varchar | | false | | | | +| codeChallengeMethod | varchar(255) | | false | | | | +| expiresAt | bigint | | false | | | Unix timestamp in milliseconds | +| state | varchar | | true | | | | +| used | boolean | false | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| resource | varchar | | true | | | RFC 8707 resource indicator URI (e.g. https://n8n.example.com/mcp-server/http). NULL = legacy flow predating resource indicator support; defaults to the instance canonical MCP resource URL. | +| scope | json | '["tool:listWorkflows","tool:getWorkflowDetails"]'::json | false | | | OAuth scopes granted for this authorization code | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| oauth_authorization_codes_clientId_not_null | n | NOT NULL "clientId" | +| oauth_authorization_codes_codeChallengeMethod_not_null | n | NOT NULL "codeChallengeMethod" | +| oauth_authorization_codes_codeChallenge_not_null | n | NOT NULL "codeChallenge" | +| oauth_authorization_codes_code_not_null | n | NOT NULL code | +| oauth_authorization_codes_createdAt_not_null | n | NOT NULL "createdAt" | +| oauth_authorization_codes_expiresAt_not_null | n | NOT NULL "expiresAt" | +| oauth_authorization_codes_redirectUri_not_null | n | NOT NULL "redirectUri" | +| oauth_authorization_codes_scope_not_null | n | NOT NULL scope | +| oauth_authorization_codes_updatedAt_not_null | n | NOT NULL "updatedAt" | +| oauth_authorization_codes_used_not_null | n | NOT NULL used | +| oauth_authorization_codes_userId_not_null | n | NOT NULL "userId" | +| FK_aa8d3560484944c19bdf79ffa16 | FOREIGN KEY | FOREIGN KEY ("userId") REFERENCES "user"(id) ON DELETE CASCADE | +| FK_64d965bd072ea24fb6da55468cd | FOREIGN KEY | FOREIGN KEY ("clientId") REFERENCES oauth_clients(id) ON DELETE CASCADE | +| PK_fb91ab932cfbd694061501cc20f | PRIMARY KEY | PRIMARY KEY (code) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_fb91ab932cfbd694061501cc20f | CREATE UNIQUE INDEX "PK_fb91ab932cfbd694061501cc20f" ON public.oauth_authorization_codes USING btree (code) | + +## Relations + +```mermaid +erDiagram + +"public.oauth_authorization_codes" }o--|| "public.oauth_clients" : "FOREIGN KEY (#quot;clientId#quot;) REFERENCES oauth_clients(id) ON DELETE CASCADE" +"public.oauth_authorization_codes" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" + +"public.oauth_authorization_codes" { + varchar_255_ code + varchar clientId FK + uuid userId FK + varchar redirectUri + varchar codeChallenge + varchar_255_ codeChallengeMethod + bigint expiresAt + varchar state + boolean used + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar resource + json scope +} +"public.oauth_clients" { + varchar id + varchar_255_ name + json redirectUris + json grantTypes + varchar_255_ clientSecret + bigint clientSecretExpiresAt + varchar_255_ tokenEndpointAuthMethod + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.oauth_clients.md b/docs/generated/postgres-schema/public.oauth_clients.md new file mode 100644 index 00000000000..5c979acf970 --- /dev/null +++ b/docs/generated/postgres-schema/public.oauth_clients.md @@ -0,0 +1,96 @@ +# public.oauth_clients + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar | | false | [public.oauth_authorization_codes](public.oauth_authorization_codes.md) [public.oauth_access_tokens](public.oauth_access_tokens.md) [public.oauth_refresh_tokens](public.oauth_refresh_tokens.md) [public.oauth_user_consents](public.oauth_user_consents.md) | | | +| name | varchar(255) | | false | | | | +| redirectUris | json | | false | | | | +| grantTypes | json | | false | | | | +| clientSecret | varchar(255) | | true | | | | +| clientSecretExpiresAt | bigint | | true | | | | +| tokenEndpointAuthMethod | varchar(255) | 'none'::character varying | false | | | Possible values: none, client_secret_basic or client_secret_post | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| oauth_clients_createdAt_not_null | n | NOT NULL "createdAt" | +| oauth_clients_grantTypes_not_null | n | NOT NULL "grantTypes" | +| oauth_clients_id_not_null | n | NOT NULL id | +| oauth_clients_name_not_null | n | NOT NULL name | +| oauth_clients_redirectUris_not_null | n | NOT NULL "redirectUris" | +| oauth_clients_tokenEndpointAuthMethod_not_null | n | NOT NULL "tokenEndpointAuthMethod" | +| oauth_clients_updatedAt_not_null | n | NOT NULL "updatedAt" | +| PK_c4759172d3431bae6f04e678e0d | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_c4759172d3431bae6f04e678e0d | CREATE UNIQUE INDEX "PK_c4759172d3431bae6f04e678e0d" ON public.oauth_clients USING btree (id) | + +## Relations + +```mermaid +erDiagram + +"public.oauth_authorization_codes" }o--|| "public.oauth_clients" : "FOREIGN KEY (#quot;clientId#quot;) REFERENCES oauth_clients(id) ON DELETE CASCADE" +"public.oauth_access_tokens" }o--|| "public.oauth_clients" : "FOREIGN KEY (#quot;clientId#quot;) REFERENCES oauth_clients(id) ON DELETE CASCADE" +"public.oauth_refresh_tokens" }o--|| "public.oauth_clients" : "FOREIGN KEY (#quot;clientId#quot;) REFERENCES oauth_clients(id) ON DELETE CASCADE" +"public.oauth_user_consents" }o--|| "public.oauth_clients" : "FOREIGN KEY (#quot;clientId#quot;) REFERENCES oauth_clients(id) ON DELETE CASCADE" + +"public.oauth_clients" { + varchar id + varchar_255_ name + json redirectUris + json grantTypes + varchar_255_ clientSecret + bigint clientSecretExpiresAt + varchar_255_ tokenEndpointAuthMethod + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.oauth_authorization_codes" { + varchar_255_ code + varchar clientId FK + uuid userId FK + varchar redirectUri + varchar codeChallenge + varchar_255_ codeChallengeMethod + bigint expiresAt + varchar state + boolean used + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar resource + json scope +} +"public.oauth_access_tokens" { + varchar token + varchar clientId FK + uuid userId FK +} +"public.oauth_refresh_tokens" { + varchar_255_ token + varchar clientId FK + uuid userId FK + bigint expiresAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json scope +} +"public.oauth_user_consents" { + integer id + uuid userId FK + varchar clientId FK + bigint grantedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.oauth_refresh_tokens.md b/docs/generated/postgres-schema/public.oauth_refresh_tokens.md new file mode 100644 index 00000000000..d197b96b675 --- /dev/null +++ b/docs/generated/postgres-schema/public.oauth_refresh_tokens.md @@ -0,0 +1,85 @@ +# public.oauth_refresh_tokens + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| token | varchar(255) | | false | | | | +| clientId | varchar | | false | | [public.oauth_clients](public.oauth_clients.md) | | +| userId | uuid | | false | | [public.user](public.user.md) | | +| expiresAt | bigint | | false | | | Unix timestamp in milliseconds | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| scope | json | '["tool:listWorkflows","tool:getWorkflowDetails"]'::json | false | | | OAuth scopes granted for this refresh token | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| oauth_refresh_tokens_clientId_not_null | n | NOT NULL "clientId" | +| oauth_refresh_tokens_createdAt_not_null | n | NOT NULL "createdAt" | +| oauth_refresh_tokens_expiresAt_not_null | n | NOT NULL "expiresAt" | +| oauth_refresh_tokens_scope_not_null | n | NOT NULL scope | +| oauth_refresh_tokens_token_not_null | n | NOT NULL token | +| oauth_refresh_tokens_updatedAt_not_null | n | NOT NULL "updatedAt" | +| oauth_refresh_tokens_userId_not_null | n | NOT NULL "userId" | +| FK_a699f3ed9fd0c1b19bc2608ac53 | FOREIGN KEY | FOREIGN KEY ("userId") REFERENCES "user"(id) ON DELETE CASCADE | +| FK_b388696ce4d8be7ffbe8d3e4b69 | FOREIGN KEY | FOREIGN KEY ("clientId") REFERENCES oauth_clients(id) ON DELETE CASCADE | +| PK_74abaed0b30711b6532598b0392 | PRIMARY KEY | PRIMARY KEY (token) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_74abaed0b30711b6532598b0392 | CREATE UNIQUE INDEX "PK_74abaed0b30711b6532598b0392" ON public.oauth_refresh_tokens USING btree (token) | + +## Relations + +```mermaid +erDiagram + +"public.oauth_refresh_tokens" }o--|| "public.oauth_clients" : "FOREIGN KEY (#quot;clientId#quot;) REFERENCES oauth_clients(id) ON DELETE CASCADE" +"public.oauth_refresh_tokens" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" + +"public.oauth_refresh_tokens" { + varchar_255_ token + varchar clientId FK + uuid userId FK + bigint expiresAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json scope +} +"public.oauth_clients" { + varchar id + varchar_255_ name + json redirectUris + json grantTypes + varchar_255_ clientSecret + bigint clientSecretExpiresAt + varchar_255_ tokenEndpointAuthMethod + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.oauth_user_consents.md b/docs/generated/postgres-schema/public.oauth_user_consents.md new file mode 100644 index 00000000000..24ca640c955 --- /dev/null +++ b/docs/generated/postgres-schema/public.oauth_user_consents.md @@ -0,0 +1,78 @@ +# public.oauth_user_consents + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | integer | | false | | | | +| userId | uuid | | false | | [public.user](public.user.md) | | +| clientId | varchar | | false | | [public.oauth_clients](public.oauth_clients.md) | | +| grantedAt | bigint | | false | | | Unix timestamp in milliseconds | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| oauth_user_consents_clientId_not_null | n | NOT NULL "clientId" | +| oauth_user_consents_grantedAt_not_null | n | NOT NULL "grantedAt" | +| oauth_user_consents_id_not_null | n | NOT NULL id | +| oauth_user_consents_userId_not_null | n | NOT NULL "userId" | +| FK_21e6c3c2d78a097478fae6aaefa | FOREIGN KEY | FOREIGN KEY ("userId") REFERENCES "user"(id) ON DELETE CASCADE | +| FK_a651acea2f6c97f8c4514935486 | FOREIGN KEY | FOREIGN KEY ("clientId") REFERENCES oauth_clients(id) ON DELETE CASCADE | +| PK_85b9ada746802c8993103470f05 | PRIMARY KEY | PRIMARY KEY (id) | +| UQ_083721d99ce8db4033e2958ebb4 | UNIQUE | UNIQUE ("userId", "clientId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_85b9ada746802c8993103470f05 | CREATE UNIQUE INDEX "PK_85b9ada746802c8993103470f05" ON public.oauth_user_consents USING btree (id) | +| UQ_083721d99ce8db4033e2958ebb4 | CREATE UNIQUE INDEX "UQ_083721d99ce8db4033e2958ebb4" ON public.oauth_user_consents USING btree ("userId", "clientId") | + +## Relations + +```mermaid +erDiagram + +"public.oauth_user_consents" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.oauth_user_consents" }o--|| "public.oauth_clients" : "FOREIGN KEY (#quot;clientId#quot;) REFERENCES oauth_clients(id) ON DELETE CASCADE" + +"public.oauth_user_consents" { + integer id + uuid userId FK + varchar clientId FK + bigint grantedAt +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"public.oauth_clients" { + varchar id + varchar_255_ name + json redirectUris + json grantTypes + varchar_255_ clientSecret + bigint clientSecretExpiresAt + varchar_255_ tokenEndpointAuthMethod + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.processed_data.md b/docs/generated/postgres-schema/public.processed_data.md new file mode 100644 index 00000000000..879c413397f --- /dev/null +++ b/docs/generated/postgres-schema/public.processed_data.md @@ -0,0 +1,71 @@ +# public.processed_data + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| workflowId | varchar(36) | | false | | [public.workflow_entity](public.workflow_entity.md) | | +| context | varchar(255) | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| value | text | | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| processed_data_context_not_null | n | NOT NULL context | +| processed_data_createdAt_not_null | n | NOT NULL "createdAt" | +| processed_data_updatedAt_not_null | n | NOT NULL "updatedAt" | +| processed_data_value_not_null | n | NOT NULL value | +| processed_data_workflowId_not_null | n | NOT NULL "workflowId" | +| FK_06a69a7032c97a763c2c7599464 | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE CASCADE | +| PK_ca04b9d8dc72de268fe07a65773 | PRIMARY KEY | PRIMARY KEY ("workflowId", context) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_ca04b9d8dc72de268fe07a65773 | CREATE UNIQUE INDEX "PK_ca04b9d8dc72de268fe07a65773" ON public.processed_data USING btree ("workflowId", context) | + +## Relations + +```mermaid +erDiagram + +"public.processed_data" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" + +"public.processed_data" { + varchar_36_ workflowId FK + varchar_255_ context + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + text value +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.project.md b/docs/generated/postgres-schema/public.project.md new file mode 100644 index 00000000000..217482e044e --- /dev/null +++ b/docs/generated/postgres-schema/public.project.md @@ -0,0 +1,190 @@ +# public.project + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [public.variables](public.variables.md) [public.project_relation](public.project_relation.md) [public.shared_credentials](public.shared_credentials.md) [public.shared_workflow](public.shared_workflow.md) [public.folder](public.folder.md) [public.insights_metadata](public.insights_metadata.md) [public.data_table](public.data_table.md) [public.project_secrets_provider_access](public.project_secrets_provider_access.md) [public.role_mapping_rule_project](public.role_mapping_rule_project.md) [public.instance_ai_threads](public.instance_ai_threads.md) [public.agents](public.agents.md) [public.agent_execution_threads](public.agent_execution_threads.md) | | | +| name | varchar(255) | | false | | | | +| type | varchar(36) | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| icon | json | | true | | | | +| description | varchar(512) | | true | | | | +| creatorId | uuid | | true | | [public.user](public.user.md) | ID of the user who created the project | +| customTelemetryTags | json | '[]'::json | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| project_createdAt_not_null | n | NOT NULL "createdAt" | +| project_customTelemetryTags_not_null | n | NOT NULL "customTelemetryTags" | +| project_id_not_null | n | NOT NULL id | +| project_name_not_null | n | NOT NULL name | +| project_type_not_null | n | NOT NULL type | +| project_updatedAt_not_null | n | NOT NULL "updatedAt" | +| projects_creatorId_foreign | FOREIGN KEY | FOREIGN KEY ("creatorId") REFERENCES "user"(id) ON DELETE SET NULL | +| PK_4d68b1358bb5b766d3e78f32f57 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_4d68b1358bb5b766d3e78f32f57 | CREATE UNIQUE INDEX "PK_4d68b1358bb5b766d3e78f32f57" ON public.project USING btree (id) | + +## Relations + +```mermaid +erDiagram + +"public.variables" }o--o| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.project_relation" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.shared_credentials" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.shared_workflow" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.folder" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.insights_metadata" }o--o| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE SET NULL" +"public.data_table" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.project_secrets_provider_access" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.role_mapping_rule_project" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.instance_ai_threads" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.agents" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.agent_execution_threads" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.project" }o--o| "public.user" : "FOREIGN KEY (#quot;creatorId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE SET NULL" + +"public.project" { + varchar_36_ id + varchar_255_ name + varchar_36_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + varchar_512_ description + uuid creatorId FK + json customTelemetryTags +} +"public.variables" { + varchar_50_ key + varchar_50_ type + text value + varchar_36_ id + varchar_36_ projectId FK +} +"public.project_relation" { + varchar_36_ projectId FK + uuid userId FK + varchar role FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.shared_credentials" { + varchar_36_ credentialsId FK + varchar_36_ projectId FK + text role + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.shared_workflow" { + varchar_36_ workflowId FK + varchar_36_ projectId FK + text role + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.folder" { + varchar_36_ id + varchar_128_ name + varchar_36_ parentFolderId FK + varchar_36_ projectId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.insights_metadata" { + integer metaId + varchar_36_ workflowId FK + varchar_36_ projectId FK + varchar_128_ workflowName + varchar_255_ projectName +} +"public.data_table" { + varchar_36_ id + varchar_128_ name + varchar_36_ projectId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.project_secrets_provider_access" { + integer secretsProviderConnectionId FK + varchar_36_ projectId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_128_ role +} +"public.role_mapping_rule_project" { + varchar_16_ roleMappingRuleId FK + varchar_36_ projectId FK +} +"public.instance_ai_threads" { + uuid id + varchar_255_ resourceId + text title + json metadata + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ projectId FK +} +"public.agents" { + varchar_36_ id + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + json integrations + json schema + json tools + json skills + varchar_36_ versionId + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ activeVersionId FK +} +"public.agent_execution_threads" { + varchar_128_ id + varchar_36_ agentId FK + varchar_255_ agentName + varchar_255_ projectId FK + integer sessionNumber + integer totalPromptTokens + integer totalCompletionTokens + double_precision totalCost + integer totalDuration + varchar_255_ title + varchar_8_ emoji + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_32_ taskId + varchar_36_ taskVersionId FK + varchar_128_ parentThreadId + varchar_36_ parentAgentId +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.project_relation.md b/docs/generated/postgres-schema/public.project_relation.md new file mode 100644 index 00000000000..e5fa7883802 --- /dev/null +++ b/docs/generated/postgres-schema/public.project_relation.md @@ -0,0 +1,94 @@ +# public.project_relation + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| projectId | varchar(36) | | false | | [public.project](public.project.md) | | +| userId | uuid | | false | | [public.user](public.user.md) | | +| role | varchar | | false | | [public.role](public.role.md) | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| project_relation_createdAt_not_null | n | NOT NULL "createdAt" | +| project_relation_projectId_not_null | n | NOT NULL "projectId" | +| project_relation_role_not_null | n | NOT NULL role | +| project_relation_updatedAt_not_null | n | NOT NULL "updatedAt" | +| project_relation_userId_not_null | n | NOT NULL "userId" | +| FK_5f0643f6717905a05164090dde7 | FOREIGN KEY | FOREIGN KEY ("userId") REFERENCES "user"(id) ON DELETE CASCADE | +| FK_61448d56d61802b5dfde5cdb002 | FOREIGN KEY | FOREIGN KEY ("projectId") REFERENCES project(id) ON DELETE CASCADE | +| PK_1caaa312a5d7184a003be0f0cb6 | PRIMARY KEY | PRIMARY KEY ("projectId", "userId") | +| FK_c6b99592dc96b0d836d7a21db91 | FOREIGN KEY | FOREIGN KEY (role) REFERENCES role(slug) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_1caaa312a5d7184a003be0f0cb6 | CREATE UNIQUE INDEX "PK_1caaa312a5d7184a003be0f0cb6" ON public.project_relation USING btree ("projectId", "userId") | +| IDX_61448d56d61802b5dfde5cdb00 | CREATE INDEX "IDX_61448d56d61802b5dfde5cdb00" ON public.project_relation USING btree ("projectId") | +| IDX_5f0643f6717905a05164090dde | CREATE INDEX "IDX_5f0643f6717905a05164090dde" ON public.project_relation USING btree ("userId") | +| project_relation_role_idx | CREATE INDEX project_relation_role_idx ON public.project_relation USING btree (role) | +| project_relation_role_project_idx | CREATE INDEX project_relation_role_project_idx ON public.project_relation USING btree ("projectId", role) | + +## Relations + +```mermaid +erDiagram + +"public.project_relation" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" +"public.project_relation" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.project_relation" }o--|| "public.role" : "FOREIGN KEY (role) REFERENCES role(slug)" + +"public.project_relation" { + varchar_36_ projectId FK + uuid userId FK + varchar role FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.project" { + varchar_36_ id + varchar_255_ name + varchar_36_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + varchar_512_ description + uuid creatorId FK + json customTelemetryTags +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"public.role" { + varchar_128_ slug + text displayName + text description + text roleType + boolean systemRole + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.project_secrets_provider_access.md b/docs/generated/postgres-schema/public.project_secrets_provider_access.md new file mode 100644 index 00000000000..17c38c1f572 --- /dev/null +++ b/docs/generated/postgres-schema/public.project_secrets_provider_access.md @@ -0,0 +1,72 @@ +# public.project_secrets_provider_access + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| secretsProviderConnectionId | integer | | false | | [public.secrets_provider_connection](public.secrets_provider_connection.md) | | +| projectId | varchar(36) | | false | | [public.project](public.project.md) | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| role | varchar(128) | 'secretsProviderConnection:user'::character varying | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| CHK_project_secrets_provider_access_role | CHECK | CHECK (((role)::text = ANY ((ARRAY['secretsProviderConnection:owner'::character varying, 'secretsProviderConnection:user'::character varying])::text[]))) | +| project_secrets_provider_ac_secretsProviderConnectionI_not_null | n | NOT NULL "secretsProviderConnectionId" | +| project_secrets_provider_access_createdAt_not_null | n | NOT NULL "createdAt" | +| project_secrets_provider_access_projectId_not_null | n | NOT NULL "projectId" | +| project_secrets_provider_access_role_not_null | n | NOT NULL role | +| project_secrets_provider_access_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_bd264b81209355b543878deedb1 | FOREIGN KEY | FOREIGN KEY ("projectId") REFERENCES project(id) ON DELETE CASCADE | +| FK_18e5c27d2524b1638b292904e48 | FOREIGN KEY | FOREIGN KEY ("secretsProviderConnectionId") REFERENCES secrets_provider_connection(id) ON DELETE CASCADE | +| PK_0402b7fcec5415246656f102f83 | PRIMARY KEY | PRIMARY KEY ("secretsProviderConnectionId", "projectId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_0402b7fcec5415246656f102f83 | CREATE UNIQUE INDEX "PK_0402b7fcec5415246656f102f83" ON public.project_secrets_provider_access USING btree ("secretsProviderConnectionId", "projectId") | + +## Relations + +```mermaid +erDiagram + +"public.project_secrets_provider_access" }o--|| "public.secrets_provider_connection" : "FOREIGN KEY (#quot;secretsProviderConnectionId#quot;) REFERENCES secrets_provider_connection(id) ON DELETE CASCADE" +"public.project_secrets_provider_access" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" + +"public.project_secrets_provider_access" { + integer secretsProviderConnectionId FK + varchar_36_ projectId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_128_ role +} +"public.secrets_provider_connection" { + integer id + varchar_128_ providerKey + varchar_36_ type + text encryptedSettings + boolean isEnabled + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.project" { + varchar_36_ id + varchar_255_ name + varchar_36_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + varchar_512_ description + uuid creatorId FK + json customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.role.md b/docs/generated/postgres-schema/public.role.md new file mode 100644 index 00000000000..ab1fcf84168 --- /dev/null +++ b/docs/generated/postgres-schema/public.role.md @@ -0,0 +1,92 @@ +# public.role + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| slug | varchar(128) | | false | [public.user](public.user.md) [public.project_relation](public.project_relation.md) [public.role_scope](public.role_scope.md) [public.role_mapping_rule](public.role_mapping_rule.md) | | Unique identifier of the role for example: "global:owner" | +| displayName | text | | true | | | Name used to display in the UI | +| description | text | | true | | | Text describing the scope in more detail of users | +| roleType | text | | true | | | Type of the role, e.g., global, project, or workflow | +| systemRole | boolean | false | false | | | Indicates if the role is managed by the system and cannot be edited | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| role_createdAt_not_null | n | NOT NULL "createdAt" | +| role_slug_not_null | n | NOT NULL slug | +| role_systemRole_not_null | n | NOT NULL "systemRole" | +| role_updatedAt_not_null | n | NOT NULL "updatedAt" | +| PK_35c9b140caaf6da09cfabb0d675 | PRIMARY KEY | PRIMARY KEY (slug) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_35c9b140caaf6da09cfabb0d675 | CREATE UNIQUE INDEX "PK_35c9b140caaf6da09cfabb0d675" ON public.role USING btree (slug) | +| IDX_UniqueRoleDisplayName | CREATE UNIQUE INDEX "IDX_UniqueRoleDisplayName" ON public.role USING btree ("displayName") | + +## Relations + +```mermaid +erDiagram + +"public.user" }o--|| "public.role" : "FOREIGN KEY (#quot;roleSlug#quot;) REFERENCES role(slug)" +"public.project_relation" }o--|| "public.role" : "FOREIGN KEY (role) REFERENCES role(slug)" +"public.role_scope" }o--|| "public.role" : "FOREIGN KEY (#quot;roleSlug#quot;) REFERENCES role(slug) ON UPDATE CASCADE ON DELETE CASCADE" +"public.role_mapping_rule" }o--|| "public.role" : "FOREIGN KEY (role) REFERENCES role(slug) ON UPDATE CASCADE ON DELETE CASCADE" + +"public.role" { + varchar_128_ slug + text displayName + text description + text roleType + boolean systemRole + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"public.project_relation" { + varchar_36_ projectId FK + uuid userId FK + varchar role FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.role_scope" { + varchar_128_ roleSlug FK + varchar_128_ scopeSlug FK +} +"public.role_mapping_rule" { + varchar_16_ id + text expression + varchar_128_ role FK + varchar_64_ type + integer order + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.role_mapping_rule.md b/docs/generated/postgres-schema/public.role_mapping_rule.md new file mode 100644 index 00000000000..deba0a8e86b --- /dev/null +++ b/docs/generated/postgres-schema/public.role_mapping_rule.md @@ -0,0 +1,72 @@ +# public.role_mapping_rule + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(16) | | false | [public.role_mapping_rule_project](public.role_mapping_rule_project.md) | | | +| expression | text | | false | | | | +| role | varchar(128) | | false | | [public.role](public.role.md) | | +| type | varchar(64) | | false | | | Expected values: 'instance' (maps to a global role) or 'project' (maps to a project role; projects linked via role_mapping_rule_project). | +| order | integer | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| role_mapping_rule_createdAt_not_null | n | NOT NULL "createdAt" | +| role_mapping_rule_expression_not_null | n | NOT NULL expression | +| role_mapping_rule_id_not_null | n | NOT NULL id | +| role_mapping_rule_order_not_null | n | NOT NULL "order" | +| role_mapping_rule_role_not_null | n | NOT NULL role | +| role_mapping_rule_type_not_null | n | NOT NULL type | +| role_mapping_rule_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_bb66e404c35996b0d6946177501 | FOREIGN KEY | FOREIGN KEY (role) REFERENCES role(slug) ON UPDATE CASCADE ON DELETE CASCADE | +| PK_d772c8ec1a89b52d31c882bc560 | PRIMARY KEY | PRIMARY KEY (id) | +| UQ_b33ac896ad3099fc8de36fdc1c4 | UNIQUE | UNIQUE (type, "order") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_d772c8ec1a89b52d31c882bc560 | CREATE UNIQUE INDEX "PK_d772c8ec1a89b52d31c882bc560" ON public.role_mapping_rule USING btree (id) | +| UQ_b33ac896ad3099fc8de36fdc1c4 | CREATE UNIQUE INDEX "UQ_b33ac896ad3099fc8de36fdc1c4" ON public.role_mapping_rule USING btree (type, "order") | +| IDX_bb66e404c35996b0d694617750 | CREATE INDEX "IDX_bb66e404c35996b0d694617750" ON public.role_mapping_rule USING btree (role) | + +## Relations + +```mermaid +erDiagram + +"public.role_mapping_rule_project" }o--|| "public.role_mapping_rule" : "FOREIGN KEY (#quot;roleMappingRuleId#quot;) REFERENCES role_mapping_rule(id) ON DELETE CASCADE" +"public.role_mapping_rule" }o--|| "public.role" : "FOREIGN KEY (role) REFERENCES role(slug) ON UPDATE CASCADE ON DELETE CASCADE" + +"public.role_mapping_rule" { + varchar_16_ id + text expression + varchar_128_ role FK + varchar_64_ type + integer order + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.role_mapping_rule_project" { + varchar_16_ roleMappingRuleId FK + varchar_36_ projectId FK +} +"public.role" { + varchar_128_ slug + text displayName + text description + text roleType + boolean systemRole + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.role_mapping_rule_project.md b/docs/generated/postgres-schema/public.role_mapping_rule_project.md new file mode 100644 index 00000000000..f3778f7345a --- /dev/null +++ b/docs/generated/postgres-schema/public.role_mapping_rule_project.md @@ -0,0 +1,63 @@ +# public.role_mapping_rule_project + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| roleMappingRuleId | varchar(16) | | false | | [public.role_mapping_rule](public.role_mapping_rule.md) | | +| projectId | varchar(36) | | false | | [public.project](public.project.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| role_mapping_rule_project_projectId_not_null | n | NOT NULL "projectId" | +| role_mapping_rule_project_roleMappingRuleId_not_null | n | NOT NULL "roleMappingRuleId" | +| FK_35a78869286c65d9330d02b88f5 | FOREIGN KEY | FOREIGN KEY ("projectId") REFERENCES project(id) ON DELETE CASCADE | +| FK_dd7ce4dfa09e95b36a626bd9de3 | FOREIGN KEY | FOREIGN KEY ("roleMappingRuleId") REFERENCES role_mapping_rule(id) ON DELETE CASCADE | +| PK_198c5b5aea509d139274efcaf9a | PRIMARY KEY | PRIMARY KEY ("roleMappingRuleId", "projectId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_198c5b5aea509d139274efcaf9a | CREATE UNIQUE INDEX "PK_198c5b5aea509d139274efcaf9a" ON public.role_mapping_rule_project USING btree ("roleMappingRuleId", "projectId") | +| IDX_35a78869286c65d9330d02b88f | CREATE INDEX "IDX_35a78869286c65d9330d02b88f" ON public.role_mapping_rule_project USING btree ("projectId") | + +## Relations + +```mermaid +erDiagram + +"public.role_mapping_rule_project" }o--|| "public.role_mapping_rule" : "FOREIGN KEY (#quot;roleMappingRuleId#quot;) REFERENCES role_mapping_rule(id) ON DELETE CASCADE" +"public.role_mapping_rule_project" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" + +"public.role_mapping_rule_project" { + varchar_16_ roleMappingRuleId FK + varchar_36_ projectId FK +} +"public.role_mapping_rule" { + varchar_16_ id + text expression + varchar_128_ role FK + varchar_64_ type + integer order + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.project" { + varchar_36_ id + varchar_255_ name + varchar_36_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + varchar_512_ description + uuid creatorId FK + json customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.role_scope.md b/docs/generated/postgres-schema/public.role_scope.md new file mode 100644 index 00000000000..58ad3d18253 --- /dev/null +++ b/docs/generated/postgres-schema/public.role_scope.md @@ -0,0 +1,57 @@ +# public.role_scope + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| roleSlug | varchar(128) | | false | | [public.role](public.role.md) | | +| scopeSlug | varchar(128) | | false | | [public.scope](public.scope.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| role_scope_roleSlug_not_null | n | NOT NULL "roleSlug" | +| role_scope_scopeSlug_not_null | n | NOT NULL "scopeSlug" | +| FK_scope | FOREIGN KEY | FOREIGN KEY ("scopeSlug") REFERENCES scope(slug) ON UPDATE CASCADE ON DELETE CASCADE | +| FK_role | FOREIGN KEY | FOREIGN KEY ("roleSlug") REFERENCES role(slug) ON UPDATE CASCADE ON DELETE CASCADE | +| PK_role_scope | PRIMARY KEY | PRIMARY KEY ("roleSlug", "scopeSlug") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_role_scope | CREATE UNIQUE INDEX "PK_role_scope" ON public.role_scope USING btree ("roleSlug", "scopeSlug") | +| IDX_role_scope_scopeSlug | CREATE INDEX "IDX_role_scope_scopeSlug" ON public.role_scope USING btree ("scopeSlug") | + +## Relations + +```mermaid +erDiagram + +"public.role_scope" }o--|| "public.role" : "FOREIGN KEY (#quot;roleSlug#quot;) REFERENCES role(slug) ON UPDATE CASCADE ON DELETE CASCADE" +"public.role_scope" }o--|| "public.scope" : "FOREIGN KEY (#quot;scopeSlug#quot;) REFERENCES scope(slug) ON UPDATE CASCADE ON DELETE CASCADE" + +"public.role_scope" { + varchar_128_ roleSlug FK + varchar_128_ scopeSlug FK +} +"public.role" { + varchar_128_ slug + text displayName + text description + text roleType + boolean systemRole + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.scope" { + varchar_128_ slug + text displayName + text description +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.scope.md b/docs/generated/postgres-schema/public.scope.md new file mode 100644 index 00000000000..1b5e1ab3c1a --- /dev/null +++ b/docs/generated/postgres-schema/public.scope.md @@ -0,0 +1,44 @@ +# public.scope + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| slug | varchar(128) | | false | [public.role_scope](public.role_scope.md) | | Unique identifier of the scope for example: "project:create" | +| displayName | text | | true | | | Name used to display in the UI | +| description | text | | true | | | Text describing the scope in more detail of users | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| scope_slug_not_null | n | NOT NULL slug | +| PK_bfc45df0481abd7f355d6187da1 | PRIMARY KEY | PRIMARY KEY (slug) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_bfc45df0481abd7f355d6187da1 | CREATE UNIQUE INDEX "PK_bfc45df0481abd7f355d6187da1" ON public.scope USING btree (slug) | + +## Relations + +```mermaid +erDiagram + +"public.role_scope" }o--|| "public.scope" : "FOREIGN KEY (#quot;scopeSlug#quot;) REFERENCES scope(slug) ON UPDATE CASCADE ON DELETE CASCADE" + +"public.scope" { + varchar_128_ slug + text displayName + text description +} +"public.role_scope" { + varchar_128_ roleSlug FK + varchar_128_ scopeSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.secrets_provider_connection.md b/docs/generated/postgres-schema/public.secrets_provider_connection.md new file mode 100644 index 00000000000..56847b99555 --- /dev/null +++ b/docs/generated/postgres-schema/public.secrets_provider_connection.md @@ -0,0 +1,62 @@ +# public.secrets_provider_connection + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | integer | | false | [public.project_secrets_provider_access](public.project_secrets_provider_access.md) | | | +| providerKey | varchar(128) | | false | | | | +| type | varchar(36) | | false | | | Type of secrets provider. Possible values: awsSecretsManager, gcpSecretsManager, vault, azureKeyVault, infisical | +| encryptedSettings | text | | false | | | | +| isEnabled | boolean | false | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| secrets_provider_connection_createdAt_not_null | n | NOT NULL "createdAt" | +| secrets_provider_connection_encryptedSettings_not_null | n | NOT NULL "encryptedSettings" | +| secrets_provider_connection_id_not_null | n | NOT NULL id | +| secrets_provider_connection_isEnabled_not_null | n | NOT NULL "isEnabled" | +| secrets_provider_connection_providerKey_not_null | n | NOT NULL "providerKey" | +| secrets_provider_connection_type_not_null | n | NOT NULL type | +| secrets_provider_connection_updatedAt_not_null | n | NOT NULL "updatedAt" | +| PK_4350ae85e76f9ba7df1370acb5d | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_4350ae85e76f9ba7df1370acb5d | CREATE UNIQUE INDEX "PK_4350ae85e76f9ba7df1370acb5d" ON public.secrets_provider_connection USING btree (id) | +| IDX_secrets_provider_connection_providerKey | CREATE UNIQUE INDEX "IDX_secrets_provider_connection_providerKey" ON public.secrets_provider_connection USING btree ("providerKey") | + +## Relations + +```mermaid +erDiagram + +"public.project_secrets_provider_access" }o--|| "public.secrets_provider_connection" : "FOREIGN KEY (#quot;secretsProviderConnectionId#quot;) REFERENCES secrets_provider_connection(id) ON DELETE CASCADE" + +"public.secrets_provider_connection" { + integer id + varchar_128_ providerKey + varchar_36_ type + text encryptedSettings + boolean isEnabled + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.project_secrets_provider_access" { + integer secretsProviderConnectionId FK + varchar_36_ projectId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_128_ role +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.settings.md b/docs/generated/postgres-schema/public.settings.md new file mode 100644 index 00000000000..694b27811e1 --- /dev/null +++ b/docs/generated/postgres-schema/public.settings.md @@ -0,0 +1,41 @@ +# public.settings + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| key | varchar(255) | | false | | | | +| value | text | | false | | | | +| loadOnStartup | boolean | false | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| settings_key_not_null | n | NOT NULL key | +| settings_loadOnStartup_not_null | n | NOT NULL "loadOnStartup" | +| settings_value_not_null | n | NOT NULL value | +| PK_dc0fe14e6d9943f268e7b119f69ab8bd | PRIMARY KEY | PRIMARY KEY (key) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_dc0fe14e6d9943f268e7b119f69ab8bd | CREATE UNIQUE INDEX "PK_dc0fe14e6d9943f268e7b119f69ab8bd" ON public.settings USING btree (key) | + +## Relations + +```mermaid +erDiagram + + +"public.settings" { + varchar_255_ key + text value + boolean loadOnStartup +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.shared_credentials.md b/docs/generated/postgres-schema/public.shared_credentials.md new file mode 100644 index 00000000000..7a58dfbd6fd --- /dev/null +++ b/docs/generated/postgres-schema/public.shared_credentials.md @@ -0,0 +1,75 @@ +# public.shared_credentials + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| credentialsId | varchar(36) | | false | | [public.credentials_entity](public.credentials_entity.md) | | +| projectId | varchar(36) | | false | | [public.project](public.project.md) | | +| role | text | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| shared_credentials_2_createdAt_not_null | n | NOT NULL "createdAt" | +| shared_credentials_2_credentialsId_not_null | n | NOT NULL "credentialsId" | +| shared_credentials_2_projectId_not_null | n | NOT NULL "projectId" | +| shared_credentials_2_role_not_null | n | NOT NULL role | +| shared_credentials_2_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_416f66fc846c7c442970c094ccf | FOREIGN KEY | FOREIGN KEY ("credentialsId") REFERENCES credentials_entity(id) ON DELETE CASCADE | +| FK_812c2852270da1247756e77f5a4 | FOREIGN KEY | FOREIGN KEY ("projectId") REFERENCES project(id) ON DELETE CASCADE | +| PK_8ef3a59796a228913f251779cff | PRIMARY KEY | PRIMARY KEY ("credentialsId", "projectId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_8ef3a59796a228913f251779cff | CREATE UNIQUE INDEX "PK_8ef3a59796a228913f251779cff" ON public.shared_credentials USING btree ("credentialsId", "projectId") | + +## Relations + +```mermaid +erDiagram + +"public.shared_credentials" }o--|| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialsId#quot;) REFERENCES credentials_entity(id) ON DELETE CASCADE" +"public.shared_credentials" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" + +"public.shared_credentials" { + varchar_36_ credentialsId FK + varchar_36_ projectId FK + text role + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.credentials_entity" { + varchar_128_ name + text data + varchar_128_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ id + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +"public.project" { + varchar_36_ id + varchar_255_ name + varchar_36_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + varchar_512_ description + uuid creatorId FK + json customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.shared_workflow.md b/docs/generated/postgres-schema/public.shared_workflow.md new file mode 100644 index 00000000000..a6548a75b0b --- /dev/null +++ b/docs/generated/postgres-schema/public.shared_workflow.md @@ -0,0 +1,85 @@ +# public.shared_workflow + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| workflowId | varchar(36) | | false | | [public.workflow_entity](public.workflow_entity.md) | | +| projectId | varchar(36) | | false | | [public.project](public.project.md) | | +| role | text | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| shared_workflow_2_createdAt_not_null | n | NOT NULL "createdAt" | +| shared_workflow_2_projectId_not_null | n | NOT NULL "projectId" | +| shared_workflow_2_role_not_null | n | NOT NULL role | +| shared_workflow_2_updatedAt_not_null | n | NOT NULL "updatedAt" | +| shared_workflow_2_workflowId_not_null | n | NOT NULL "workflowId" | +| FK_daa206a04983d47d0a9c34649ce | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE CASCADE | +| FK_a45ea5f27bcfdc21af9b4188560 | FOREIGN KEY | FOREIGN KEY ("projectId") REFERENCES project(id) ON DELETE CASCADE | +| PK_5ba87620386b847201c9531c58f | PRIMARY KEY | PRIMARY KEY ("workflowId", "projectId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_5ba87620386b847201c9531c58f | CREATE UNIQUE INDEX "PK_5ba87620386b847201c9531c58f" ON public.shared_workflow USING btree ("workflowId", "projectId") | +| IDX_shared_workflow_projectId | CREATE INDEX "IDX_shared_workflow_projectId" ON public.shared_workflow USING btree ("projectId") | + +## Relations + +```mermaid +erDiagram + +"public.shared_workflow" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.shared_workflow" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" + +"public.shared_workflow" { + varchar_36_ workflowId FK + varchar_36_ projectId FK + text role + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +"public.project" { + varchar_36_ id + varchar_255_ name + varchar_36_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + varchar_512_ description + uuid creatorId FK + json customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.tag_entity.md b/docs/generated/postgres-schema/public.tag_entity.md new file mode 100644 index 00000000000..e6814a7b30e --- /dev/null +++ b/docs/generated/postgres-schema/public.tag_entity.md @@ -0,0 +1,56 @@ +# public.tag_entity + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| name | varchar(24) | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| id | varchar(36) | | false | [public.workflows_tags](public.workflows_tags.md) [public.folder_tag](public.folder_tag.md) | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| tag_entity_createdAt_not_null | n | NOT NULL "createdAt" | +| tag_entity_id_not_null1 | n | NOT NULL id | +| tag_entity_name_not_null | n | NOT NULL name | +| tag_entity_updatedAt_not_null | n | NOT NULL "updatedAt" | +| tag_entity_pkey | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| idx_812eb05f7451ca757fb98444ce | CREATE UNIQUE INDEX idx_812eb05f7451ca757fb98444ce ON public.tag_entity USING btree (name) | +| pk_tag_entity_id | CREATE UNIQUE INDEX pk_tag_entity_id ON public.tag_entity USING btree (id) | +| tag_entity_pkey | CREATE UNIQUE INDEX tag_entity_pkey ON public.tag_entity USING btree (id) | + +## Relations + +```mermaid +erDiagram + +"public.workflows_tags" }o--|| "public.tag_entity" : "FOREIGN KEY (#quot;tagId#quot;) REFERENCES tag_entity(id) ON DELETE CASCADE" +"public.folder_tag" }o--|| "public.tag_entity" : "FOREIGN KEY (#quot;tagId#quot;) REFERENCES tag_entity(id) ON DELETE CASCADE" + +"public.tag_entity" { + varchar_24_ name + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ id +} +"public.workflows_tags" { + varchar_36_ workflowId FK + varchar_36_ tagId FK +} +"public.folder_tag" { + varchar_36_ folderId FK + varchar_36_ tagId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.test_case_execution.md b/docs/generated/postgres-schema/public.test_case_execution.md new file mode 100644 index 00000000000..c2b4382fcf1 --- /dev/null +++ b/docs/generated/postgres-schema/public.test_case_execution.md @@ -0,0 +1,105 @@ +# public.test_case_execution + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| testRunId | varchar(36) | | false | | [public.test_run](public.test_run.md) | | +| executionId | integer | | true | | [public.execution_entity](public.execution_entity.md) | | +| status | varchar | | false | | | | +| runAt | timestamp(3) with time zone | | true | | | | +| completedAt | timestamp(3) with time zone | | true | | | | +| errorCode | varchar | | true | | | | +| errorDetails | json | | true | | | | +| metrics | json | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| inputs | json | | true | | | | +| outputs | json | | true | | | | +| runIndex | integer | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| test_case_execution_createdAt_not_null | n | NOT NULL "createdAt" | +| test_case_execution_id_not_null | n | NOT NULL id | +| test_case_execution_status_not_null | n | NOT NULL status | +| test_case_execution_testRunId_not_null | n | NOT NULL "testRunId" | +| test_case_execution_updatedAt_not_null | n | NOT NULL "updatedAt" | +| FK_e48965fac35d0f5b9e7f51d8c44 | FOREIGN KEY | FOREIGN KEY ("executionId") REFERENCES execution_entity(id) ON DELETE SET NULL | +| FK_8e4b4774db42f1e6dda3452b2af | FOREIGN KEY | FOREIGN KEY ("testRunId") REFERENCES test_run(id) ON DELETE CASCADE | +| PK_90c121f77a78a6580e94b794bce | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_90c121f77a78a6580e94b794bce | CREATE UNIQUE INDEX "PK_90c121f77a78a6580e94b794bce" ON public.test_case_execution USING btree (id) | +| IDX_8e4b4774db42f1e6dda3452b2a | CREATE INDEX "IDX_8e4b4774db42f1e6dda3452b2a" ON public.test_case_execution USING btree ("testRunId") | + +## Relations + +```mermaid +erDiagram + +"public.test_case_execution" }o--|| "public.test_run" : "FOREIGN KEY (#quot;testRunId#quot;) REFERENCES test_run(id) ON DELETE CASCADE" +"public.test_case_execution" }o--o| "public.execution_entity" : "FOREIGN KEY (#quot;executionId#quot;) REFERENCES execution_entity(id) ON DELETE SET NULL" + +"public.test_case_execution" { + varchar_36_ id + varchar_36_ testRunId FK + integer executionId FK + varchar status + timestamp_3__with_time_zone runAt + timestamp_3__with_time_zone completedAt + varchar errorCode + json errorDetails + json metrics + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json inputs + json outputs + integer runIndex +} +"public.test_run" { + varchar_36_ id + varchar_36_ workflowId FK + varchar status + varchar errorCode + json errorDetails + timestamp_3__with_time_zone runAt + timestamp_3__with_time_zone completedAt + json metrics + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_255_ runningInstanceId + boolean cancelRequested + varchar_36_ workflowVersionId + varchar_36_ evaluationConfigId FK + jsonb evaluationConfigSnapshot + varchar_36_ collectionId FK +} +"public.execution_entity" { + integer id + boolean finished + varchar mode + varchar retryOf + varchar retrySuccessId + timestamp_3__with_time_zone startedAt + timestamp_3__with_time_zone stoppedAt + timestamp_3__with_time_zone waitTill + varchar status + varchar_36_ workflowId FK + timestamp_3__with_time_zone deletedAt + timestamp_3__with_time_zone createdAt + varchar_2_ storedAt + json tracingContext + varchar_255_ deduplicationKey +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.test_run.md b/docs/generated/postgres-schema/public.test_run.md new file mode 100644 index 00000000000..218a05660dc --- /dev/null +++ b/docs/generated/postgres-schema/public.test_run.md @@ -0,0 +1,143 @@ +# public.test_run + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [public.test_case_execution](public.test_case_execution.md) | | | +| workflowId | varchar(36) | | false | | [public.workflow_entity](public.workflow_entity.md) | | +| status | varchar | | false | | | | +| errorCode | varchar | | true | | | | +| errorDetails | json | | true | | | | +| runAt | timestamp(3) with time zone | | true | | | | +| completedAt | timestamp(3) with time zone | | true | | | | +| metrics | json | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| runningInstanceId | varchar(255) | | true | | | | +| cancelRequested | boolean | false | false | | | | +| workflowVersionId | varchar(36) | | true | | | | +| evaluationConfigId | varchar(36) | | true | | [public.evaluation_config](public.evaluation_config.md) | | +| evaluationConfigSnapshot | jsonb | | true | | | | +| collectionId | varchar(36) | | true | | [public.evaluation_collection](public.evaluation_collection.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| test_run_cancelRequested_not_null | n | NOT NULL "cancelRequested" | +| test_run_createdAt_not_null | n | NOT NULL "createdAt" | +| test_run_id_not_null | n | NOT NULL id | +| test_run_status_not_null | n | NOT NULL status | +| test_run_updatedAt_not_null | n | NOT NULL "updatedAt" | +| test_run_workflowId_not_null | n | NOT NULL "workflowId" | +| FK_d6870d3b6e4c185d33926f423c8 | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE CASCADE | +| PK_011c050f566e9db509a0fadb9b9 | PRIMARY KEY | PRIMARY KEY (id) | +| FK_test_run_evaluation_config_id | FOREIGN KEY | FOREIGN KEY ("evaluationConfigId") REFERENCES evaluation_config(id) ON DELETE SET NULL | +| FK_test_run_collection_id | FOREIGN KEY | FOREIGN KEY ("collectionId") REFERENCES evaluation_collection(id) ON DELETE SET NULL | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_011c050f566e9db509a0fadb9b9 | CREATE UNIQUE INDEX "PK_011c050f566e9db509a0fadb9b9" ON public.test_run USING btree (id) | +| IDX_d6870d3b6e4c185d33926f423c | CREATE INDEX "IDX_d6870d3b6e4c185d33926f423c" ON public.test_run USING btree ("workflowId") | +| IDX_test_run_evaluationConfigId | CREATE INDEX "IDX_test_run_evaluationConfigId" ON public.test_run USING btree ("evaluationConfigId") | +| IDX_test_run_collectionId | CREATE INDEX "IDX_test_run_collectionId" ON public.test_run USING btree ("collectionId") | + +## Relations + +```mermaid +erDiagram + +"public.test_case_execution" }o--|| "public.test_run" : "FOREIGN KEY (#quot;testRunId#quot;) REFERENCES test_run(id) ON DELETE CASCADE" +"public.test_run" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.test_run" }o--o| "public.evaluation_config" : "FOREIGN KEY (#quot;evaluationConfigId#quot;) REFERENCES evaluation_config(id) ON DELETE SET NULL" +"public.test_run" }o--o| "public.evaluation_collection" : "FOREIGN KEY (#quot;collectionId#quot;) REFERENCES evaluation_collection(id) ON DELETE SET NULL" + +"public.test_run" { + varchar_36_ id + varchar_36_ workflowId FK + varchar status + varchar errorCode + json errorDetails + timestamp_3__with_time_zone runAt + timestamp_3__with_time_zone completedAt + json metrics + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_255_ runningInstanceId + boolean cancelRequested + varchar_36_ workflowVersionId + varchar_36_ evaluationConfigId FK + jsonb evaluationConfigSnapshot + varchar_36_ collectionId FK +} +"public.test_case_execution" { + varchar_36_ id + varchar_36_ testRunId FK + integer executionId FK + varchar status + timestamp_3__with_time_zone runAt + timestamp_3__with_time_zone completedAt + varchar errorCode + json errorDetails + json metrics + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json inputs + json outputs + integer runIndex +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +"public.evaluation_config" { + varchar_36_ id + varchar_36_ workflowId FK + varchar_128_ name + varchar_16_ status + varchar_64_ invalidReason + varchar_32_ datasetSource + json datasetRef + varchar_255_ startNodeName + varchar_255_ endNodeName + json metrics + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.evaluation_collection" { + varchar_36_ id + varchar_128_ name + text description + varchar_36_ workflowId FK + varchar_36_ evaluationConfigId FK + uuid createdById FK + json insightsCache + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.token_exchange_jti.md b/docs/generated/postgres-schema/public.token_exchange_jti.md new file mode 100644 index 00000000000..942c1b17bd9 --- /dev/null +++ b/docs/generated/postgres-schema/public.token_exchange_jti.md @@ -0,0 +1,41 @@ +# public.token_exchange_jti + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| jti | varchar(255) | | false | | | | +| expiresAt | timestamp(3) with time zone | | false | | | | +| createdAt | timestamp(3) with time zone | | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| token_exchange_jti_createdAt_not_null | n | NOT NULL "createdAt" | +| token_exchange_jti_expiresAt_not_null | n | NOT NULL "expiresAt" | +| token_exchange_jti_jti_not_null | n | NOT NULL jti | +| PK_d8e8a6f737d530fdd2dd716e89c | PRIMARY KEY | PRIMARY KEY (jti) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_d8e8a6f737d530fdd2dd716e89c | CREATE UNIQUE INDEX "PK_d8e8a6f737d530fdd2dd716e89c" ON public.token_exchange_jti USING btree (jti) | + +## Relations + +```mermaid +erDiagram + + +"public.token_exchange_jti" { + varchar_255_ jti + timestamp_3__with_time_zone expiresAt + timestamp_3__with_time_zone createdAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.trusted_key.md b/docs/generated/postgres-schema/public.trusted_key.md new file mode 100644 index 00000000000..20763d54bd1 --- /dev/null +++ b/docs/generated/postgres-schema/public.trusted_key.md @@ -0,0 +1,56 @@ +# public.trusted_key + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| sourceId | varchar(36) | | false | | [public.trusted_key_source](public.trusted_key_source.md) | | +| kid | varchar(255) | | false | | | | +| data | text | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| trusted_key_createdAt_not_null | n | NOT NULL "createdAt" | +| trusted_key_data_not_null | n | NOT NULL data | +| trusted_key_kid_not_null | n | NOT NULL kid | +| trusted_key_sourceId_not_null | n | NOT NULL "sourceId" | +| FK_8c2938d746943dd8f608d23c891 | FOREIGN KEY | FOREIGN KEY ("sourceId") REFERENCES trusted_key_source(id) ON DELETE CASCADE | +| PK_dc7d93798f3dbb6959f974c97e1 | PRIMARY KEY | PRIMARY KEY ("sourceId", kid) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_dc7d93798f3dbb6959f974c97e1 | CREATE UNIQUE INDEX "PK_dc7d93798f3dbb6959f974c97e1" ON public.trusted_key USING btree ("sourceId", kid) | + +## Relations + +```mermaid +erDiagram + +"public.trusted_key" }o--|| "public.trusted_key_source" : "FOREIGN KEY (#quot;sourceId#quot;) REFERENCES trusted_key_source(id) ON DELETE CASCADE" + +"public.trusted_key" { + varchar_36_ sourceId FK + varchar_255_ kid + text data + timestamp_3__with_time_zone createdAt +} +"public.trusted_key_source" { + varchar_36_ id + varchar_32_ type + text config + varchar_32_ status + text lastError + timestamp_3__with_time_zone lastRefreshedAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.trusted_key_source.md b/docs/generated/postgres-schema/public.trusted_key_source.md new file mode 100644 index 00000000000..a932403421d --- /dev/null +++ b/docs/generated/postgres-schema/public.trusted_key_source.md @@ -0,0 +1,61 @@ +# public.trusted_key_source + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [public.trusted_key](public.trusted_key.md) | | | +| type | varchar(32) | | false | | | | +| config | text | | false | | | | +| status | varchar(32) | 'pending'::character varying | false | | | | +| lastError | text | | true | | | | +| lastRefreshedAt | timestamp(3) with time zone | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| trusted_key_source_config_not_null | n | NOT NULL config | +| trusted_key_source_createdAt_not_null | n | NOT NULL "createdAt" | +| trusted_key_source_id_not_null | n | NOT NULL id | +| trusted_key_source_status_not_null | n | NOT NULL status | +| trusted_key_source_type_not_null | n | NOT NULL type | +| trusted_key_source_updatedAt_not_null | n | NOT NULL "updatedAt" | +| PK_99e8908ce2c2cdccce487db7fc6 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_99e8908ce2c2cdccce487db7fc6 | CREATE UNIQUE INDEX "PK_99e8908ce2c2cdccce487db7fc6" ON public.trusted_key_source USING btree (id) | + +## Relations + +```mermaid +erDiagram + +"public.trusted_key" }o--|| "public.trusted_key_source" : "FOREIGN KEY (#quot;sourceId#quot;) REFERENCES trusted_key_source(id) ON DELETE CASCADE" + +"public.trusted_key_source" { + varchar_36_ id + varchar_32_ type + text config + varchar_32_ status + text lastError + timestamp_3__with_time_zone lastRefreshedAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.trusted_key" { + varchar_36_ sourceId FK + varchar_255_ kid + text data + timestamp_3__with_time_zone createdAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.user.md b/docs/generated/postgres-schema/public.user.md new file mode 100644 index 00000000000..c8e53006977 --- /dev/null +++ b/docs/generated/postgres-schema/public.user.md @@ -0,0 +1,291 @@ +# public.user + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | uuid | gen_random_uuid() | false | [public.auth_identity](public.auth_identity.md) [public.project](public.project.md) [public.project_relation](public.project_relation.md) [public.user_api_keys](public.user_api_keys.md) [public.chat_hub_sessions](public.chat_hub_sessions.md) [public.chat_hub_agents](public.chat_hub_agents.md) [public.oauth_authorization_codes](public.oauth_authorization_codes.md) [public.oauth_access_tokens](public.oauth_access_tokens.md) [public.oauth_refresh_tokens](public.oauth_refresh_tokens.md) [public.oauth_user_consents](public.oauth_user_consents.md) [public.workflow_publish_history](public.workflow_publish_history.md) [public.dynamic_credential_user_entry](public.dynamic_credential_user_entry.md) [public.chat_hub_tools](public.chat_hub_tools.md) [public.workflow_builder_session](public.workflow_builder_session.md) [public.user_favorites](public.user_favorites.md) [public.evaluation_collection](public.evaluation_collection.md) [public.agent_history](public.agent_history.md) [public.instance_ai_pending_confirmations](public.instance_ai_pending_confirmations.md) [public.instance_ai_mcp_registry_connections](public.instance_ai_mcp_registry_connections.md) | | | +| email | varchar(255) | | true | | | | +| firstName | varchar(32) | | true | | | | +| lastName | varchar(32) | | true | | | | +| password | varchar(255) | | true | | | | +| personalizationAnswers | json | | true | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| settings | json | | true | | | | +| disabled | boolean | false | false | | | | +| mfaEnabled | boolean | false | false | | | | +| mfaSecret | text | | true | | | | +| mfaRecoveryCodes | text | | true | | | | +| lastActiveAt | date | | true | | | | +| roleSlug | varchar(128) | 'global:member'::character varying | false | | [public.role](public.role.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| user_createdAt_not_null | n | NOT NULL "createdAt" | +| user_disabled_not_null | n | NOT NULL disabled | +| user_id_not_null | n | NOT NULL id | +| user_mfaEnabled_not_null | n | NOT NULL "mfaEnabled" | +| user_roleSlug_not_null | n | NOT NULL "roleSlug" | +| user_updatedAt_not_null | n | NOT NULL "updatedAt" | +| PK_ea8f538c94b6e352418254ed6474a81f | PRIMARY KEY | PRIMARY KEY (id) | +| UQ_e12875dfb3b1d92d7d7c5377e2 | UNIQUE | UNIQUE (email) | +| FK_eaea92ee7bfb9c1b6cd01505d56 | FOREIGN KEY | FOREIGN KEY ("roleSlug") REFERENCES role(slug) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_ea8f538c94b6e352418254ed6474a81f | CREATE UNIQUE INDEX "PK_ea8f538c94b6e352418254ed6474a81f" ON public."user" USING btree (id) | +| UQ_e12875dfb3b1d92d7d7c5377e2 | CREATE UNIQUE INDEX "UQ_e12875dfb3b1d92d7d7c5377e2" ON public."user" USING btree (email) | +| user_role_idx | CREATE INDEX user_role_idx ON public."user" USING btree ("roleSlug") | + +## Relations + +```mermaid +erDiagram + +"public.auth_identity" }o--o| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id)" +"public.project" }o--o| "public.user" : "FOREIGN KEY (#quot;creatorId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE SET NULL" +"public.project_relation" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.user_api_keys" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.chat_hub_sessions" }o--|| "public.user" : "FOREIGN KEY (#quot;ownerId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.chat_hub_agents" }o--|| "public.user" : "FOREIGN KEY (#quot;ownerId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.oauth_authorization_codes" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.oauth_access_tokens" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.oauth_refresh_tokens" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.oauth_user_consents" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.workflow_publish_history" }o--o| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE SET NULL" +"public.dynamic_credential_user_entry" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.chat_hub_tools" }o--|| "public.user" : "FOREIGN KEY (#quot;ownerId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.workflow_builder_session" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.user_favorites" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.evaluation_collection" }o--o| "public.user" : "FOREIGN KEY (#quot;createdById#quot;) REFERENCES #quot;user#quot;(id) ON DELETE SET NULL" +"public.agent_history" }o--o| "public.user" : "FOREIGN KEY (#quot;publishedById#quot;) REFERENCES #quot;user#quot;(id) ON DELETE SET NULL" +"public.instance_ai_pending_confirmations" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.instance_ai_mcp_registry_connections" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" +"public.user" }o--|| "public.role" : "FOREIGN KEY (#quot;roleSlug#quot;) REFERENCES role(slug)" + +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"public.auth_identity" { + uuid userId FK + varchar_255_ providerId + varchar_32_ providerType + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.project" { + varchar_36_ id + varchar_255_ name + varchar_36_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + varchar_512_ description + uuid creatorId FK + json customTelemetryTags +} +"public.project_relation" { + varchar_36_ projectId FK + uuid userId FK + varchar role FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.user_api_keys" { + varchar_36_ id + uuid userId FK + varchar_100_ label + varchar apiKey + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json scopes + varchar audience + timestamp_3__with_time_zone lastUsedAt +} +"public.chat_hub_sessions" { + uuid id + varchar_256_ title + uuid ownerId FK + timestamp_3__with_time_zone lastMessageAt + varchar_36_ credentialId FK + varchar_16_ provider + varchar_256_ model + varchar_36_ workflowId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + uuid agentId FK + varchar_128_ agentName + varchar_16_ type +} +"public.chat_hub_agents" { + uuid id + varchar_256_ name + varchar_512_ description + text systemPrompt + uuid ownerId FK + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + json files + json suggestedPrompts +} +"public.oauth_authorization_codes" { + varchar_255_ code + varchar clientId FK + uuid userId FK + varchar redirectUri + varchar codeChallenge + varchar_255_ codeChallengeMethod + bigint expiresAt + varchar state + boolean used + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar resource + json scope +} +"public.oauth_access_tokens" { + varchar token + varchar clientId FK + uuid userId FK +} +"public.oauth_refresh_tokens" { + varchar_255_ token + varchar clientId FK + uuid userId FK + bigint expiresAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json scope +} +"public.oauth_user_consents" { + integer id + uuid userId FK + varchar clientId FK + bigint grantedAt +} +"public.workflow_publish_history" { + integer id + varchar_36_ workflowId FK + varchar_36_ versionId FK + varchar_36_ event + uuid userId FK + timestamp_3__with_time_zone createdAt +} +"public.dynamic_credential_user_entry" { + varchar_16_ credentialId FK + uuid userId FK + varchar_16_ resolverId FK + text data + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.chat_hub_tools" { + uuid id + varchar_255_ name + varchar_255_ type + double_precision typeVersion + uuid ownerId FK + json definition + boolean enabled + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.workflow_builder_session" { + uuid id + varchar_36_ workflowId FK + uuid userId FK + json messages + text previousSummary + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_255_ activeVersionCardId + varchar_255_ resumeAfterRestoreMessageId +} +"public.user_favorites" { + integer id + uuid userId FK + varchar_255_ resourceId + varchar_64_ resourceType +} +"public.evaluation_collection" { + varchar_36_ id + varchar_128_ name + text description + varchar_36_ workflowId FK + varchar_36_ evaluationConfigId FK + uuid createdById FK + json insightsCache + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.agent_history" { + varchar_36_ versionId + varchar_36_ agentId FK + json schema + json tools + json skills + uuid publishedById FK + varchar_255_ author + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_pending_confirmations" { + varchar_36_ requestId + uuid threadId FK + uuid userId FK + varchar_16_ kind + varchar_36_ runId + varchar_64_ toolCallId + varchar_36_ messageGroupId + varchar_255_ checkpointKey FK + varchar_36_ checkpointTaskId + timestamp_3__with_time_zone expiresAt + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.instance_ai_mcp_registry_connections" { + uuid id + varchar_36_ credentialId FK + varchar_255_ serverSlug FK + json toolFilter + uuid userId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.role" { + varchar_128_ slug + text displayName + text description + text roleType + boolean systemRole + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.user_api_keys.md b/docs/generated/postgres-schema/public.user_api_keys.md new file mode 100644 index 00000000000..c7e1a190c92 --- /dev/null +++ b/docs/generated/postgres-schema/public.user_api_keys.md @@ -0,0 +1,78 @@ +# public.user_api_keys + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| userId | uuid | | false | | [public.user](public.user.md) | | +| label | varchar(100) | | false | | | | +| apiKey | varchar | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| scopes | json | | true | | | | +| audience | varchar | 'public-api'::character varying | false | | | | +| lastUsedAt | timestamp(3) with time zone | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| user_api_keys_apiKey_not_null | n | NOT NULL "apiKey" | +| user_api_keys_audience_not_null | n | NOT NULL audience | +| user_api_keys_createdAt_not_null | n | NOT NULL "createdAt" | +| user_api_keys_id_not_null | n | NOT NULL id | +| user_api_keys_label_not_null | n | NOT NULL label | +| user_api_keys_updatedAt_not_null | n | NOT NULL "updatedAt" | +| user_api_keys_userId_not_null | n | NOT NULL "userId" | +| FK_e131705cbbc8fb589889b02d457 | FOREIGN KEY | FOREIGN KEY ("userId") REFERENCES "user"(id) ON DELETE CASCADE | +| PK_978fa5caa3468f463dac9d92e69 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_978fa5caa3468f463dac9d92e69 | CREATE UNIQUE INDEX "PK_978fa5caa3468f463dac9d92e69" ON public.user_api_keys USING btree (id) | +| IDX_63d7bbae72c767cf162d459fcc | CREATE UNIQUE INDEX "IDX_63d7bbae72c767cf162d459fcc" ON public.user_api_keys USING btree ("userId", label) | +| IDX_1ef35bac35d20bdae979d917a3 | CREATE UNIQUE INDEX "IDX_1ef35bac35d20bdae979d917a3" ON public.user_api_keys USING btree ("apiKey") | + +## Relations + +```mermaid +erDiagram + +"public.user_api_keys" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" + +"public.user_api_keys" { + varchar_36_ id + uuid userId FK + varchar_100_ label + varchar apiKey + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json scopes + varchar audience + timestamp_3__with_time_zone lastUsedAt +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.user_favorites.md b/docs/generated/postgres-schema/public.user_favorites.md new file mode 100644 index 00000000000..5cd7dc0b82a --- /dev/null +++ b/docs/generated/postgres-schema/public.user_favorites.md @@ -0,0 +1,67 @@ +# public.user_favorites + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | integer | | false | | | | +| userId | uuid | | false | | [public.user](public.user.md) | | +| resourceId | varchar(255) | | false | | | | +| resourceType | varchar(64) | | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| user_favorites_id_not_null | n | NOT NULL id | +| user_favorites_resourceId_not_null | n | NOT NULL "resourceId" | +| user_favorites_resourceType_not_null | n | NOT NULL "resourceType" | +| user_favorites_userId_not_null | n | NOT NULL "userId" | +| FK_1dd5c393ad0517be3c31a7af836 | FOREIGN KEY | FOREIGN KEY ("userId") REFERENCES "user"(id) ON DELETE CASCADE | +| PK_6c472a19a7423cfbbf6b7c75939 | PRIMARY KEY | PRIMARY KEY (id) | +| UQ_cf6ae658ead9ffc124723413c65 | UNIQUE | UNIQUE ("userId", "resourceId", "resourceType") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_6c472a19a7423cfbbf6b7c75939 | CREATE UNIQUE INDEX "PK_6c472a19a7423cfbbf6b7c75939" ON public.user_favorites USING btree (id) | +| UQ_cf6ae658ead9ffc124723413c65 | CREATE UNIQUE INDEX "UQ_cf6ae658ead9ffc124723413c65" ON public.user_favorites USING btree ("userId", "resourceId", "resourceType") | +| IDX_1dd5c393ad0517be3c31a7af83 | CREATE INDEX "IDX_1dd5c393ad0517be3c31a7af83" ON public.user_favorites USING btree ("userId") | +| IDX_1d11050a381548c42c32cc25c4 | CREATE INDEX "IDX_1d11050a381548c42c32cc25c4" ON public.user_favorites USING btree ("resourceType", "resourceId") | + +## Relations + +```mermaid +erDiagram + +"public.user_favorites" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" + +"public.user_favorites" { + integer id + uuid userId FK + varchar_255_ resourceId + varchar_64_ resourceType +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.variables.md b/docs/generated/postgres-schema/public.variables.md new file mode 100644 index 00000000000..f76c4ac2e1b --- /dev/null +++ b/docs/generated/postgres-schema/public.variables.md @@ -0,0 +1,61 @@ +# public.variables + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| key | varchar(50) | | false | | | | +| type | varchar(50) | 'string'::character varying | false | | | | +| value | text | | true | | | | +| id | varchar(36) | | false | | | | +| projectId | varchar(36) | | true | | [public.project](public.project.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| variables_id_not_null1 | n | NOT NULL id | +| variables_key_not_null | n | NOT NULL key | +| variables_type_not_null | n | NOT NULL type | +| variables_value_max_len | CHECK | CHECK (((value IS NULL) OR (char_length(value) <= 1000))) | +| variables_pkey | PRIMARY KEY | PRIMARY KEY (id) | +| FK_42f6c766f9f9d2edcc15bdd6e9b | FOREIGN KEY | FOREIGN KEY ("projectId") REFERENCES project(id) ON DELETE CASCADE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| variables_pkey | CREATE UNIQUE INDEX variables_pkey ON public.variables USING btree (id) | +| variables_project_key_unique | CREATE UNIQUE INDEX variables_project_key_unique ON public.variables USING btree ("projectId", key) WHERE ("projectId" IS NOT NULL) | +| variables_global_key_unique | CREATE UNIQUE INDEX variables_global_key_unique ON public.variables USING btree (key) WHERE ("projectId" IS NULL) | + +## Relations + +```mermaid +erDiagram + +"public.variables" }o--o| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE" + +"public.variables" { + varchar_50_ key + varchar_50_ type + text value + varchar_36_ id + varchar_36_ projectId FK +} +"public.project" { + varchar_36_ id + varchar_255_ name + varchar_36_ type + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json icon + varchar_512_ description + uuid creatorId FK + json customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.webhook_entity.md b/docs/generated/postgres-schema/public.webhook_entity.md new file mode 100644 index 00000000000..461d186973c --- /dev/null +++ b/docs/generated/postgres-schema/public.webhook_entity.md @@ -0,0 +1,73 @@ +# public.webhook_entity + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| webhookPath | varchar | | false | | | | +| method | varchar | | false | | | | +| node | varchar | | false | | | | +| webhookId | varchar | | true | | | | +| pathLength | integer | | true | | | | +| workflowId | varchar(36) | | false | | [public.workflow_entity](public.workflow_entity.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| webhook_entity_method_not_null | n | NOT NULL method | +| webhook_entity_node_not_null | n | NOT NULL node | +| webhook_entity_webhookPath_not_null | n | NOT NULL "webhookPath" | +| webhook_entity_workflowId_not_null1 | n | NOT NULL "workflowId" | +| PK_b21ace2e13596ccd87dc9bf4ea6 | PRIMARY KEY | PRIMARY KEY ("webhookPath", method) | +| fk_webhook_entity_workflow_id | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE CASCADE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_b21ace2e13596ccd87dc9bf4ea6 | CREATE UNIQUE INDEX "PK_b21ace2e13596ccd87dc9bf4ea6" ON public.webhook_entity USING btree ("webhookPath", method) | +| idx_16f4436789e804e3e1c9eeb240 | CREATE INDEX idx_16f4436789e804e3e1c9eeb240 ON public.webhook_entity USING btree ("webhookId", method, "pathLength") | + +## Relations + +```mermaid +erDiagram + +"public.webhook_entity" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" + +"public.webhook_entity" { + varchar webhookPath + varchar method + varchar node + varchar webhookId + integer pathLength + varchar_36_ workflowId FK +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.workflow_builder_session.md b/docs/generated/postgres-schema/public.workflow_builder_session.md new file mode 100644 index 00000000000..0fb775be5c0 --- /dev/null +++ b/docs/generated/postgres-schema/public.workflow_builder_session.md @@ -0,0 +1,101 @@ +# public.workflow_builder_session + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | uuid | | false | | | | +| workflowId | varchar(36) | | false | | [public.workflow_entity](public.workflow_entity.md) | | +| userId | uuid | | false | | [public.user](public.user.md) | | +| messages | json | '[]'::json | false | | | | +| previousSummary | text | | true | | | Summary of prior conversation from compaction (/compact or auto-compact) | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| activeVersionCardId | varchar(255) | | true | | | | +| resumeAfterRestoreMessageId | varchar(255) | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| workflow_builder_session_createdAt_not_null | n | NOT NULL "createdAt" | +| workflow_builder_session_id_not_null | n | NOT NULL id | +| workflow_builder_session_messages_not_null | n | NOT NULL messages | +| workflow_builder_session_updatedAt_not_null | n | NOT NULL "updatedAt" | +| workflow_builder_session_userId_not_null | n | NOT NULL "userId" | +| workflow_builder_session_workflowId_not_null | n | NOT NULL "workflowId" | +| FK_00290cdeee4d4d7db84709be936 | FOREIGN KEY | FOREIGN KEY ("userId") REFERENCES "user"(id) ON DELETE CASCADE | +| FK_7983c618db48f47bf5a4cc1e1e4 | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE CASCADE | +| PK_e69ef0d385986e273423b0e8695 | PRIMARY KEY | PRIMARY KEY (id) | +| UQ_ec2aa73632932d485a1d5192ce1 | UNIQUE | UNIQUE ("workflowId", "userId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_e69ef0d385986e273423b0e8695 | CREATE UNIQUE INDEX "PK_e69ef0d385986e273423b0e8695" ON public.workflow_builder_session USING btree (id) | +| UQ_ec2aa73632932d485a1d5192ce1 | CREATE UNIQUE INDEX "UQ_ec2aa73632932d485a1d5192ce1" ON public.workflow_builder_session USING btree ("workflowId", "userId") | + +## Relations + +```mermaid +erDiagram + +"public.workflow_builder_session" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.workflow_builder_session" }o--|| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE" + +"public.workflow_builder_session" { + uuid id + varchar_36_ workflowId FK + uuid userId FK + json messages + text previousSummary + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_255_ activeVersionCardId + varchar_255_ resumeAfterRestoreMessageId +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.workflow_dependency.md b/docs/generated/postgres-schema/public.workflow_dependency.md new file mode 100644 index 00000000000..3ed65448a8c --- /dev/null +++ b/docs/generated/postgres-schema/public.workflow_dependency.md @@ -0,0 +1,85 @@ +# public.workflow_dependency + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | integer | | false | | | | +| workflowId | varchar(36) | | false | | [public.workflow_entity](public.workflow_entity.md) | | +| workflowVersionId | integer | | false | | | Version of the workflow | +| dependencyType | varchar(32) | | false | | | Type of dependency: "credential", "nodeType", "webhookPath", or "workflowCall" | +| dependencyKey | varchar(255) | | false | | | ID or name of the dependency | +| dependencyInfo | json | | true | | | Additional info about the dependency, interpreted based on type | +| indexVersionId | smallint | 1 | false | | | Version of the index structure | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| publishedVersionId | varchar(36) | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| workflow_dependency_createdAt_not_null | n | NOT NULL "createdAt" | +| workflow_dependency_dependencyKey_not_null | n | NOT NULL "dependencyKey" | +| workflow_dependency_dependencyType_not_null | n | NOT NULL "dependencyType" | +| workflow_dependency_id_not_null | n | NOT NULL id | +| workflow_dependency_indexVersionId_not_null | n | NOT NULL "indexVersionId" | +| workflow_dependency_workflowId_not_null | n | NOT NULL "workflowId" | +| workflow_dependency_workflowVersionId_not_null | n | NOT NULL "workflowVersionId" | +| FK_a4ff2d9b9628ea988fa9e7d0bf8 | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE CASCADE | +| PK_52325e34cd7a2f0f67b0f3cad65 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_52325e34cd7a2f0f67b0f3cad65 | CREATE UNIQUE INDEX "PK_52325e34cd7a2f0f67b0f3cad65" ON public.workflow_dependency USING btree (id) | +| IDX_a4ff2d9b9628ea988fa9e7d0bf | CREATE INDEX "IDX_a4ff2d9b9628ea988fa9e7d0bf" ON public.workflow_dependency USING btree ("workflowId") | +| IDX_e7fe1cfda990c14a445937d0b9 | CREATE INDEX "IDX_e7fe1cfda990c14a445937d0b9" ON public.workflow_dependency USING btree ("dependencyType") | +| IDX_e48a201071ab85d9d09119d640 | CREATE INDEX "IDX_e48a201071ab85d9d09119d640" ON public.workflow_dependency USING btree ("dependencyKey") | +| IDX_workflow_dependency_publishedVersionId | CREATE INDEX "IDX_workflow_dependency_publishedVersionId" ON public.workflow_dependency USING btree ("publishedVersionId") | + +## Relations + +```mermaid +erDiagram + +"public.workflow_dependency" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" + +"public.workflow_dependency" { + integer id + varchar_36_ workflowId FK + integer workflowVersionId + varchar_32_ dependencyType + varchar_255_ dependencyKey + json dependencyInfo + smallint indexVersionId + timestamp_3__with_time_zone createdAt + varchar_36_ publishedVersionId +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.workflow_entity.md b/docs/generated/postgres-schema/public.workflow_entity.md new file mode 100644 index 00000000000..415ea6b9449 --- /dev/null +++ b/docs/generated/postgres-schema/public.workflow_entity.md @@ -0,0 +1,304 @@ +# public.workflow_entity + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| name | varchar(128) | | false | | | | +| active | boolean | | false | | | | +| nodes | json | | false | | | | +| connections | json | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| settings | json | | true | | | | +| staticData | json | | true | | | | +| pinData | json | | true | | | | +| versionId | character(36) | | false | | | | +| triggerCount | integer | 0 | false | | | | +| id | varchar(36) | | false | [public.execution_entity](public.execution_entity.md) [public.webhook_entity](public.webhook_entity.md) [public.workflows_tags](public.workflows_tags.md) [public.workflow_history](public.workflow_history.md) [public.shared_workflow](public.shared_workflow.md) [public.processed_data](public.processed_data.md) [public.insights_metadata](public.insights_metadata.md) [public.test_run](public.test_run.md) [public.chat_hub_sessions](public.chat_hub_sessions.md) [public.chat_hub_messages](public.chat_hub_messages.md) [public.workflow_dependency](public.workflow_dependency.md) [public.workflow_publish_history](public.workflow_publish_history.md) [public.workflow_published_version](public.workflow_published_version.md) [public.workflow_builder_session](public.workflow_builder_session.md) [public.ai_builder_temporary_workflow](public.ai_builder_temporary_workflow.md) [public.evaluation_config](public.evaluation_config.md) [public.evaluation_collection](public.evaluation_collection.md) | | | +| meta | json | | true | | | | +| parentFolderId | varchar(36) | NULL::character varying | true | | [public.folder](public.folder.md) | | +| isArchived | boolean | false | false | | | | +| versionCounter | integer | 1 | false | | | | +| description | text | | true | | | | +| activeVersionId | varchar(36) | | true | | [public.workflow_history](public.workflow_history.md) | | +| nodeGroups | json | '[]'::json | false | | | | +| sourceWorkflowId | varchar | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| workflow_entity_active_not_null | n | NOT NULL active | +| workflow_entity_connections_not_null | n | NOT NULL connections | +| workflow_entity_createdAt_not_null | n | NOT NULL "createdAt" | +| workflow_entity_id_not_null1 | n | NOT NULL id | +| workflow_entity_isArchived_not_null | n | NOT NULL "isArchived" | +| workflow_entity_name_not_null | n | NOT NULL name | +| workflow_entity_nodeGroups_not_null | n | NOT NULL "nodeGroups" | +| workflow_entity_nodes_not_null | n | NOT NULL nodes | +| workflow_entity_triggerCount_not_null | n | NOT NULL "triggerCount" | +| workflow_entity_updatedAt_not_null | n | NOT NULL "updatedAt" | +| workflow_entity_versionCounter_not_null | n | NOT NULL "versionCounter" | +| workflow_entity_versionId_not_null | n | NOT NULL "versionId" | +| workflow_entity_pkey | PRIMARY KEY | PRIMARY KEY (id) | +| FK_08d6c67b7f722b0039d9d5ed620 | FOREIGN KEY | FOREIGN KEY ("activeVersionId") REFERENCES workflow_history("versionId") ON DELETE RESTRICT | +| fk_workflow_parent_folder | FOREIGN KEY | FOREIGN KEY ("parentFolderId") REFERENCES folder(id) ON DELETE CASCADE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| pk_workflow_entity_id | CREATE UNIQUE INDEX pk_workflow_entity_id ON public.workflow_entity USING btree (id) | +| workflow_entity_pkey | CREATE UNIQUE INDEX workflow_entity_pkey ON public.workflow_entity USING btree (id) | +| IDX_workflow_entity_name | CREATE INDEX "IDX_workflow_entity_name" ON public.workflow_entity USING btree (name) | +| IDX_workflow_entity_sourceWorkflowId | CREATE INDEX "IDX_workflow_entity_sourceWorkflowId" ON public.workflow_entity USING btree ("sourceWorkflowId") WHERE ("sourceWorkflowId" IS NOT NULL) | + +## Triggers + +| Name | Definition | +| ---- | ---------- | +| workflow_version_increment | CREATE TRIGGER workflow_version_increment BEFORE UPDATE ON public.workflow_entity FOR EACH ROW EXECUTE FUNCTION increment_workflow_version() | + +## Relations + +```mermaid +erDiagram + +"public.execution_entity" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.webhook_entity" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.workflows_tags" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.workflow_history" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.shared_workflow" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.processed_data" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.insights_metadata" }o--o| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE SET NULL" +"public.test_run" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.chat_hub_sessions" }o--o| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE SET NULL" +"public.chat_hub_messages" }o--o| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE SET NULL" +"public.workflow_dependency" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.workflow_publish_history" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.workflow_published_version" |o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE RESTRICT" +"public.workflow_builder_session" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.ai_builder_temporary_workflow" |o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.evaluation_config" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.evaluation_collection" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.workflow_entity" }o--o| "public.folder" : "FOREIGN KEY (#quot;parentFolderId#quot;) REFERENCES folder(id) ON DELETE CASCADE" +"public.workflow_entity" }o--o| "public.workflow_history" : "FOREIGN KEY (#quot;activeVersionId#quot;) REFERENCES workflow_history(#quot;versionId#quot;) ON DELETE RESTRICT" + +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +"public.execution_entity" { + integer id + boolean finished + varchar mode + varchar retryOf + varchar retrySuccessId + timestamp_3__with_time_zone startedAt + timestamp_3__with_time_zone stoppedAt + timestamp_3__with_time_zone waitTill + varchar status + varchar_36_ workflowId FK + timestamp_3__with_time_zone deletedAt + timestamp_3__with_time_zone createdAt + varchar_2_ storedAt + json tracingContext + varchar_255_ deduplicationKey +} +"public.webhook_entity" { + varchar webhookPath + varchar method + varchar node + varchar webhookId + integer pathLength + varchar_36_ workflowId FK +} +"public.workflows_tags" { + varchar_36_ workflowId FK + varchar_36_ tagId FK +} +"public.workflow_history" { + varchar_36_ versionId + varchar_36_ workflowId FK + varchar_255_ authors + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json nodes + json connections + varchar_128_ name + boolean autosaved + text description + json nodeGroups +} +"public.shared_workflow" { + varchar_36_ workflowId FK + varchar_36_ projectId FK + text role + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.processed_data" { + varchar_36_ workflowId FK + varchar_255_ context + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + text value +} +"public.insights_metadata" { + integer metaId + varchar_36_ workflowId FK + varchar_36_ projectId FK + varchar_128_ workflowName + varchar_255_ projectName +} +"public.test_run" { + varchar_36_ id + varchar_36_ workflowId FK + varchar status + varchar errorCode + json errorDetails + timestamp_3__with_time_zone runAt + timestamp_3__with_time_zone completedAt + json metrics + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_255_ runningInstanceId + boolean cancelRequested + varchar_36_ workflowVersionId + varchar_36_ evaluationConfigId FK + jsonb evaluationConfigSnapshot + varchar_36_ collectionId FK +} +"public.chat_hub_sessions" { + uuid id + varchar_256_ title + uuid ownerId FK + timestamp_3__with_time_zone lastMessageAt + varchar_36_ credentialId FK + varchar_16_ provider + varchar_256_ model + varchar_36_ workflowId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + uuid agentId FK + varchar_128_ agentName + varchar_16_ type +} +"public.chat_hub_messages" { + uuid id + uuid sessionId FK + uuid previousMessageId FK + uuid revisionOfMessageId FK + uuid retryOfMessageId FK + varchar_16_ type + varchar_128_ name + text content + varchar_16_ provider + varchar_256_ model + varchar_36_ workflowId FK + integer executionId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + uuid agentId FK + varchar_16_ status + json attachments +} +"public.workflow_dependency" { + integer id + varchar_36_ workflowId FK + integer workflowVersionId + varchar_32_ dependencyType + varchar_255_ dependencyKey + json dependencyInfo + smallint indexVersionId + timestamp_3__with_time_zone createdAt + varchar_36_ publishedVersionId +} +"public.workflow_publish_history" { + integer id + varchar_36_ workflowId FK + varchar_36_ versionId FK + varchar_36_ event + uuid userId FK + timestamp_3__with_time_zone createdAt +} +"public.workflow_published_version" { + varchar_36_ workflowId FK + varchar_36_ publishedVersionId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.workflow_builder_session" { + uuid id + varchar_36_ workflowId FK + uuid userId FK + json messages + text previousSummary + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_255_ activeVersionCardId + varchar_255_ resumeAfterRestoreMessageId +} +"public.ai_builder_temporary_workflow" { + varchar_36_ workflowId FK + uuid threadId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.evaluation_config" { + varchar_36_ id + varchar_36_ workflowId FK + varchar_128_ name + varchar_16_ status + varchar_64_ invalidReason + varchar_32_ datasetSource + json datasetRef + varchar_255_ startNodeName + varchar_255_ endNodeName + json metrics + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.evaluation_collection" { + varchar_36_ id + varchar_128_ name + text description + varchar_36_ workflowId FK + varchar_36_ evaluationConfigId FK + uuid createdById FK + json insightsCache + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.folder" { + varchar_36_ id + varchar_128_ name + varchar_36_ parentFolderId FK + varchar_36_ projectId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.workflow_history.md b/docs/generated/postgres-schema/public.workflow_history.md new file mode 100644 index 00000000000..c27dd759bd2 --- /dev/null +++ b/docs/generated/postgres-schema/public.workflow_history.md @@ -0,0 +1,105 @@ +# public.workflow_history + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| versionId | varchar(36) | | false | [public.workflow_entity](public.workflow_entity.md) [public.workflow_publish_history](public.workflow_publish_history.md) [public.workflow_published_version](public.workflow_published_version.md) | | | +| workflowId | varchar(36) | | false | | [public.workflow_entity](public.workflow_entity.md) | | +| authors | varchar(255) | | false | | | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| nodes | json | | false | | | | +| connections | json | | false | | | | +| name | varchar(128) | | true | | | | +| autosaved | boolean | false | false | | | | +| description | text | | true | | | | +| nodeGroups | json | '[]'::json | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| workflow_history_authors_not_null | n | NOT NULL authors | +| workflow_history_autosaved_not_null | n | NOT NULL autosaved | +| workflow_history_connections_not_null | n | NOT NULL connections | +| workflow_history_createdAt_not_null | n | NOT NULL "createdAt" | +| workflow_history_nodeGroups_not_null | n | NOT NULL "nodeGroups" | +| workflow_history_nodes_not_null | n | NOT NULL nodes | +| workflow_history_updatedAt_not_null | n | NOT NULL "updatedAt" | +| workflow_history_versionId_not_null | n | NOT NULL "versionId" | +| workflow_history_workflowId_not_null | n | NOT NULL "workflowId" | +| FK_1e31657f5fe46816c34be7c1b4b | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE CASCADE | +| PK_b6572dd6173e4cd06fe79937b58 | PRIMARY KEY | PRIMARY KEY ("versionId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_b6572dd6173e4cd06fe79937b58 | CREATE UNIQUE INDEX "PK_b6572dd6173e4cd06fe79937b58" ON public.workflow_history USING btree ("versionId") | +| IDX_1e31657f5fe46816c34be7c1b4 | CREATE INDEX "IDX_1e31657f5fe46816c34be7c1b4" ON public.workflow_history USING btree ("workflowId") | + +## Relations + +```mermaid +erDiagram + +"public.workflow_entity" }o--o| "public.workflow_history" : "FOREIGN KEY (#quot;activeVersionId#quot;) REFERENCES workflow_history(#quot;versionId#quot;) ON DELETE RESTRICT" +"public.workflow_publish_history" }o--o| "public.workflow_history" : "FOREIGN KEY (#quot;versionId#quot;) REFERENCES workflow_history(#quot;versionId#quot;) ON DELETE SET NULL" +"public.workflow_published_version" }o--|| "public.workflow_history" : "FOREIGN KEY (#quot;publishedVersionId#quot;) REFERENCES workflow_history(#quot;versionId#quot;) ON DELETE RESTRICT" +"public.workflow_history" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" + +"public.workflow_history" { + varchar_36_ versionId + varchar_36_ workflowId FK + varchar_255_ authors + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json nodes + json connections + varchar_128_ name + boolean autosaved + text description + json nodeGroups +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +"public.workflow_publish_history" { + integer id + varchar_36_ workflowId FK + varchar_36_ versionId FK + varchar_36_ event + uuid userId FK + timestamp_3__with_time_zone createdAt +} +"public.workflow_published_version" { + varchar_36_ workflowId FK + varchar_36_ publishedVersionId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.workflow_publication_outbox.md b/docs/generated/postgres-schema/public.workflow_publication_outbox.md new file mode 100644 index 00000000000..cfe031cb6b6 --- /dev/null +++ b/docs/generated/postgres-schema/public.workflow_publication_outbox.md @@ -0,0 +1,54 @@ +# public.workflow_publication_outbox + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | integer | | false | | | | +| workflowId | varchar(36) | | false | | | References workflow_entity.id. | +| publishedVersionId | varchar(36) | | false | | | References workflow_history.versionId. | +| status | varchar(20) | | false | | | | +| errorMessage | text | | true | | | Error details for surfacing failed publications to the user. | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| CHK_workflow_publication_outbox_status | CHECK | CHECK (((status)::text = ANY ((ARRAY['pending'::character varying, 'in_progress'::character varying, 'completed'::character varying, 'partial_success'::character varying, 'failed'::character varying])::text[]))) | +| workflow_publication_outbox_createdAt_not_null | n | NOT NULL "createdAt" | +| workflow_publication_outbox_id_not_null | n | NOT NULL id | +| workflow_publication_outbox_publishedVersionId_not_null | n | NOT NULL "publishedVersionId" | +| workflow_publication_outbox_status_not_null | n | NOT NULL status | +| workflow_publication_outbox_updatedAt_not_null | n | NOT NULL "updatedAt" | +| workflow_publication_outbox_workflowId_not_null | n | NOT NULL "workflowId" | +| PK_b3e2eeee36a4bd044d56468d311 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_b3e2eeee36a4bd044d56468d311 | CREATE UNIQUE INDEX "PK_b3e2eeee36a4bd044d56468d311" ON public.workflow_publication_outbox USING btree (id) | +| IDX_workflow_publication_outbox_active_workflow_status | CREATE UNIQUE INDEX "IDX_workflow_publication_outbox_active_workflow_status" ON public.workflow_publication_outbox USING btree ("workflowId", status) WHERE ((status)::text = ANY ((ARRAY['pending'::character varying, 'in_progress'::character varying])::text[])) | + +## Relations + +```mermaid +erDiagram + + +"public.workflow_publication_outbox" { + integer id + varchar_36_ workflowId + varchar_36_ publishedVersionId + varchar_20_ status + text errorMessage + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.workflow_publish_history.md b/docs/generated/postgres-schema/public.workflow_publish_history.md new file mode 100644 index 00000000000..42c42672096 --- /dev/null +++ b/docs/generated/postgres-schema/public.workflow_publish_history.md @@ -0,0 +1,108 @@ +# public.workflow_publish_history + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | integer | | false | | | | +| workflowId | varchar(36) | | false | | [public.workflow_entity](public.workflow_entity.md) | | +| versionId | varchar(36) | | true | | [public.workflow_history](public.workflow_history.md) | | +| event | varchar(36) | | false | | | Type of history record: activated (workflow is now active), deactivated (workflow is now inactive) | +| userId | uuid | | true | | [public.user](public.user.md) | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| CHK_workflow_publish_history_event | CHECK | CHECK (((event)::text = ANY ((ARRAY['activated'::character varying, 'deactivated'::character varying])::text[]))) | +| workflow_publish_history_createdAt_not_null | n | NOT NULL "createdAt" | +| workflow_publish_history_event_not_null | n | NOT NULL event | +| workflow_publish_history_id_not_null | n | NOT NULL id | +| workflow_publish_history_workflowId_not_null | n | NOT NULL "workflowId" | +| FK_6eab5bd9eedabe9c54bd879fc40 | FOREIGN KEY | FOREIGN KEY ("userId") REFERENCES "user"(id) ON DELETE SET NULL | +| FK_c01316f8c2d7101ec4fa9809267 | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE CASCADE | +| FK_b4cfbc7556d07f36ca177f5e473 | FOREIGN KEY | FOREIGN KEY ("versionId") REFERENCES workflow_history("versionId") ON DELETE SET NULL | +| PK_c788f7caf88e91e365c97d6d04a | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_c788f7caf88e91e365c97d6d04a | CREATE UNIQUE INDEX "PK_c788f7caf88e91e365c97d6d04a" ON public.workflow_publish_history USING btree (id) | +| IDX_070b5de842ece9ccdda0d9738b | CREATE INDEX "IDX_070b5de842ece9ccdda0d9738b" ON public.workflow_publish_history USING btree ("workflowId", "versionId") | + +## Relations + +```mermaid +erDiagram + +"public.workflow_publish_history" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.workflow_publish_history" }o--o| "public.workflow_history" : "FOREIGN KEY (#quot;versionId#quot;) REFERENCES workflow_history(#quot;versionId#quot;) ON DELETE SET NULL" +"public.workflow_publish_history" }o--o| "public.user" : "FOREIGN KEY (#quot;userId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE SET NULL" + +"public.workflow_publish_history" { + integer id + varchar_36_ workflowId FK + varchar_36_ versionId FK + varchar_36_ event + uuid userId FK + timestamp_3__with_time_zone createdAt +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +"public.workflow_history" { + varchar_36_ versionId + varchar_36_ workflowId FK + varchar_255_ authors + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json nodes + json connections + varchar_128_ name + boolean autosaved + text description + json nodeGroups +} +"public.user" { + uuid id + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar_255_ password + json personalizationAnswers + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + boolean disabled + boolean mfaEnabled + text mfaSecret + text mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.workflow_published_version.md b/docs/generated/postgres-schema/public.workflow_published_version.md new file mode 100644 index 00000000000..9fb541f6110 --- /dev/null +++ b/docs/generated/postgres-schema/public.workflow_published_version.md @@ -0,0 +1,83 @@ +# public.workflow_published_version + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| workflowId | varchar(36) | | false | | [public.workflow_entity](public.workflow_entity.md) | | +| publishedVersionId | varchar(36) | | false | | [public.workflow_history](public.workflow_history.md) | | +| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | +| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| workflow_published_version_createdAt_not_null | n | NOT NULL "createdAt" | +| workflow_published_version_publishedVersionId_not_null | n | NOT NULL "publishedVersionId" | +| workflow_published_version_updatedAt_not_null | n | NOT NULL "updatedAt" | +| workflow_published_version_workflowId_not_null | n | NOT NULL "workflowId" | +| FK_5c76fb7ee939fe2530374d3f75a | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE RESTRICT | +| FK_df3428a541b802d6a63ac56e330 | FOREIGN KEY | FOREIGN KEY ("publishedVersionId") REFERENCES workflow_history("versionId") ON DELETE RESTRICT | +| PK_5c76fb7ee939fe2530374d3f75a | PRIMARY KEY | PRIMARY KEY ("workflowId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| PK_5c76fb7ee939fe2530374d3f75a | CREATE UNIQUE INDEX "PK_5c76fb7ee939fe2530374d3f75a" ON public.workflow_published_version USING btree ("workflowId") | + +## Relations + +```mermaid +erDiagram + +"public.workflow_published_version" |o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE RESTRICT" +"public.workflow_published_version" }o--|| "public.workflow_history" : "FOREIGN KEY (#quot;publishedVersionId#quot;) REFERENCES workflow_history(#quot;versionId#quot;) ON DELETE RESTRICT" + +"public.workflow_published_version" { + varchar_36_ workflowId FK + varchar_36_ publishedVersionId FK + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +"public.workflow_history" { + varchar_36_ versionId + varchar_36_ workflowId FK + varchar_255_ authors + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json nodes + json connections + varchar_128_ name + boolean autosaved + text description + json nodeGroups +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.workflow_statistics.md b/docs/generated/postgres-schema/public.workflow_statistics.md new file mode 100644 index 00000000000..a22e0db9de0 --- /dev/null +++ b/docs/generated/postgres-schema/public.workflow_statistics.md @@ -0,0 +1,50 @@ +# public.workflow_statistics + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| count | bigint | 0 | true | | | | +| latestEvent | timestamp(3) with time zone | | true | | | | +| name | varchar(128) | | false | | | | +| workflowId | varchar(36) | | false | | | | +| rootCount | bigint | 0 | true | | | | +| id | integer | nextval('workflow_statistics_id_seq'::regclass) | false | | | | +| workflowName | varchar(128) | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| workflow_statistics_id_not_null | n | NOT NULL id | +| workflow_statistics_name_not_null | n | NOT NULL name | +| workflow_statistics_workflowId_not_null1 | n | NOT NULL "workflowId" | +| workflow_statistics_pkey | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| workflow_statistics_pkey | CREATE UNIQUE INDEX workflow_statistics_pkey ON public.workflow_statistics USING btree (id) | +| IDX_workflow_statistics_workflow_name | CREATE UNIQUE INDEX "IDX_workflow_statistics_workflow_name" ON public.workflow_statistics USING btree ("workflowId", name) | + +## Relations + +```mermaid +erDiagram + + +"public.workflow_statistics" { + bigint count + timestamp_3__with_time_zone latestEvent + varchar_128_ name + varchar_36_ workflowId + bigint rootCount + integer id + varchar_128_ workflowName +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/public.workflows_tags.md b/docs/generated/postgres-schema/public.workflows_tags.md new file mode 100644 index 00000000000..a94a1e77e3a --- /dev/null +++ b/docs/generated/postgres-schema/public.workflows_tags.md @@ -0,0 +1,71 @@ +# public.workflows_tags + +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| workflowId | varchar(36) | | false | | [public.workflow_entity](public.workflow_entity.md) | | +| tagId | varchar(36) | | false | | [public.tag_entity](public.tag_entity.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| workflows_tags_tagId_not_null1 | n | NOT NULL "tagId" | +| workflows_tags_workflowId_not_null1 | n | NOT NULL "workflowId" | +| fk_workflows_tags_workflow_id | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE CASCADE | +| fk_workflows_tags_tag_id | FOREIGN KEY | FOREIGN KEY ("tagId") REFERENCES tag_entity(id) ON DELETE CASCADE | +| pk_workflows_tags | PRIMARY KEY | PRIMARY KEY ("workflowId", "tagId") | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| pk_workflows_tags | CREATE UNIQUE INDEX pk_workflows_tags ON public.workflows_tags USING btree ("workflowId", "tagId") | +| idx_workflows_tags_workflow_id | CREATE INDEX idx_workflows_tags_workflow_id ON public.workflows_tags USING btree ("workflowId") | + +## Relations + +```mermaid +erDiagram + +"public.workflows_tags" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE" +"public.workflows_tags" }o--|| "public.tag_entity" : "FOREIGN KEY (#quot;tagId#quot;) REFERENCES tag_entity(id) ON DELETE CASCADE" + +"public.workflows_tags" { + varchar_36_ workflowId FK + varchar_36_ tagId FK +} +"public.workflow_entity" { + varchar_128_ name + boolean active + json nodes + json connections + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + json settings + json staticData + json pinData + character_36_ versionId + integer triggerCount + varchar_36_ id + json meta + varchar_36_ parentFolderId FK + boolean isArchived + integer versionCounter + text description + varchar_36_ activeVersionId FK + json nodeGroups + varchar sourceWorkflowId +} +"public.tag_entity" { + varchar_24_ name + timestamp_3__with_time_zone createdAt + timestamp_3__with_time_zone updatedAt + varchar_36_ id +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/postgres-schema/schema.json b/docs/generated/postgres-schema/schema.json new file mode 100644 index 00000000000..20884d30513 --- /dev/null +++ b/docs/generated/postgres-schema/schema.json @@ -0,0 +1,18859 @@ +{ + "name": "n8n database schema (PostgreSQL)", + "desc": "Auto-generated from the PostgreSQL migrations in @n8n/db. Do not edit by hand.", + "tables": [ + { + "name": "public.credentials_entity", + "type": "BASE TABLE", + "columns": [ + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "data", + "type": "text", + "nullable": false + }, + { + "name": "type", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "isManaged", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "isGlobal", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "isResolvable", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "resolvableAllowFallback", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "resolverId", + "type": "varchar(16)", + "nullable": true + } + ], + "indexes": [ + { + "name": "idx_07fde106c0b471d8cc80a64fc8", + "def": "CREATE INDEX idx_07fde106c0b471d8cc80a64fc8 ON public.credentials_entity USING btree (type)", + "table": "public.credentials_entity", + "columns": [ + "type" + ] + }, + { + "name": "pk_credentials_entity_id", + "def": "CREATE UNIQUE INDEX pk_credentials_entity_id ON public.credentials_entity USING btree (id)", + "table": "public.credentials_entity", + "columns": [ + "id" + ] + }, + { + "name": "credentials_entity_pkey", + "def": "CREATE UNIQUE INDEX credentials_entity_pkey ON public.credentials_entity USING btree (id)", + "table": "public.credentials_entity", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "credentials_entity_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.credentials_entity", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "credentials_entity_data_not_null", + "type": "n", + "def": "NOT NULL data", + "table": "public.credentials_entity", + "referenced_table": "", + "columns": [ + "data" + ] + }, + { + "name": "credentials_entity_id_not_null1", + "type": "n", + "def": "NOT NULL id", + "table": "public.credentials_entity", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "credentials_entity_isGlobal_not_null", + "type": "n", + "def": "NOT NULL \"isGlobal\"", + "table": "public.credentials_entity", + "referenced_table": "", + "columns": [ + "isGlobal" + ] + }, + { + "name": "credentials_entity_isManaged_not_null", + "type": "n", + "def": "NOT NULL \"isManaged\"", + "table": "public.credentials_entity", + "referenced_table": "", + "columns": [ + "isManaged" + ] + }, + { + "name": "credentials_entity_isResolvable_not_null", + "type": "n", + "def": "NOT NULL \"isResolvable\"", + "table": "public.credentials_entity", + "referenced_table": "", + "columns": [ + "isResolvable" + ] + }, + { + "name": "credentials_entity_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.credentials_entity", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "credentials_entity_resolvableAllowFallback_not_null", + "type": "n", + "def": "NOT NULL \"resolvableAllowFallback\"", + "table": "public.credentials_entity", + "referenced_table": "", + "columns": [ + "resolvableAllowFallback" + ] + }, + { + "name": "credentials_entity_type_not_null", + "type": "n", + "def": "NOT NULL type", + "table": "public.credentials_entity", + "referenced_table": "", + "columns": [ + "type" + ] + }, + { + "name": "credentials_entity_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.credentials_entity", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "credentials_entity_pkey", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.credentials_entity", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "credentials_entity_resolverId_foreign", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"resolverId\") REFERENCES dynamic_credential_resolver(id) ON DELETE SET NULL", + "table": "public.credentials_entity", + "referenced_table": "public.dynamic_credential_resolver", + "columns": [ + "resolverId" + ], + "referenced_columns": [ + "id" + ] + } + ] + }, + { + "name": "public.execution_entity", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "integer", + "nullable": false, + "default": "nextval('execution_entity_id_seq'::regclass)" + }, + { + "name": "finished", + "type": "boolean", + "nullable": false + }, + { + "name": "mode", + "type": "varchar", + "nullable": false + }, + { + "name": "retryOf", + "type": "varchar", + "nullable": true + }, + { + "name": "retrySuccessId", + "type": "varchar", + "nullable": true + }, + { + "name": "startedAt", + "type": "timestamp(3) with time zone", + "nullable": true + }, + { + "name": "stoppedAt", + "type": "timestamp(3) with time zone", + "nullable": true + }, + { + "name": "waitTill", + "type": "timestamp(3) with time zone", + "nullable": true + }, + { + "name": "status", + "type": "varchar", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "deletedAt", + "type": "timestamp(3) with time zone", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "storedAt", + "type": "varchar(2)", + "nullable": false, + "default": "'db'::character varying" + }, + { + "name": "tracingContext", + "type": "json", + "nullable": true + }, + { + "name": "deduplicationKey", + "type": "varchar(255)", + "nullable": true + } + ], + "indexes": [ + { + "name": "pk_e3e63bbf986767844bbe1166d4e", + "def": "CREATE UNIQUE INDEX pk_e3e63bbf986767844bbe1166d4e ON public.execution_entity USING btree (id)", + "table": "public.execution_entity", + "columns": [ + "id" + ] + }, + { + "name": "IDX_execution_entity_deletedAt", + "def": "CREATE INDEX \"IDX_execution_entity_deletedAt\" ON public.execution_entity USING btree (\"deletedAt\")", + "table": "public.execution_entity", + "columns": [ + "deletedAt" + ] + }, + { + "name": "idx_execution_entity_workflow_id_started_at", + "def": "CREATE INDEX idx_execution_entity_workflow_id_started_at ON public.execution_entity USING btree (\"workflowId\", \"startedAt\") WHERE ((\"startedAt\" IS NOT NULL) AND (\"deletedAt\" IS NULL))", + "table": "public.execution_entity", + "columns": [ + "workflowId", + "startedAt" + ] + }, + { + "name": "idx_execution_entity_wait_till_status_deleted_at", + "def": "CREATE INDEX idx_execution_entity_wait_till_status_deleted_at ON public.execution_entity USING btree (\"waitTill\", status, \"deletedAt\") WHERE ((\"waitTill\" IS NOT NULL) AND (\"deletedAt\" IS NULL))", + "table": "public.execution_entity", + "columns": [ + "waitTill", + "status", + "deletedAt" + ] + }, + { + "name": "idx_execution_entity_stopped_at_status_deleted_at", + "def": "CREATE INDEX idx_execution_entity_stopped_at_status_deleted_at ON public.execution_entity USING btree (\"stoppedAt\", status, \"deletedAt\") WHERE ((\"stoppedAt\" IS NOT NULL) AND (\"deletedAt\" IS NULL))", + "table": "public.execution_entity", + "columns": [ + "stoppedAt", + "status", + "deletedAt" + ] + }, + { + "name": "IDX_execution_entity_deduplicationKey", + "def": "CREATE UNIQUE INDEX \"IDX_execution_entity_deduplicationKey\" ON public.execution_entity USING btree (\"deduplicationKey\") WHERE (\"deduplicationKey\" IS NOT NULL)", + "table": "public.execution_entity", + "columns": [ + "deduplicationKey" + ] + } + ], + "constraints": [ + { + "name": "execution_entity_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.execution_entity", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "execution_entity_finished_not_null", + "type": "n", + "def": "NOT NULL finished", + "table": "public.execution_entity", + "referenced_table": "", + "columns": [ + "finished" + ] + }, + { + "name": "execution_entity_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.execution_entity", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "execution_entity_mode_not_null", + "type": "n", + "def": "NOT NULL mode", + "table": "public.execution_entity", + "referenced_table": "", + "columns": [ + "mode" + ] + }, + { + "name": "execution_entity_status_not_null", + "type": "n", + "def": "NOT NULL status", + "table": "public.execution_entity", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "execution_entity_storedAt_check", + "type": "CHECK", + "def": "CHECK (((\"storedAt\")::text = ANY ((ARRAY['db'::character varying, 'fs'::character varying, 's3'::character varying])::text[])))", + "table": "public.execution_entity", + "referenced_table": "", + "columns": [ + "storedAt" + ] + }, + { + "name": "execution_entity_storedAt_not_null", + "type": "n", + "def": "NOT NULL \"storedAt\"", + "table": "public.execution_entity", + "referenced_table": "", + "columns": [ + "storedAt" + ] + }, + { + "name": "execution_entity_workflowId_not_null", + "type": "n", + "def": "NOT NULL \"workflowId\"", + "table": "public.execution_entity", + "referenced_table": "", + "columns": [ + "workflowId" + ] + }, + { + "name": "pk_e3e63bbf986767844bbe1166d4e", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.execution_entity", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "fk_execution_entity_workflow_id", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE", + "table": "public.execution_entity", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + } + ] + }, + { + "name": "public.workflow_entity", + "type": "BASE TABLE", + "columns": [ + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "active", + "type": "boolean", + "nullable": false + }, + { + "name": "nodes", + "type": "json", + "nullable": false + }, + { + "name": "connections", + "type": "json", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "settings", + "type": "json", + "nullable": true + }, + { + "name": "staticData", + "type": "json", + "nullable": true + }, + { + "name": "pinData", + "type": "json", + "nullable": true + }, + { + "name": "versionId", + "type": "character(36)", + "nullable": false + }, + { + "name": "triggerCount", + "type": "integer", + "nullable": false, + "default": "0" + }, + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "meta", + "type": "json", + "nullable": true + }, + { + "name": "parentFolderId", + "type": "varchar(36)", + "nullable": true, + "default": "NULL::character varying" + }, + { + "name": "isArchived", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "versionCounter", + "type": "integer", + "nullable": false, + "default": "1" + }, + { + "name": "description", + "type": "text", + "nullable": true + }, + { + "name": "activeVersionId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "nodeGroups", + "type": "json", + "nullable": false, + "default": "'[]'::json" + }, + { + "name": "sourceWorkflowId", + "type": "varchar", + "nullable": true + } + ], + "indexes": [ + { + "name": "pk_workflow_entity_id", + "def": "CREATE UNIQUE INDEX pk_workflow_entity_id ON public.workflow_entity USING btree (id)", + "table": "public.workflow_entity", + "columns": [ + "id" + ] + }, + { + "name": "workflow_entity_pkey", + "def": "CREATE UNIQUE INDEX workflow_entity_pkey ON public.workflow_entity USING btree (id)", + "table": "public.workflow_entity", + "columns": [ + "id" + ] + }, + { + "name": "IDX_workflow_entity_name", + "def": "CREATE INDEX \"IDX_workflow_entity_name\" ON public.workflow_entity USING btree (name)", + "table": "public.workflow_entity", + "columns": [ + "name" + ] + }, + { + "name": "IDX_workflow_entity_sourceWorkflowId", + "def": "CREATE INDEX \"IDX_workflow_entity_sourceWorkflowId\" ON public.workflow_entity USING btree (\"sourceWorkflowId\") WHERE (\"sourceWorkflowId\" IS NOT NULL)", + "table": "public.workflow_entity", + "columns": [ + "sourceWorkflowId" + ] + } + ], + "constraints": [ + { + "name": "workflow_entity_active_not_null", + "type": "n", + "def": "NOT NULL active", + "table": "public.workflow_entity", + "referenced_table": "", + "columns": [ + "active" + ] + }, + { + "name": "workflow_entity_connections_not_null", + "type": "n", + "def": "NOT NULL connections", + "table": "public.workflow_entity", + "referenced_table": "", + "columns": [ + "connections" + ] + }, + { + "name": "workflow_entity_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.workflow_entity", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "workflow_entity_id_not_null1", + "type": "n", + "def": "NOT NULL id", + "table": "public.workflow_entity", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "workflow_entity_isArchived_not_null", + "type": "n", + "def": "NOT NULL \"isArchived\"", + "table": "public.workflow_entity", + "referenced_table": "", + "columns": [ + "isArchived" + ] + }, + { + "name": "workflow_entity_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.workflow_entity", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "workflow_entity_nodeGroups_not_null", + "type": "n", + "def": "NOT NULL \"nodeGroups\"", + "table": "public.workflow_entity", + "referenced_table": "", + "columns": [ + "nodeGroups" + ] + }, + { + "name": "workflow_entity_nodes_not_null", + "type": "n", + "def": "NOT NULL nodes", + "table": "public.workflow_entity", + "referenced_table": "", + "columns": [ + "nodes" + ] + }, + { + "name": "workflow_entity_triggerCount_not_null", + "type": "n", + "def": "NOT NULL \"triggerCount\"", + "table": "public.workflow_entity", + "referenced_table": "", + "columns": [ + "triggerCount" + ] + }, + { + "name": "workflow_entity_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.workflow_entity", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "workflow_entity_versionCounter_not_null", + "type": "n", + "def": "NOT NULL \"versionCounter\"", + "table": "public.workflow_entity", + "referenced_table": "", + "columns": [ + "versionCounter" + ] + }, + { + "name": "workflow_entity_versionId_not_null", + "type": "n", + "def": "NOT NULL \"versionId\"", + "table": "public.workflow_entity", + "referenced_table": "", + "columns": [ + "versionId" + ] + }, + { + "name": "workflow_entity_pkey", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.workflow_entity", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "FK_08d6c67b7f722b0039d9d5ed620", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"activeVersionId\") REFERENCES workflow_history(\"versionId\") ON DELETE RESTRICT", + "table": "public.workflow_entity", + "referenced_table": "public.workflow_history", + "columns": [ + "activeVersionId" + ], + "referenced_columns": [ + "versionId" + ] + }, + { + "name": "fk_workflow_parent_folder", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"parentFolderId\") REFERENCES folder(id) ON DELETE CASCADE", + "table": "public.workflow_entity", + "referenced_table": "public.folder", + "columns": [ + "parentFolderId" + ], + "referenced_columns": [ + "id" + ] + } + ], + "triggers": [ + { + "name": "workflow_version_increment", + "def": "CREATE TRIGGER workflow_version_increment BEFORE UPDATE ON public.workflow_entity FOR EACH ROW EXECUTE FUNCTION increment_workflow_version()" + } + ] + }, + { + "name": "public.webhook_entity", + "type": "BASE TABLE", + "columns": [ + { + "name": "webhookPath", + "type": "varchar", + "nullable": false + }, + { + "name": "method", + "type": "varchar", + "nullable": false + }, + { + "name": "node", + "type": "varchar", + "nullable": false + }, + { + "name": "webhookId", + "type": "varchar", + "nullable": true + }, + { + "name": "pathLength", + "type": "integer", + "nullable": true + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + } + ], + "indexes": [ + { + "name": "PK_b21ace2e13596ccd87dc9bf4ea6", + "def": "CREATE UNIQUE INDEX \"PK_b21ace2e13596ccd87dc9bf4ea6\" ON public.webhook_entity USING btree (\"webhookPath\", method)", + "table": "public.webhook_entity", + "columns": [ + "webhookPath", + "method" + ] + }, + { + "name": "idx_16f4436789e804e3e1c9eeb240", + "def": "CREATE INDEX idx_16f4436789e804e3e1c9eeb240 ON public.webhook_entity USING btree (\"webhookId\", method, \"pathLength\")", + "table": "public.webhook_entity", + "columns": [ + "webhookId", + "method", + "pathLength" + ] + } + ], + "constraints": [ + { + "name": "webhook_entity_method_not_null", + "type": "n", + "def": "NOT NULL method", + "table": "public.webhook_entity", + "referenced_table": "", + "columns": [ + "method" + ] + }, + { + "name": "webhook_entity_node_not_null", + "type": "n", + "def": "NOT NULL node", + "table": "public.webhook_entity", + "referenced_table": "", + "columns": [ + "node" + ] + }, + { + "name": "webhook_entity_webhookPath_not_null", + "type": "n", + "def": "NOT NULL \"webhookPath\"", + "table": "public.webhook_entity", + "referenced_table": "", + "columns": [ + "webhookPath" + ] + }, + { + "name": "webhook_entity_workflowId_not_null1", + "type": "n", + "def": "NOT NULL \"workflowId\"", + "table": "public.webhook_entity", + "referenced_table": "", + "columns": [ + "workflowId" + ] + }, + { + "name": "PK_b21ace2e13596ccd87dc9bf4ea6", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"webhookPath\", method)", + "table": "public.webhook_entity", + "referenced_table": "", + "columns": [ + "webhookPath", + "method" + ] + }, + { + "name": "fk_webhook_entity_workflow_id", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE", + "table": "public.webhook_entity", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + } + ] + }, + { + "name": "public.tag_entity", + "type": "BASE TABLE", + "columns": [ + { + "name": "name", + "type": "varchar(24)", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "id", + "type": "varchar(36)", + "nullable": false + } + ], + "indexes": [ + { + "name": "idx_812eb05f7451ca757fb98444ce", + "def": "CREATE UNIQUE INDEX idx_812eb05f7451ca757fb98444ce ON public.tag_entity USING btree (name)", + "table": "public.tag_entity", + "columns": [ + "name" + ] + }, + { + "name": "pk_tag_entity_id", + "def": "CREATE UNIQUE INDEX pk_tag_entity_id ON public.tag_entity USING btree (id)", + "table": "public.tag_entity", + "columns": [ + "id" + ] + }, + { + "name": "tag_entity_pkey", + "def": "CREATE UNIQUE INDEX tag_entity_pkey ON public.tag_entity USING btree (id)", + "table": "public.tag_entity", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "tag_entity_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.tag_entity", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "tag_entity_id_not_null1", + "type": "n", + "def": "NOT NULL id", + "table": "public.tag_entity", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "tag_entity_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.tag_entity", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "tag_entity_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.tag_entity", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "tag_entity_pkey", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.tag_entity", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.workflows_tags", + "type": "BASE TABLE", + "columns": [ + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "tagId", + "type": "varchar(36)", + "nullable": false + } + ], + "indexes": [ + { + "name": "pk_workflows_tags", + "def": "CREATE UNIQUE INDEX pk_workflows_tags ON public.workflows_tags USING btree (\"workflowId\", \"tagId\")", + "table": "public.workflows_tags", + "columns": [ + "workflowId", + "tagId" + ] + }, + { + "name": "idx_workflows_tags_workflow_id", + "def": "CREATE INDEX idx_workflows_tags_workflow_id ON public.workflows_tags USING btree (\"workflowId\")", + "table": "public.workflows_tags", + "columns": [ + "workflowId" + ] + } + ], + "constraints": [ + { + "name": "workflows_tags_tagId_not_null1", + "type": "n", + "def": "NOT NULL \"tagId\"", + "table": "public.workflows_tags", + "referenced_table": "", + "columns": [ + "tagId" + ] + }, + { + "name": "workflows_tags_workflowId_not_null1", + "type": "n", + "def": "NOT NULL \"workflowId\"", + "table": "public.workflows_tags", + "referenced_table": "", + "columns": [ + "workflowId" + ] + }, + { + "name": "fk_workflows_tags_workflow_id", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE", + "table": "public.workflows_tags", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "fk_workflows_tags_tag_id", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"tagId\") REFERENCES tag_entity(id) ON DELETE CASCADE", + "table": "public.workflows_tags", + "referenced_table": "public.tag_entity", + "columns": [ + "tagId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "pk_workflows_tags", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"workflowId\", \"tagId\")", + "table": "public.workflows_tags", + "referenced_table": "", + "columns": [ + "workflowId", + "tagId" + ] + } + ] + }, + { + "name": "public.user", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "uuid", + "nullable": false, + "default": "gen_random_uuid()" + }, + { + "name": "email", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "firstName", + "type": "varchar(32)", + "nullable": true + }, + { + "name": "lastName", + "type": "varchar(32)", + "nullable": true + }, + { + "name": "password", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "personalizationAnswers", + "type": "json", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "settings", + "type": "json", + "nullable": true + }, + { + "name": "disabled", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "mfaEnabled", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "mfaSecret", + "type": "text", + "nullable": true + }, + { + "name": "mfaRecoveryCodes", + "type": "text", + "nullable": true + }, + { + "name": "lastActiveAt", + "type": "date", + "nullable": true + }, + { + "name": "roleSlug", + "type": "varchar(128)", + "nullable": false, + "default": "'global:member'::character varying" + } + ], + "indexes": [ + { + "name": "PK_ea8f538c94b6e352418254ed6474a81f", + "def": "CREATE UNIQUE INDEX \"PK_ea8f538c94b6e352418254ed6474a81f\" ON public.\"user\" USING btree (id)", + "table": "public.user", + "columns": [ + "id" + ] + }, + { + "name": "UQ_e12875dfb3b1d92d7d7c5377e2", + "def": "CREATE UNIQUE INDEX \"UQ_e12875dfb3b1d92d7d7c5377e2\" ON public.\"user\" USING btree (email)", + "table": "public.user", + "columns": [ + "email" + ] + }, + { + "name": "user_role_idx", + "def": "CREATE INDEX user_role_idx ON public.\"user\" USING btree (\"roleSlug\")", + "table": "public.user", + "columns": [ + "roleSlug" + ] + } + ], + "constraints": [ + { + "name": "user_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.user", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "user_disabled_not_null", + "type": "n", + "def": "NOT NULL disabled", + "table": "public.user", + "referenced_table": "", + "columns": [ + "disabled" + ] + }, + { + "name": "user_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.user", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "user_mfaEnabled_not_null", + "type": "n", + "def": "NOT NULL \"mfaEnabled\"", + "table": "public.user", + "referenced_table": "", + "columns": [ + "mfaEnabled" + ] + }, + { + "name": "user_roleSlug_not_null", + "type": "n", + "def": "NOT NULL \"roleSlug\"", + "table": "public.user", + "referenced_table": "", + "columns": [ + "roleSlug" + ] + }, + { + "name": "user_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.user", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "PK_ea8f538c94b6e352418254ed6474a81f", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.user", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "UQ_e12875dfb3b1d92d7d7c5377e2", + "type": "UNIQUE", + "def": "UNIQUE (email)", + "table": "public.user", + "referenced_table": "", + "columns": [ + "email" + ] + }, + { + "name": "FK_eaea92ee7bfb9c1b6cd01505d56", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"roleSlug\") REFERENCES role(slug)", + "table": "public.user", + "referenced_table": "public.role", + "columns": [ + "roleSlug" + ], + "referenced_columns": [ + "slug" + ] + } + ] + }, + { + "name": "public.settings", + "type": "BASE TABLE", + "columns": [ + { + "name": "key", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "value", + "type": "text", + "nullable": false + }, + { + "name": "loadOnStartup", + "type": "boolean", + "nullable": false, + "default": "false" + } + ], + "indexes": [ + { + "name": "PK_dc0fe14e6d9943f268e7b119f69ab8bd", + "def": "CREATE UNIQUE INDEX \"PK_dc0fe14e6d9943f268e7b119f69ab8bd\" ON public.settings USING btree (key)", + "table": "public.settings", + "columns": [ + "key" + ] + } + ], + "constraints": [ + { + "name": "settings_key_not_null", + "type": "n", + "def": "NOT NULL key", + "table": "public.settings", + "referenced_table": "", + "columns": [ + "key" + ] + }, + { + "name": "settings_loadOnStartup_not_null", + "type": "n", + "def": "NOT NULL \"loadOnStartup\"", + "table": "public.settings", + "referenced_table": "", + "columns": [ + "loadOnStartup" + ] + }, + { + "name": "settings_value_not_null", + "type": "n", + "def": "NOT NULL value", + "table": "public.settings", + "referenced_table": "", + "columns": [ + "value" + ] + }, + { + "name": "PK_dc0fe14e6d9943f268e7b119f69ab8bd", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (key)", + "table": "public.settings", + "referenced_table": "", + "columns": [ + "key" + ] + } + ] + }, + { + "name": "public.installed_packages", + "type": "BASE TABLE", + "columns": [ + { + "name": "packageName", + "type": "varchar(214)", + "nullable": false + }, + { + "name": "installedVersion", + "type": "varchar(50)", + "nullable": false + }, + { + "name": "authorName", + "type": "varchar(70)", + "nullable": true + }, + { + "name": "authorEmail", + "type": "varchar(70)", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_08cc9197c39b028c1e9beca225940576fd1a5804", + "def": "CREATE UNIQUE INDEX \"PK_08cc9197c39b028c1e9beca225940576fd1a5804\" ON public.installed_packages USING btree (\"packageName\")", + "table": "public.installed_packages", + "columns": [ + "packageName" + ] + } + ], + "constraints": [ + { + "name": "installed_packages_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.installed_packages", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "installed_packages_installedVersion_not_null", + "type": "n", + "def": "NOT NULL \"installedVersion\"", + "table": "public.installed_packages", + "referenced_table": "", + "columns": [ + "installedVersion" + ] + }, + { + "name": "installed_packages_packageName_not_null", + "type": "n", + "def": "NOT NULL \"packageName\"", + "table": "public.installed_packages", + "referenced_table": "", + "columns": [ + "packageName" + ] + }, + { + "name": "installed_packages_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.installed_packages", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "PK_08cc9197c39b028c1e9beca225940576fd1a5804", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"packageName\")", + "table": "public.installed_packages", + "referenced_table": "", + "columns": [ + "packageName" + ] + } + ] + }, + { + "name": "public.installed_nodes", + "type": "BASE TABLE", + "columns": [ + { + "name": "name", + "type": "varchar(200)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(200)", + "nullable": false + }, + { + "name": "latestVersion", + "type": "integer", + "nullable": false, + "default": "1" + }, + { + "name": "package", + "type": "varchar(241)", + "nullable": false + } + ], + "indexes": [ + { + "name": "PK_8ebd28194e4f792f96b5933423fc439df97d9689", + "def": "CREATE UNIQUE INDEX \"PK_8ebd28194e4f792f96b5933423fc439df97d9689\" ON public.installed_nodes USING btree (name)", + "table": "public.installed_nodes", + "columns": [ + "name" + ] + } + ], + "constraints": [ + { + "name": "installed_nodes_latestVersion_not_null", + "type": "n", + "def": "NOT NULL \"latestVersion\"", + "table": "public.installed_nodes", + "referenced_table": "", + "columns": [ + "latestVersion" + ] + }, + { + "name": "installed_nodes_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.installed_nodes", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "installed_nodes_package_not_null", + "type": "n", + "def": "NOT NULL package", + "table": "public.installed_nodes", + "referenced_table": "", + "columns": [ + "package" + ] + }, + { + "name": "installed_nodes_type_not_null", + "type": "n", + "def": "NOT NULL type", + "table": "public.installed_nodes", + "referenced_table": "", + "columns": [ + "type" + ] + }, + { + "name": "FK_73f857fc5dce682cef8a99c11dbddbc969618951", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (package) REFERENCES installed_packages(\"packageName\") ON UPDATE CASCADE ON DELETE CASCADE", + "table": "public.installed_nodes", + "referenced_table": "public.installed_packages", + "columns": [ + "package" + ], + "referenced_columns": [ + "packageName" + ] + }, + { + "name": "PK_8ebd28194e4f792f96b5933423fc439df97d9689", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (name)", + "table": "public.installed_nodes", + "referenced_table": "", + "columns": [ + "name" + ] + } + ] + }, + { + "name": "public.workflow_statistics", + "type": "BASE TABLE", + "columns": [ + { + "name": "count", + "type": "bigint", + "nullable": true, + "default": "0" + }, + { + "name": "latestEvent", + "type": "timestamp(3) with time zone", + "nullable": true + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "rootCount", + "type": "bigint", + "nullable": true, + "default": "0" + }, + { + "name": "id", + "type": "integer", + "nullable": false, + "default": "nextval('workflow_statistics_id_seq'::regclass)" + }, + { + "name": "workflowName", + "type": "varchar(128)", + "nullable": true + } + ], + "indexes": [ + { + "name": "workflow_statistics_pkey", + "def": "CREATE UNIQUE INDEX workflow_statistics_pkey ON public.workflow_statistics USING btree (id)", + "table": "public.workflow_statistics", + "columns": [ + "id" + ] + }, + { + "name": "IDX_workflow_statistics_workflow_name", + "def": "CREATE UNIQUE INDEX \"IDX_workflow_statistics_workflow_name\" ON public.workflow_statistics USING btree (\"workflowId\", name)", + "table": "public.workflow_statistics", + "columns": [ + "workflowId", + "name" + ] + } + ], + "constraints": [ + { + "name": "workflow_statistics_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.workflow_statistics", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "workflow_statistics_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.workflow_statistics", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "workflow_statistics_workflowId_not_null1", + "type": "n", + "def": "NOT NULL \"workflowId\"", + "table": "public.workflow_statistics", + "referenced_table": "", + "columns": [ + "workflowId" + ] + }, + { + "name": "workflow_statistics_pkey", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.workflow_statistics", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.event_destinations", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "uuid", + "nullable": false + }, + { + "name": "destination", + "type": "jsonb", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "event_destinations_pkey", + "def": "CREATE UNIQUE INDEX event_destinations_pkey ON public.event_destinations USING btree (id)", + "table": "public.event_destinations", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "event_destinations_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.event_destinations", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "event_destinations_destination_not_null", + "type": "n", + "def": "NOT NULL destination", + "table": "public.event_destinations", + "referenced_table": "", + "columns": [ + "destination" + ] + }, + { + "name": "event_destinations_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.event_destinations", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "event_destinations_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.event_destinations", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "event_destinations_pkey", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.event_destinations", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.auth_identity", + "type": "BASE TABLE", + "columns": [ + { + "name": "userId", + "type": "uuid", + "nullable": true + }, + { + "name": "providerId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "providerType", + "type": "varchar(32)", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "auth_identity_pkey", + "def": "CREATE UNIQUE INDEX auth_identity_pkey ON public.auth_identity USING btree (\"providerId\", \"providerType\")", + "table": "public.auth_identity", + "columns": [ + "providerId", + "providerType" + ] + } + ], + "constraints": [ + { + "name": "auth_identity_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.auth_identity", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "auth_identity_providerId_not_null", + "type": "n", + "def": "NOT NULL \"providerId\"", + "table": "public.auth_identity", + "referenced_table": "", + "columns": [ + "providerId" + ] + }, + { + "name": "auth_identity_providerType_not_null", + "type": "n", + "def": "NOT NULL \"providerType\"", + "table": "public.auth_identity", + "referenced_table": "", + "columns": [ + "providerType" + ] + }, + { + "name": "auth_identity_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.auth_identity", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "auth_identity_userId_fkey", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id)", + "table": "public.auth_identity", + "referenced_table": "public.user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "auth_identity_pkey", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"providerId\", \"providerType\")", + "table": "public.auth_identity", + "referenced_table": "", + "columns": [ + "providerId", + "providerType" + ] + } + ] + }, + { + "name": "public.auth_provider_sync_history", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "integer", + "nullable": false, + "default": "nextval('auth_provider_sync_history_id_seq'::regclass)" + }, + { + "name": "providerType", + "type": "varchar(32)", + "nullable": false + }, + { + "name": "runMode", + "type": "text", + "nullable": false + }, + { + "name": "status", + "type": "text", + "nullable": false + }, + { + "name": "startedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP" + }, + { + "name": "endedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP" + }, + { + "name": "scanned", + "type": "integer", + "nullable": false + }, + { + "name": "created", + "type": "integer", + "nullable": false + }, + { + "name": "updated", + "type": "integer", + "nullable": false + }, + { + "name": "disabled", + "type": "integer", + "nullable": false + }, + { + "name": "error", + "type": "text", + "nullable": true + } + ], + "indexes": [ + { + "name": "auth_provider_sync_history_pkey", + "def": "CREATE UNIQUE INDEX auth_provider_sync_history_pkey ON public.auth_provider_sync_history USING btree (id)", + "table": "public.auth_provider_sync_history", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "auth_provider_sync_history_created_not_null", + "type": "n", + "def": "NOT NULL created", + "table": "public.auth_provider_sync_history", + "referenced_table": "", + "columns": [ + "created" + ] + }, + { + "name": "auth_provider_sync_history_disabled_not_null", + "type": "n", + "def": "NOT NULL disabled", + "table": "public.auth_provider_sync_history", + "referenced_table": "", + "columns": [ + "disabled" + ] + }, + { + "name": "auth_provider_sync_history_endedAt_not_null", + "type": "n", + "def": "NOT NULL \"endedAt\"", + "table": "public.auth_provider_sync_history", + "referenced_table": "", + "columns": [ + "endedAt" + ] + }, + { + "name": "auth_provider_sync_history_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.auth_provider_sync_history", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "auth_provider_sync_history_providerType_not_null", + "type": "n", + "def": "NOT NULL \"providerType\"", + "table": "public.auth_provider_sync_history", + "referenced_table": "", + "columns": [ + "providerType" + ] + }, + { + "name": "auth_provider_sync_history_runMode_not_null", + "type": "n", + "def": "NOT NULL \"runMode\"", + "table": "public.auth_provider_sync_history", + "referenced_table": "", + "columns": [ + "runMode" + ] + }, + { + "name": "auth_provider_sync_history_scanned_not_null", + "type": "n", + "def": "NOT NULL scanned", + "table": "public.auth_provider_sync_history", + "referenced_table": "", + "columns": [ + "scanned" + ] + }, + { + "name": "auth_provider_sync_history_startedAt_not_null", + "type": "n", + "def": "NOT NULL \"startedAt\"", + "table": "public.auth_provider_sync_history", + "referenced_table": "", + "columns": [ + "startedAt" + ] + }, + { + "name": "auth_provider_sync_history_status_not_null", + "type": "n", + "def": "NOT NULL status", + "table": "public.auth_provider_sync_history", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "auth_provider_sync_history_updated_not_null", + "type": "n", + "def": "NOT NULL updated", + "table": "public.auth_provider_sync_history", + "referenced_table": "", + "columns": [ + "updated" + ] + }, + { + "name": "auth_provider_sync_history_pkey", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.auth_provider_sync_history", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.variables", + "type": "BASE TABLE", + "columns": [ + { + "name": "key", + "type": "varchar(50)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(50)", + "nullable": false, + "default": "'string'::character varying" + }, + { + "name": "value", + "type": "text", + "nullable": true + }, + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": true + } + ], + "indexes": [ + { + "name": "variables_pkey", + "def": "CREATE UNIQUE INDEX variables_pkey ON public.variables USING btree (id)", + "table": "public.variables", + "columns": [ + "id" + ] + }, + { + "name": "variables_project_key_unique", + "def": "CREATE UNIQUE INDEX variables_project_key_unique ON public.variables USING btree (\"projectId\", key) WHERE (\"projectId\" IS NOT NULL)", + "table": "public.variables", + "columns": [ + "projectId", + "key" + ] + }, + { + "name": "variables_global_key_unique", + "def": "CREATE UNIQUE INDEX variables_global_key_unique ON public.variables USING btree (key) WHERE (\"projectId\" IS NULL)", + "table": "public.variables", + "columns": [ + "key" + ] + } + ], + "constraints": [ + { + "name": "variables_id_not_null1", + "type": "n", + "def": "NOT NULL id", + "table": "public.variables", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "variables_key_not_null", + "type": "n", + "def": "NOT NULL key", + "table": "public.variables", + "referenced_table": "", + "columns": [ + "key" + ] + }, + { + "name": "variables_type_not_null", + "type": "n", + "def": "NOT NULL type", + "table": "public.variables", + "referenced_table": "", + "columns": [ + "type" + ] + }, + { + "name": "variables_value_max_len", + "type": "CHECK", + "def": "CHECK (((value IS NULL) OR (char_length(value) \u003c= 1000)))", + "table": "public.variables", + "referenced_table": "", + "columns": [ + "value" + ] + }, + { + "name": "variables_pkey", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.variables", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "FK_42f6c766f9f9d2edcc15bdd6e9b", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE", + "table": "public.variables", + "referenced_table": "public.project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + } + ] + }, + { + "name": "public.execution_data", + "type": "BASE TABLE", + "columns": [ + { + "name": "executionId", + "type": "integer", + "nullable": false + }, + { + "name": "workflowData", + "type": "json", + "nullable": false + }, + { + "name": "data", + "type": "text", + "nullable": false + }, + { + "name": "workflowVersionId", + "type": "varchar(36)", + "nullable": true + } + ], + "indexes": [ + { + "name": "execution_data_pkey", + "def": "CREATE UNIQUE INDEX execution_data_pkey ON public.execution_data USING btree (\"executionId\")", + "table": "public.execution_data", + "columns": [ + "executionId" + ] + } + ], + "constraints": [ + { + "name": "execution_data_data_not_null", + "type": "n", + "def": "NOT NULL data", + "table": "public.execution_data", + "referenced_table": "", + "columns": [ + "data" + ] + }, + { + "name": "execution_data_executionId_not_null", + "type": "n", + "def": "NOT NULL \"executionId\"", + "table": "public.execution_data", + "referenced_table": "", + "columns": [ + "executionId" + ] + }, + { + "name": "execution_data_workflowData_not_null", + "type": "n", + "def": "NOT NULL \"workflowData\"", + "table": "public.execution_data", + "referenced_table": "", + "columns": [ + "workflowData" + ] + }, + { + "name": "execution_data_fk", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"executionId\") REFERENCES execution_entity(id) ON DELETE CASCADE", + "table": "public.execution_data", + "referenced_table": "public.execution_entity", + "columns": [ + "executionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "execution_data_pkey", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"executionId\")", + "table": "public.execution_data", + "referenced_table": "", + "columns": [ + "executionId" + ] + } + ] + }, + { + "name": "public.workflow_history", + "type": "BASE TABLE", + "columns": [ + { + "name": "versionId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "authors", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "nodes", + "type": "json", + "nullable": false + }, + { + "name": "connections", + "type": "json", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": true + }, + { + "name": "autosaved", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "description", + "type": "text", + "nullable": true + }, + { + "name": "nodeGroups", + "type": "json", + "nullable": false, + "default": "'[]'::json" + } + ], + "indexes": [ + { + "name": "PK_b6572dd6173e4cd06fe79937b58", + "def": "CREATE UNIQUE INDEX \"PK_b6572dd6173e4cd06fe79937b58\" ON public.workflow_history USING btree (\"versionId\")", + "table": "public.workflow_history", + "columns": [ + "versionId" + ] + }, + { + "name": "IDX_1e31657f5fe46816c34be7c1b4", + "def": "CREATE INDEX \"IDX_1e31657f5fe46816c34be7c1b4\" ON public.workflow_history USING btree (\"workflowId\")", + "table": "public.workflow_history", + "columns": [ + "workflowId" + ] + } + ], + "constraints": [ + { + "name": "workflow_history_authors_not_null", + "type": "n", + "def": "NOT NULL authors", + "table": "public.workflow_history", + "referenced_table": "", + "columns": [ + "authors" + ] + }, + { + "name": "workflow_history_autosaved_not_null", + "type": "n", + "def": "NOT NULL autosaved", + "table": "public.workflow_history", + "referenced_table": "", + "columns": [ + "autosaved" + ] + }, + { + "name": "workflow_history_connections_not_null", + "type": "n", + "def": "NOT NULL connections", + "table": "public.workflow_history", + "referenced_table": "", + "columns": [ + "connections" + ] + }, + { + "name": "workflow_history_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.workflow_history", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "workflow_history_nodeGroups_not_null", + "type": "n", + "def": "NOT NULL \"nodeGroups\"", + "table": "public.workflow_history", + "referenced_table": "", + "columns": [ + "nodeGroups" + ] + }, + { + "name": "workflow_history_nodes_not_null", + "type": "n", + "def": "NOT NULL nodes", + "table": "public.workflow_history", + "referenced_table": "", + "columns": [ + "nodes" + ] + }, + { + "name": "workflow_history_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.workflow_history", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "workflow_history_versionId_not_null", + "type": "n", + "def": "NOT NULL \"versionId\"", + "table": "public.workflow_history", + "referenced_table": "", + "columns": [ + "versionId" + ] + }, + { + "name": "workflow_history_workflowId_not_null", + "type": "n", + "def": "NOT NULL \"workflowId\"", + "table": "public.workflow_history", + "referenced_table": "", + "columns": [ + "workflowId" + ] + }, + { + "name": "FK_1e31657f5fe46816c34be7c1b4b", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE", + "table": "public.workflow_history", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_b6572dd6173e4cd06fe79937b58", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"versionId\")", + "table": "public.workflow_history", + "referenced_table": "", + "columns": [ + "versionId" + ] + } + ] + }, + { + "name": "public.project", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "icon", + "type": "json", + "nullable": true + }, + { + "name": "description", + "type": "varchar(512)", + "nullable": true + }, + { + "name": "creatorId", + "type": "uuid", + "nullable": true, + "comment": "ID of the user who created the project" + }, + { + "name": "customTelemetryTags", + "type": "json", + "nullable": false, + "default": "'[]'::json" + } + ], + "indexes": [ + { + "name": "PK_4d68b1358bb5b766d3e78f32f57", + "def": "CREATE UNIQUE INDEX \"PK_4d68b1358bb5b766d3e78f32f57\" ON public.project USING btree (id)", + "table": "public.project", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "project_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.project", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "project_customTelemetryTags_not_null", + "type": "n", + "def": "NOT NULL \"customTelemetryTags\"", + "table": "public.project", + "referenced_table": "", + "columns": [ + "customTelemetryTags" + ] + }, + { + "name": "project_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.project", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "project_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.project", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "project_type_not_null", + "type": "n", + "def": "NOT NULL type", + "table": "public.project", + "referenced_table": "", + "columns": [ + "type" + ] + }, + { + "name": "project_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.project", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "projects_creatorId_foreign", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"creatorId\") REFERENCES \"user\"(id) ON DELETE SET NULL", + "table": "public.project", + "referenced_table": "public.user", + "columns": [ + "creatorId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_4d68b1358bb5b766d3e78f32f57", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.project", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.project_relation", + "type": "BASE TABLE", + "columns": [ + { + "name": "projectId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "userId", + "type": "uuid", + "nullable": false + }, + { + "name": "role", + "type": "varchar", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_1caaa312a5d7184a003be0f0cb6", + "def": "CREATE UNIQUE INDEX \"PK_1caaa312a5d7184a003be0f0cb6\" ON public.project_relation USING btree (\"projectId\", \"userId\")", + "table": "public.project_relation", + "columns": [ + "projectId", + "userId" + ] + }, + { + "name": "IDX_61448d56d61802b5dfde5cdb00", + "def": "CREATE INDEX \"IDX_61448d56d61802b5dfde5cdb00\" ON public.project_relation USING btree (\"projectId\")", + "table": "public.project_relation", + "columns": [ + "projectId" + ] + }, + { + "name": "IDX_5f0643f6717905a05164090dde", + "def": "CREATE INDEX \"IDX_5f0643f6717905a05164090dde\" ON public.project_relation USING btree (\"userId\")", + "table": "public.project_relation", + "columns": [ + "userId" + ] + }, + { + "name": "project_relation_role_idx", + "def": "CREATE INDEX project_relation_role_idx ON public.project_relation USING btree (role)", + "table": "public.project_relation", + "columns": [ + "role" + ] + }, + { + "name": "project_relation_role_project_idx", + "def": "CREATE INDEX project_relation_role_project_idx ON public.project_relation USING btree (\"projectId\", role)", + "table": "public.project_relation", + "columns": [ + "projectId", + "role" + ] + } + ], + "constraints": [ + { + "name": "project_relation_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.project_relation", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "project_relation_projectId_not_null", + "type": "n", + "def": "NOT NULL \"projectId\"", + "table": "public.project_relation", + "referenced_table": "", + "columns": [ + "projectId" + ] + }, + { + "name": "project_relation_role_not_null", + "type": "n", + "def": "NOT NULL role", + "table": "public.project_relation", + "referenced_table": "", + "columns": [ + "role" + ] + }, + { + "name": "project_relation_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.project_relation", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "project_relation_userId_not_null", + "type": "n", + "def": "NOT NULL \"userId\"", + "table": "public.project_relation", + "referenced_table": "", + "columns": [ + "userId" + ] + }, + { + "name": "FK_5f0643f6717905a05164090dde7", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE", + "table": "public.project_relation", + "referenced_table": "public.user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_61448d56d61802b5dfde5cdb002", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE", + "table": "public.project_relation", + "referenced_table": "public.project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_1caaa312a5d7184a003be0f0cb6", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"projectId\", \"userId\")", + "table": "public.project_relation", + "referenced_table": "", + "columns": [ + "projectId", + "userId" + ] + }, + { + "name": "FK_c6b99592dc96b0d836d7a21db91", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (role) REFERENCES role(slug)", + "table": "public.project_relation", + "referenced_table": "public.role", + "columns": [ + "role" + ], + "referenced_columns": [ + "slug" + ] + } + ] + }, + { + "name": "public.shared_credentials", + "type": "BASE TABLE", + "columns": [ + { + "name": "credentialsId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "role", + "type": "text", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_8ef3a59796a228913f251779cff", + "def": "CREATE UNIQUE INDEX \"PK_8ef3a59796a228913f251779cff\" ON public.shared_credentials USING btree (\"credentialsId\", \"projectId\")", + "table": "public.shared_credentials", + "columns": [ + "credentialsId", + "projectId" + ] + } + ], + "constraints": [ + { + "name": "shared_credentials_2_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.shared_credentials", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "shared_credentials_2_credentialsId_not_null", + "type": "n", + "def": "NOT NULL \"credentialsId\"", + "table": "public.shared_credentials", + "referenced_table": "", + "columns": [ + "credentialsId" + ] + }, + { + "name": "shared_credentials_2_projectId_not_null", + "type": "n", + "def": "NOT NULL \"projectId\"", + "table": "public.shared_credentials", + "referenced_table": "", + "columns": [ + "projectId" + ] + }, + { + "name": "shared_credentials_2_role_not_null", + "type": "n", + "def": "NOT NULL role", + "table": "public.shared_credentials", + "referenced_table": "", + "columns": [ + "role" + ] + }, + { + "name": "shared_credentials_2_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.shared_credentials", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_416f66fc846c7c442970c094ccf", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"credentialsId\") REFERENCES credentials_entity(id) ON DELETE CASCADE", + "table": "public.shared_credentials", + "referenced_table": "public.credentials_entity", + "columns": [ + "credentialsId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_812c2852270da1247756e77f5a4", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE", + "table": "public.shared_credentials", + "referenced_table": "public.project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_8ef3a59796a228913f251779cff", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"credentialsId\", \"projectId\")", + "table": "public.shared_credentials", + "referenced_table": "", + "columns": [ + "credentialsId", + "projectId" + ] + } + ] + }, + { + "name": "public.shared_workflow", + "type": "BASE TABLE", + "columns": [ + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "role", + "type": "text", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_5ba87620386b847201c9531c58f", + "def": "CREATE UNIQUE INDEX \"PK_5ba87620386b847201c9531c58f\" ON public.shared_workflow USING btree (\"workflowId\", \"projectId\")", + "table": "public.shared_workflow", + "columns": [ + "workflowId", + "projectId" + ] + }, + { + "name": "IDX_shared_workflow_projectId", + "def": "CREATE INDEX \"IDX_shared_workflow_projectId\" ON public.shared_workflow USING btree (\"projectId\")", + "table": "public.shared_workflow", + "columns": [ + "projectId" + ] + } + ], + "constraints": [ + { + "name": "shared_workflow_2_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.shared_workflow", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "shared_workflow_2_projectId_not_null", + "type": "n", + "def": "NOT NULL \"projectId\"", + "table": "public.shared_workflow", + "referenced_table": "", + "columns": [ + "projectId" + ] + }, + { + "name": "shared_workflow_2_role_not_null", + "type": "n", + "def": "NOT NULL role", + "table": "public.shared_workflow", + "referenced_table": "", + "columns": [ + "role" + ] + }, + { + "name": "shared_workflow_2_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.shared_workflow", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "shared_workflow_2_workflowId_not_null", + "type": "n", + "def": "NOT NULL \"workflowId\"", + "table": "public.shared_workflow", + "referenced_table": "", + "columns": [ + "workflowId" + ] + }, + { + "name": "FK_daa206a04983d47d0a9c34649ce", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE", + "table": "public.shared_workflow", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_a45ea5f27bcfdc21af9b4188560", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE", + "table": "public.shared_workflow", + "referenced_table": "public.project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_5ba87620386b847201c9531c58f", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"workflowId\", \"projectId\")", + "table": "public.shared_workflow", + "referenced_table": "", + "columns": [ + "workflowId", + "projectId" + ] + } + ] + }, + { + "name": "public.execution_metadata", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "integer", + "nullable": false, + "default": "nextval('execution_metadata_temp_id_seq'::regclass)" + }, + { + "name": "executionId", + "type": "integer", + "nullable": false + }, + { + "name": "key", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "value", + "type": "text", + "nullable": false + } + ], + "indexes": [ + { + "name": "PK_17a0b6284f8d626aae88e1c16e4", + "def": "CREATE UNIQUE INDEX \"PK_17a0b6284f8d626aae88e1c16e4\" ON public.execution_metadata USING btree (id)", + "table": "public.execution_metadata", + "columns": [ + "id" + ] + }, + { + "name": "IDX_cec8eea3bf49551482ccb4933e", + "def": "CREATE UNIQUE INDEX \"IDX_cec8eea3bf49551482ccb4933e\" ON public.execution_metadata USING btree (\"executionId\", key)", + "table": "public.execution_metadata", + "columns": [ + "executionId", + "key" + ] + } + ], + "constraints": [ + { + "name": "execution_metadata_temp_executionId_not_null", + "type": "n", + "def": "NOT NULL \"executionId\"", + "table": "public.execution_metadata", + "referenced_table": "", + "columns": [ + "executionId" + ] + }, + { + "name": "execution_metadata_temp_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.execution_metadata", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "execution_metadata_temp_key_not_null", + "type": "n", + "def": "NOT NULL key", + "table": "public.execution_metadata", + "referenced_table": "", + "columns": [ + "key" + ] + }, + { + "name": "execution_metadata_temp_value_not_null", + "type": "n", + "def": "NOT NULL value", + "table": "public.execution_metadata", + "referenced_table": "", + "columns": [ + "value" + ] + }, + { + "name": "FK_31d0b4c93fb85ced26f6005cda3", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"executionId\") REFERENCES execution_entity(id) ON DELETE CASCADE", + "table": "public.execution_metadata", + "referenced_table": "public.execution_entity", + "columns": [ + "executionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_17a0b6284f8d626aae88e1c16e4", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.execution_metadata", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.invalid_auth_token", + "type": "BASE TABLE", + "columns": [ + { + "name": "token", + "type": "varchar(512)", + "nullable": false + }, + { + "name": "expiresAt", + "type": "timestamp(3) with time zone", + "nullable": false + } + ], + "indexes": [ + { + "name": "PK_5779069b7235b256d91f7af1a15", + "def": "CREATE UNIQUE INDEX \"PK_5779069b7235b256d91f7af1a15\" ON public.invalid_auth_token USING btree (token)", + "table": "public.invalid_auth_token", + "columns": [ + "token" + ] + } + ], + "constraints": [ + { + "name": "invalid_auth_token_expiresAt_not_null", + "type": "n", + "def": "NOT NULL \"expiresAt\"", + "table": "public.invalid_auth_token", + "referenced_table": "", + "columns": [ + "expiresAt" + ] + }, + { + "name": "invalid_auth_token_token_not_null", + "type": "n", + "def": "NOT NULL token", + "table": "public.invalid_auth_token", + "referenced_table": "", + "columns": [ + "token" + ] + }, + { + "name": "PK_5779069b7235b256d91f7af1a15", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (token)", + "table": "public.invalid_auth_token", + "referenced_table": "", + "columns": [ + "token" + ] + } + ] + }, + { + "name": "public.execution_annotations", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "integer", + "nullable": false, + "default": "nextval('execution_annotations_id_seq'::regclass)" + }, + { + "name": "executionId", + "type": "integer", + "nullable": false + }, + { + "name": "vote", + "type": "varchar(6)", + "nullable": true + }, + { + "name": "note", + "type": "text", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_7afcf93ffa20c4252869a7c6a23", + "def": "CREATE UNIQUE INDEX \"PK_7afcf93ffa20c4252869a7c6a23\" ON public.execution_annotations USING btree (id)", + "table": "public.execution_annotations", + "columns": [ + "id" + ] + }, + { + "name": "IDX_97f863fa83c4786f1956508496", + "def": "CREATE UNIQUE INDEX \"IDX_97f863fa83c4786f1956508496\" ON public.execution_annotations USING btree (\"executionId\")", + "table": "public.execution_annotations", + "columns": [ + "executionId" + ] + } + ], + "constraints": [ + { + "name": "execution_annotations_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.execution_annotations", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "execution_annotations_executionId_not_null", + "type": "n", + "def": "NOT NULL \"executionId\"", + "table": "public.execution_annotations", + "referenced_table": "", + "columns": [ + "executionId" + ] + }, + { + "name": "execution_annotations_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.execution_annotations", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "execution_annotations_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.execution_annotations", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_97f863fa83c4786f19565084960", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"executionId\") REFERENCES execution_entity(id) ON DELETE CASCADE", + "table": "public.execution_annotations", + "referenced_table": "public.execution_entity", + "columns": [ + "executionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_7afcf93ffa20c4252869a7c6a23", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.execution_annotations", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.annotation_tag_entity", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(24)", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_69dfa041592c30bbc0d4b84aa00", + "def": "CREATE UNIQUE INDEX \"PK_69dfa041592c30bbc0d4b84aa00\" ON public.annotation_tag_entity USING btree (id)", + "table": "public.annotation_tag_entity", + "columns": [ + "id" + ] + }, + { + "name": "IDX_ae51b54c4bb430cf92f48b623f", + "def": "CREATE UNIQUE INDEX \"IDX_ae51b54c4bb430cf92f48b623f\" ON public.annotation_tag_entity USING btree (name)", + "table": "public.annotation_tag_entity", + "columns": [ + "name" + ] + } + ], + "constraints": [ + { + "name": "annotation_tag_entity_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.annotation_tag_entity", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "annotation_tag_entity_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.annotation_tag_entity", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "annotation_tag_entity_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.annotation_tag_entity", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "annotation_tag_entity_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.annotation_tag_entity", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "PK_69dfa041592c30bbc0d4b84aa00", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.annotation_tag_entity", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.execution_annotation_tags", + "type": "BASE TABLE", + "columns": [ + { + "name": "annotationId", + "type": "integer", + "nullable": false + }, + { + "name": "tagId", + "type": "varchar(24)", + "nullable": false + } + ], + "indexes": [ + { + "name": "PK_979ec03d31294cca484be65d11f", + "def": "CREATE UNIQUE INDEX \"PK_979ec03d31294cca484be65d11f\" ON public.execution_annotation_tags USING btree (\"annotationId\", \"tagId\")", + "table": "public.execution_annotation_tags", + "columns": [ + "annotationId", + "tagId" + ] + }, + { + "name": "IDX_a3697779b366e131b2bbdae297", + "def": "CREATE INDEX \"IDX_a3697779b366e131b2bbdae297\" ON public.execution_annotation_tags USING btree (\"tagId\")", + "table": "public.execution_annotation_tags", + "columns": [ + "tagId" + ] + }, + { + "name": "IDX_c1519757391996eb06064f0e7c", + "def": "CREATE INDEX \"IDX_c1519757391996eb06064f0e7c\" ON public.execution_annotation_tags USING btree (\"annotationId\")", + "table": "public.execution_annotation_tags", + "columns": [ + "annotationId" + ] + } + ], + "constraints": [ + { + "name": "execution_annotation_tags_annotationId_not_null", + "type": "n", + "def": "NOT NULL \"annotationId\"", + "table": "public.execution_annotation_tags", + "referenced_table": "", + "columns": [ + "annotationId" + ] + }, + { + "name": "execution_annotation_tags_tagId_not_null", + "type": "n", + "def": "NOT NULL \"tagId\"", + "table": "public.execution_annotation_tags", + "referenced_table": "", + "columns": [ + "tagId" + ] + }, + { + "name": "FK_c1519757391996eb06064f0e7c8", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"annotationId\") REFERENCES execution_annotations(id) ON DELETE CASCADE", + "table": "public.execution_annotation_tags", + "referenced_table": "public.execution_annotations", + "columns": [ + "annotationId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_a3697779b366e131b2bbdae2976", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"tagId\") REFERENCES annotation_tag_entity(id) ON DELETE CASCADE", + "table": "public.execution_annotation_tags", + "referenced_table": "public.annotation_tag_entity", + "columns": [ + "tagId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_979ec03d31294cca484be65d11f", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"annotationId\", \"tagId\")", + "table": "public.execution_annotation_tags", + "referenced_table": "", + "columns": [ + "annotationId", + "tagId" + ] + } + ] + }, + { + "name": "public.user_api_keys", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "userId", + "type": "uuid", + "nullable": false + }, + { + "name": "label", + "type": "varchar(100)", + "nullable": false + }, + { + "name": "apiKey", + "type": "varchar", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "scopes", + "type": "json", + "nullable": true + }, + { + "name": "audience", + "type": "varchar", + "nullable": false, + "default": "'public-api'::character varying" + }, + { + "name": "lastUsedAt", + "type": "timestamp(3) with time zone", + "nullable": true + } + ], + "indexes": [ + { + "name": "PK_978fa5caa3468f463dac9d92e69", + "def": "CREATE UNIQUE INDEX \"PK_978fa5caa3468f463dac9d92e69\" ON public.user_api_keys USING btree (id)", + "table": "public.user_api_keys", + "columns": [ + "id" + ] + }, + { + "name": "IDX_63d7bbae72c767cf162d459fcc", + "def": "CREATE UNIQUE INDEX \"IDX_63d7bbae72c767cf162d459fcc\" ON public.user_api_keys USING btree (\"userId\", label)", + "table": "public.user_api_keys", + "columns": [ + "userId", + "label" + ] + }, + { + "name": "IDX_1ef35bac35d20bdae979d917a3", + "def": "CREATE UNIQUE INDEX \"IDX_1ef35bac35d20bdae979d917a3\" ON public.user_api_keys USING btree (\"apiKey\")", + "table": "public.user_api_keys", + "columns": [ + "apiKey" + ] + } + ], + "constraints": [ + { + "name": "user_api_keys_apiKey_not_null", + "type": "n", + "def": "NOT NULL \"apiKey\"", + "table": "public.user_api_keys", + "referenced_table": "", + "columns": [ + "apiKey" + ] + }, + { + "name": "user_api_keys_audience_not_null", + "type": "n", + "def": "NOT NULL audience", + "table": "public.user_api_keys", + "referenced_table": "", + "columns": [ + "audience" + ] + }, + { + "name": "user_api_keys_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.user_api_keys", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "user_api_keys_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.user_api_keys", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "user_api_keys_label_not_null", + "type": "n", + "def": "NOT NULL label", + "table": "public.user_api_keys", + "referenced_table": "", + "columns": [ + "label" + ] + }, + { + "name": "user_api_keys_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.user_api_keys", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "user_api_keys_userId_not_null", + "type": "n", + "def": "NOT NULL \"userId\"", + "table": "public.user_api_keys", + "referenced_table": "", + "columns": [ + "userId" + ] + }, + { + "name": "FK_e131705cbbc8fb589889b02d457", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE", + "table": "public.user_api_keys", + "referenced_table": "public.user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_978fa5caa3468f463dac9d92e69", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.user_api_keys", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.processed_data", + "type": "BASE TABLE", + "columns": [ + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "context", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "value", + "type": "text", + "nullable": false + } + ], + "indexes": [ + { + "name": "PK_ca04b9d8dc72de268fe07a65773", + "def": "CREATE UNIQUE INDEX \"PK_ca04b9d8dc72de268fe07a65773\" ON public.processed_data USING btree (\"workflowId\", context)", + "table": "public.processed_data", + "columns": [ + "workflowId", + "context" + ] + } + ], + "constraints": [ + { + "name": "processed_data_context_not_null", + "type": "n", + "def": "NOT NULL context", + "table": "public.processed_data", + "referenced_table": "", + "columns": [ + "context" + ] + }, + { + "name": "processed_data_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.processed_data", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "processed_data_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.processed_data", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "processed_data_value_not_null", + "type": "n", + "def": "NOT NULL value", + "table": "public.processed_data", + "referenced_table": "", + "columns": [ + "value" + ] + }, + { + "name": "processed_data_workflowId_not_null", + "type": "n", + "def": "NOT NULL \"workflowId\"", + "table": "public.processed_data", + "referenced_table": "", + "columns": [ + "workflowId" + ] + }, + { + "name": "FK_06a69a7032c97a763c2c7599464", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE", + "table": "public.processed_data", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_ca04b9d8dc72de268fe07a65773", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"workflowId\", context)", + "table": "public.processed_data", + "referenced_table": "", + "columns": [ + "workflowId", + "context" + ] + } + ] + }, + { + "name": "public.folder", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "parentFolderId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_6278a41a706740c94c02e288df8", + "def": "CREATE UNIQUE INDEX \"PK_6278a41a706740c94c02e288df8\" ON public.folder USING btree (id)", + "table": "public.folder", + "columns": [ + "id" + ] + }, + { + "name": "IDX_14f68deffaf858465715995508", + "def": "CREATE UNIQUE INDEX \"IDX_14f68deffaf858465715995508\" ON public.folder USING btree (\"projectId\", id)", + "table": "public.folder", + "columns": [ + "projectId", + "id" + ] + } + ], + "constraints": [ + { + "name": "folder_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.folder", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "folder_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.folder", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "folder_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.folder", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "folder_projectId_not_null", + "type": "n", + "def": "NOT NULL \"projectId\"", + "table": "public.folder", + "referenced_table": "", + "columns": [ + "projectId" + ] + }, + { + "name": "folder_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.folder", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_a8260b0b36939c6247f385b8221", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE", + "table": "public.folder", + "referenced_table": "public.project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_804ea52f6729e3940498bd54d78", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"parentFolderId\") REFERENCES folder(id) ON DELETE CASCADE", + "table": "public.folder", + "referenced_table": "public.folder", + "columns": [ + "parentFolderId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_6278a41a706740c94c02e288df8", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.folder", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.folder_tag", + "type": "BASE TABLE", + "columns": [ + { + "name": "folderId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "tagId", + "type": "varchar(36)", + "nullable": false + } + ], + "indexes": [ + { + "name": "PK_27e4e00852f6b06a925a4d83a3e", + "def": "CREATE UNIQUE INDEX \"PK_27e4e00852f6b06a925a4d83a3e\" ON public.folder_tag USING btree (\"folderId\", \"tagId\")", + "table": "public.folder_tag", + "columns": [ + "folderId", + "tagId" + ] + } + ], + "constraints": [ + { + "name": "folder_tag_folderId_not_null", + "type": "n", + "def": "NOT NULL \"folderId\"", + "table": "public.folder_tag", + "referenced_table": "", + "columns": [ + "folderId" + ] + }, + { + "name": "folder_tag_tagId_not_null", + "type": "n", + "def": "NOT NULL \"tagId\"", + "table": "public.folder_tag", + "referenced_table": "", + "columns": [ + "tagId" + ] + }, + { + "name": "FK_dc88164176283de80af47621746", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"tagId\") REFERENCES tag_entity(id) ON DELETE CASCADE", + "table": "public.folder_tag", + "referenced_table": "public.tag_entity", + "columns": [ + "tagId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_94a60854e06f2897b2e0d39edba", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"folderId\") REFERENCES folder(id) ON DELETE CASCADE", + "table": "public.folder_tag", + "referenced_table": "public.folder", + "columns": [ + "folderId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_27e4e00852f6b06a925a4d83a3e", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"folderId\", \"tagId\")", + "table": "public.folder_tag", + "referenced_table": "", + "columns": [ + "folderId", + "tagId" + ] + } + ] + }, + { + "name": "public.insights_metadata", + "type": "BASE TABLE", + "columns": [ + { + "name": "metaId", + "type": "integer", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "workflowName", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "projectName", + "type": "varchar(255)", + "nullable": false + } + ], + "indexes": [ + { + "name": "PK_f448a94c35218b6208ce20cf5a1", + "def": "CREATE UNIQUE INDEX \"PK_f448a94c35218b6208ce20cf5a1\" ON public.insights_metadata USING btree (\"metaId\")", + "table": "public.insights_metadata", + "columns": [ + "metaId" + ] + }, + { + "name": "IDX_1d8ab99d5861c9388d2dc1cf73", + "def": "CREATE UNIQUE INDEX \"IDX_1d8ab99d5861c9388d2dc1cf73\" ON public.insights_metadata USING btree (\"workflowId\")", + "table": "public.insights_metadata", + "columns": [ + "workflowId" + ] + } + ], + "constraints": [ + { + "name": "insights_metadata_metaId_not_null", + "type": "n", + "def": "NOT NULL \"metaId\"", + "table": "public.insights_metadata", + "referenced_table": "", + "columns": [ + "metaId" + ] + }, + { + "name": "insights_metadata_projectName_not_null", + "type": "n", + "def": "NOT NULL \"projectName\"", + "table": "public.insights_metadata", + "referenced_table": "", + "columns": [ + "projectName" + ] + }, + { + "name": "insights_metadata_workflowName_not_null", + "type": "n", + "def": "NOT NULL \"workflowName\"", + "table": "public.insights_metadata", + "referenced_table": "", + "columns": [ + "workflowName" + ] + }, + { + "name": "FK_1d8ab99d5861c9388d2dc1cf733", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE SET NULL", + "table": "public.insights_metadata", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_2375a1eda085adb16b24615b69c", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE SET NULL", + "table": "public.insights_metadata", + "referenced_table": "public.project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_f448a94c35218b6208ce20cf5a1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"metaId\")", + "table": "public.insights_metadata", + "referenced_table": "", + "columns": [ + "metaId" + ] + } + ] + }, + { + "name": "public.insights_raw", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "integer", + "nullable": false + }, + { + "name": "metaId", + "type": "integer", + "nullable": false + }, + { + "name": "type", + "type": "integer", + "nullable": false, + "comment": "0: time_saved_minutes, 1: runtime_milliseconds, 2: success, 3: failure" + }, + { + "name": "value", + "type": "bigint", + "nullable": false + }, + { + "name": "timestamp", + "type": "timestamp(0) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP" + } + ], + "indexes": [ + { + "name": "PK_ec15125755151e3a7e00e00014f", + "def": "CREATE UNIQUE INDEX \"PK_ec15125755151e3a7e00e00014f\" ON public.insights_raw USING btree (id)", + "table": "public.insights_raw", + "columns": [ + "id" + ] + }, + { + "name": "IDX_insights_raw_timestamp_id", + "def": "CREATE INDEX \"IDX_insights_raw_timestamp_id\" ON public.insights_raw USING btree (\"timestamp\", id)", + "table": "public.insights_raw", + "columns": [ + "timestamp", + "id" + ] + } + ], + "constraints": [ + { + "name": "insights_raw_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.insights_raw", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "insights_raw_metaId_not_null", + "type": "n", + "def": "NOT NULL \"metaId\"", + "table": "public.insights_raw", + "referenced_table": "", + "columns": [ + "metaId" + ] + }, + { + "name": "insights_raw_timestamp_not_null", + "type": "n", + "def": "NOT NULL \"timestamp\"", + "table": "public.insights_raw", + "referenced_table": "", + "columns": [ + "timestamp" + ] + }, + { + "name": "insights_raw_type_not_null", + "type": "n", + "def": "NOT NULL type", + "table": "public.insights_raw", + "referenced_table": "", + "columns": [ + "type" + ] + }, + { + "name": "insights_raw_value_not_null", + "type": "n", + "def": "NOT NULL value", + "table": "public.insights_raw", + "referenced_table": "", + "columns": [ + "value" + ] + }, + { + "name": "FK_6e2e33741adef2a7c5d66befa4e", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"metaId\") REFERENCES insights_metadata(\"metaId\") ON DELETE CASCADE", + "table": "public.insights_raw", + "referenced_table": "public.insights_metadata", + "columns": [ + "metaId" + ], + "referenced_columns": [ + "metaId" + ] + }, + { + "name": "PK_ec15125755151e3a7e00e00014f", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.insights_raw", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.insights_by_period", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "integer", + "nullable": false + }, + { + "name": "metaId", + "type": "integer", + "nullable": false + }, + { + "name": "type", + "type": "integer", + "nullable": false, + "comment": "0: time_saved_minutes, 1: runtime_milliseconds, 2: success, 3: failure" + }, + { + "name": "value", + "type": "bigint", + "nullable": false + }, + { + "name": "periodUnit", + "type": "integer", + "nullable": false, + "comment": "0: hour, 1: day, 2: week" + }, + { + "name": "periodStart", + "type": "timestamp(0) with time zone", + "nullable": true, + "default": "CURRENT_TIMESTAMP" + } + ], + "indexes": [ + { + "name": "PK_b606942249b90cc39b0265f0575", + "def": "CREATE UNIQUE INDEX \"PK_b606942249b90cc39b0265f0575\" ON public.insights_by_period USING btree (id)", + "table": "public.insights_by_period", + "columns": [ + "id" + ] + }, + { + "name": "IDX_60b6a84299eeb3f671dfec7693", + "def": "CREATE UNIQUE INDEX \"IDX_60b6a84299eeb3f671dfec7693\" ON public.insights_by_period USING btree (\"periodStart\", type, \"periodUnit\", \"metaId\")", + "table": "public.insights_by_period", + "columns": [ + "periodStart", + "type", + "periodUnit", + "metaId" + ] + } + ], + "constraints": [ + { + "name": "insights_by_period_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.insights_by_period", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "insights_by_period_metaId_not_null", + "type": "n", + "def": "NOT NULL \"metaId\"", + "table": "public.insights_by_period", + "referenced_table": "", + "columns": [ + "metaId" + ] + }, + { + "name": "insights_by_period_periodUnit_not_null", + "type": "n", + "def": "NOT NULL \"periodUnit\"", + "table": "public.insights_by_period", + "referenced_table": "", + "columns": [ + "periodUnit" + ] + }, + { + "name": "insights_by_period_type_not_null", + "type": "n", + "def": "NOT NULL type", + "table": "public.insights_by_period", + "referenced_table": "", + "columns": [ + "type" + ] + }, + { + "name": "insights_by_period_value_not_null", + "type": "n", + "def": "NOT NULL value", + "table": "public.insights_by_period", + "referenced_table": "", + "columns": [ + "value" + ] + }, + { + "name": "FK_6414cfed98daabbfdd61a1cfbc0", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"metaId\") REFERENCES insights_metadata(\"metaId\") ON DELETE CASCADE", + "table": "public.insights_by_period", + "referenced_table": "public.insights_metadata", + "columns": [ + "metaId" + ], + "referenced_columns": [ + "metaId" + ] + }, + { + "name": "PK_b606942249b90cc39b0265f0575", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.insights_by_period", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.test_run", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "status", + "type": "varchar", + "nullable": false + }, + { + "name": "errorCode", + "type": "varchar", + "nullable": true + }, + { + "name": "errorDetails", + "type": "json", + "nullable": true + }, + { + "name": "runAt", + "type": "timestamp(3) with time zone", + "nullable": true + }, + { + "name": "completedAt", + "type": "timestamp(3) with time zone", + "nullable": true + }, + { + "name": "metrics", + "type": "json", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "runningInstanceId", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "cancelRequested", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "workflowVersionId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "evaluationConfigId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "evaluationConfigSnapshot", + "type": "jsonb", + "nullable": true + }, + { + "name": "collectionId", + "type": "varchar(36)", + "nullable": true + } + ], + "indexes": [ + { + "name": "PK_011c050f566e9db509a0fadb9b9", + "def": "CREATE UNIQUE INDEX \"PK_011c050f566e9db509a0fadb9b9\" ON public.test_run USING btree (id)", + "table": "public.test_run", + "columns": [ + "id" + ] + }, + { + "name": "IDX_d6870d3b6e4c185d33926f423c", + "def": "CREATE INDEX \"IDX_d6870d3b6e4c185d33926f423c\" ON public.test_run USING btree (\"workflowId\")", + "table": "public.test_run", + "columns": [ + "workflowId" + ] + }, + { + "name": "IDX_test_run_evaluationConfigId", + "def": "CREATE INDEX \"IDX_test_run_evaluationConfigId\" ON public.test_run USING btree (\"evaluationConfigId\")", + "table": "public.test_run", + "columns": [ + "evaluationConfigId" + ] + }, + { + "name": "IDX_test_run_collectionId", + "def": "CREATE INDEX \"IDX_test_run_collectionId\" ON public.test_run USING btree (\"collectionId\")", + "table": "public.test_run", + "columns": [ + "collectionId" + ] + } + ], + "constraints": [ + { + "name": "test_run_cancelRequested_not_null", + "type": "n", + "def": "NOT NULL \"cancelRequested\"", + "table": "public.test_run", + "referenced_table": "", + "columns": [ + "cancelRequested" + ] + }, + { + "name": "test_run_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.test_run", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "test_run_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.test_run", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "test_run_status_not_null", + "type": "n", + "def": "NOT NULL status", + "table": "public.test_run", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "test_run_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.test_run", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "test_run_workflowId_not_null", + "type": "n", + "def": "NOT NULL \"workflowId\"", + "table": "public.test_run", + "referenced_table": "", + "columns": [ + "workflowId" + ] + }, + { + "name": "FK_d6870d3b6e4c185d33926f423c8", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE", + "table": "public.test_run", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_011c050f566e9db509a0fadb9b9", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.test_run", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "FK_test_run_evaluation_config_id", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"evaluationConfigId\") REFERENCES evaluation_config(id) ON DELETE SET NULL", + "table": "public.test_run", + "referenced_table": "public.evaluation_config", + "columns": [ + "evaluationConfigId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_test_run_collection_id", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"collectionId\") REFERENCES evaluation_collection(id) ON DELETE SET NULL", + "table": "public.test_run", + "referenced_table": "public.evaluation_collection", + "columns": [ + "collectionId" + ], + "referenced_columns": [ + "id" + ] + } + ] + }, + { + "name": "public.test_case_execution", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "testRunId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "executionId", + "type": "integer", + "nullable": true + }, + { + "name": "status", + "type": "varchar", + "nullable": false + }, + { + "name": "runAt", + "type": "timestamp(3) with time zone", + "nullable": true + }, + { + "name": "completedAt", + "type": "timestamp(3) with time zone", + "nullable": true + }, + { + "name": "errorCode", + "type": "varchar", + "nullable": true + }, + { + "name": "errorDetails", + "type": "json", + "nullable": true + }, + { + "name": "metrics", + "type": "json", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "inputs", + "type": "json", + "nullable": true + }, + { + "name": "outputs", + "type": "json", + "nullable": true + }, + { + "name": "runIndex", + "type": "integer", + "nullable": true + } + ], + "indexes": [ + { + "name": "PK_90c121f77a78a6580e94b794bce", + "def": "CREATE UNIQUE INDEX \"PK_90c121f77a78a6580e94b794bce\" ON public.test_case_execution USING btree (id)", + "table": "public.test_case_execution", + "columns": [ + "id" + ] + }, + { + "name": "IDX_8e4b4774db42f1e6dda3452b2a", + "def": "CREATE INDEX \"IDX_8e4b4774db42f1e6dda3452b2a\" ON public.test_case_execution USING btree (\"testRunId\")", + "table": "public.test_case_execution", + "columns": [ + "testRunId" + ] + } + ], + "constraints": [ + { + "name": "test_case_execution_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.test_case_execution", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "test_case_execution_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.test_case_execution", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "test_case_execution_status_not_null", + "type": "n", + "def": "NOT NULL status", + "table": "public.test_case_execution", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "test_case_execution_testRunId_not_null", + "type": "n", + "def": "NOT NULL \"testRunId\"", + "table": "public.test_case_execution", + "referenced_table": "", + "columns": [ + "testRunId" + ] + }, + { + "name": "test_case_execution_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.test_case_execution", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_e48965fac35d0f5b9e7f51d8c44", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"executionId\") REFERENCES execution_entity(id) ON DELETE SET NULL", + "table": "public.test_case_execution", + "referenced_table": "public.execution_entity", + "columns": [ + "executionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_8e4b4774db42f1e6dda3452b2af", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"testRunId\") REFERENCES test_run(id) ON DELETE CASCADE", + "table": "public.test_case_execution", + "referenced_table": "public.test_run", + "columns": [ + "testRunId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_90c121f77a78a6580e94b794bce", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.test_case_execution", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.scope", + "type": "BASE TABLE", + "columns": [ + { + "name": "slug", + "type": "varchar(128)", + "nullable": false, + "comment": "Unique identifier of the scope for example: \"project:create\"" + }, + { + "name": "displayName", + "type": "text", + "nullable": true, + "comment": "Name used to display in the UI" + }, + { + "name": "description", + "type": "text", + "nullable": true, + "comment": "Text describing the scope in more detail of users" + } + ], + "indexes": [ + { + "name": "PK_bfc45df0481abd7f355d6187da1", + "def": "CREATE UNIQUE INDEX \"PK_bfc45df0481abd7f355d6187da1\" ON public.scope USING btree (slug)", + "table": "public.scope", + "columns": [ + "slug" + ] + } + ], + "constraints": [ + { + "name": "scope_slug_not_null", + "type": "n", + "def": "NOT NULL slug", + "table": "public.scope", + "referenced_table": "", + "columns": [ + "slug" + ] + }, + { + "name": "PK_bfc45df0481abd7f355d6187da1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (slug)", + "table": "public.scope", + "referenced_table": "", + "columns": [ + "slug" + ] + } + ] + }, + { + "name": "public.role", + "type": "BASE TABLE", + "columns": [ + { + "name": "slug", + "type": "varchar(128)", + "nullable": false, + "comment": "Unique identifier of the role for example: \"global:owner\"" + }, + { + "name": "displayName", + "type": "text", + "nullable": true, + "comment": "Name used to display in the UI" + }, + { + "name": "description", + "type": "text", + "nullable": true, + "comment": "Text describing the scope in more detail of users" + }, + { + "name": "roleType", + "type": "text", + "nullable": true, + "comment": "Type of the role, e.g., global, project, or workflow" + }, + { + "name": "systemRole", + "type": "boolean", + "nullable": false, + "default": "false", + "comment": "Indicates if the role is managed by the system and cannot be edited" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_35c9b140caaf6da09cfabb0d675", + "def": "CREATE UNIQUE INDEX \"PK_35c9b140caaf6da09cfabb0d675\" ON public.role USING btree (slug)", + "table": "public.role", + "columns": [ + "slug" + ] + }, + { + "name": "IDX_UniqueRoleDisplayName", + "def": "CREATE UNIQUE INDEX \"IDX_UniqueRoleDisplayName\" ON public.role USING btree (\"displayName\")", + "table": "public.role", + "columns": [ + "displayName" + ] + } + ], + "constraints": [ + { + "name": "role_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.role", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "role_slug_not_null", + "type": "n", + "def": "NOT NULL slug", + "table": "public.role", + "referenced_table": "", + "columns": [ + "slug" + ] + }, + { + "name": "role_systemRole_not_null", + "type": "n", + "def": "NOT NULL \"systemRole\"", + "table": "public.role", + "referenced_table": "", + "columns": [ + "systemRole" + ] + }, + { + "name": "role_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.role", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "PK_35c9b140caaf6da09cfabb0d675", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (slug)", + "table": "public.role", + "referenced_table": "", + "columns": [ + "slug" + ] + } + ] + }, + { + "name": "public.role_scope", + "type": "BASE TABLE", + "columns": [ + { + "name": "roleSlug", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "scopeSlug", + "type": "varchar(128)", + "nullable": false + } + ], + "indexes": [ + { + "name": "PK_role_scope", + "def": "CREATE UNIQUE INDEX \"PK_role_scope\" ON public.role_scope USING btree (\"roleSlug\", \"scopeSlug\")", + "table": "public.role_scope", + "columns": [ + "roleSlug", + "scopeSlug" + ] + }, + { + "name": "IDX_role_scope_scopeSlug", + "def": "CREATE INDEX \"IDX_role_scope_scopeSlug\" ON public.role_scope USING btree (\"scopeSlug\")", + "table": "public.role_scope", + "columns": [ + "scopeSlug" + ] + } + ], + "constraints": [ + { + "name": "role_scope_roleSlug_not_null", + "type": "n", + "def": "NOT NULL \"roleSlug\"", + "table": "public.role_scope", + "referenced_table": "", + "columns": [ + "roleSlug" + ] + }, + { + "name": "role_scope_scopeSlug_not_null", + "type": "n", + "def": "NOT NULL \"scopeSlug\"", + "table": "public.role_scope", + "referenced_table": "", + "columns": [ + "scopeSlug" + ] + }, + { + "name": "FK_scope", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"scopeSlug\") REFERENCES scope(slug) ON UPDATE CASCADE ON DELETE CASCADE", + "table": "public.role_scope", + "referenced_table": "public.scope", + "columns": [ + "scopeSlug" + ], + "referenced_columns": [ + "slug" + ] + }, + { + "name": "FK_role", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"roleSlug\") REFERENCES role(slug) ON UPDATE CASCADE ON DELETE CASCADE", + "table": "public.role_scope", + "referenced_table": "public.role", + "columns": [ + "roleSlug" + ], + "referenced_columns": [ + "slug" + ] + }, + { + "name": "PK_role_scope", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"roleSlug\", \"scopeSlug\")", + "table": "public.role_scope", + "referenced_table": "", + "columns": [ + "roleSlug", + "scopeSlug" + ] + } + ] + }, + { + "name": "public.data_table", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_e226d0001b9e6097cbfe70617cb", + "def": "CREATE UNIQUE INDEX \"PK_e226d0001b9e6097cbfe70617cb\" ON public.data_table USING btree (id)", + "table": "public.data_table", + "columns": [ + "id" + ] + }, + { + "name": "UQ_b23096ef747281ac944d28e8b0d", + "def": "CREATE UNIQUE INDEX \"UQ_b23096ef747281ac944d28e8b0d\" ON public.data_table USING btree (\"projectId\", name)", + "table": "public.data_table", + "columns": [ + "projectId", + "name" + ] + } + ], + "constraints": [ + { + "name": "data_table_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.data_table", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "data_table_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.data_table", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "data_table_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.data_table", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "data_table_projectId_not_null", + "type": "n", + "def": "NOT NULL \"projectId\"", + "table": "public.data_table", + "referenced_table": "", + "columns": [ + "projectId" + ] + }, + { + "name": "data_table_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.data_table", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_c2a794257dee48af7c9abf681de", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE", + "table": "public.data_table", + "referenced_table": "public.project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_e226d0001b9e6097cbfe70617cb", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.data_table", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "UQ_b23096ef747281ac944d28e8b0d", + "type": "UNIQUE", + "def": "UNIQUE (\"projectId\", name)", + "table": "public.data_table", + "referenced_table": "", + "columns": [ + "projectId", + "name" + ] + } + ] + }, + { + "name": "public.data_table_column", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(32)", + "nullable": false, + "comment": "Expected: string, number, boolean, or date (not enforced as a constraint)" + }, + { + "name": "index", + "type": "integer", + "nullable": false, + "comment": "Column order, starting from 0 (0 = first column)" + }, + { + "name": "dataTableId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_673cb121ee4a8a5e27850c72c51", + "def": "CREATE UNIQUE INDEX \"PK_673cb121ee4a8a5e27850c72c51\" ON public.data_table_column USING btree (id)", + "table": "public.data_table_column", + "columns": [ + "id" + ] + }, + { + "name": "UQ_8082ec4890f892f0bc77473a123", + "def": "CREATE UNIQUE INDEX \"UQ_8082ec4890f892f0bc77473a123\" ON public.data_table_column USING btree (\"dataTableId\", name)", + "table": "public.data_table_column", + "columns": [ + "dataTableId", + "name" + ] + } + ], + "constraints": [ + { + "name": "data_table_column_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.data_table_column", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "data_table_column_dataTableId_not_null", + "type": "n", + "def": "NOT NULL \"dataTableId\"", + "table": "public.data_table_column", + "referenced_table": "", + "columns": [ + "dataTableId" + ] + }, + { + "name": "data_table_column_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.data_table_column", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "data_table_column_index_not_null", + "type": "n", + "def": "NOT NULL index", + "table": "public.data_table_column", + "referenced_table": "", + "columns": [ + "index" + ] + }, + { + "name": "data_table_column_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.data_table_column", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "data_table_column_type_not_null", + "type": "n", + "def": "NOT NULL type", + "table": "public.data_table_column", + "referenced_table": "", + "columns": [ + "type" + ] + }, + { + "name": "data_table_column_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.data_table_column", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_930b6e8faaf88294cef23484160", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"dataTableId\") REFERENCES data_table(id) ON DELETE CASCADE", + "table": "public.data_table_column", + "referenced_table": "public.data_table", + "columns": [ + "dataTableId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_673cb121ee4a8a5e27850c72c51", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.data_table_column", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "UQ_8082ec4890f892f0bc77473a123", + "type": "UNIQUE", + "def": "UNIQUE (\"dataTableId\", name)", + "table": "public.data_table_column", + "referenced_table": "", + "columns": [ + "dataTableId", + "name" + ] + } + ] + }, + { + "name": "public.chat_hub_sessions", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "uuid", + "nullable": false + }, + { + "name": "title", + "type": "varchar(256)", + "nullable": false + }, + { + "name": "ownerId", + "type": "uuid", + "nullable": false + }, + { + "name": "lastMessageAt", + "type": "timestamp(3) with time zone", + "nullable": false + }, + { + "name": "credentialId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "provider", + "type": "varchar(16)", + "nullable": true, + "comment": "ChatHubProvider enum: \"openai\", \"anthropic\", \"google\", \"n8n\"" + }, + { + "name": "model", + "type": "varchar(256)", + "nullable": true, + "comment": "Model name used at the respective Model node, ie. \"gpt-4\"" + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "agentId", + "type": "uuid", + "nullable": true, + "comment": "ID of the custom agent (if provider is \"custom-agent\")" + }, + { + "name": "agentName", + "type": "varchar(128)", + "nullable": true, + "comment": "Cached name of the custom agent (if provider is \"custom-agent\")" + }, + { + "name": "type", + "type": "varchar(16)", + "nullable": false, + "default": "'production'::character varying" + } + ], + "indexes": [ + { + "name": "PK_1eafef1273c70e4464fec703412", + "def": "CREATE UNIQUE INDEX \"PK_1eafef1273c70e4464fec703412\" ON public.chat_hub_sessions USING btree (id)", + "table": "public.chat_hub_sessions", + "columns": [ + "id" + ] + }, + { + "name": "IDX_chat_hub_sessions_owner_lastmsg_id", + "def": "CREATE INDEX \"IDX_chat_hub_sessions_owner_lastmsg_id\" ON public.chat_hub_sessions USING btree (\"ownerId\", \"lastMessageAt\" DESC, id)", + "table": "public.chat_hub_sessions", + "columns": [ + "ownerId", + "lastMessageAt", + "id" + ] + } + ], + "constraints": [ + { + "name": "CHK_chat_hub_sessions_type", + "type": "CHECK", + "def": "CHECK (((type)::text = ANY ((ARRAY['production'::character varying, 'manual'::character varying])::text[])))", + "table": "public.chat_hub_sessions", + "referenced_table": "", + "columns": [ + "type" + ] + }, + { + "name": "chat_hub_sessions_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.chat_hub_sessions", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "chat_hub_sessions_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.chat_hub_sessions", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "chat_hub_sessions_lastMessageAt_not_null", + "type": "n", + "def": "NOT NULL \"lastMessageAt\"", + "table": "public.chat_hub_sessions", + "referenced_table": "", + "columns": [ + "lastMessageAt" + ] + }, + { + "name": "chat_hub_sessions_ownerId_not_null", + "type": "n", + "def": "NOT NULL \"ownerId\"", + "table": "public.chat_hub_sessions", + "referenced_table": "", + "columns": [ + "ownerId" + ] + }, + { + "name": "chat_hub_sessions_title_not_null", + "type": "n", + "def": "NOT NULL title", + "table": "public.chat_hub_sessions", + "referenced_table": "", + "columns": [ + "title" + ] + }, + { + "name": "chat_hub_sessions_type_not_null", + "type": "n", + "def": "NOT NULL type", + "table": "public.chat_hub_sessions", + "referenced_table": "", + "columns": [ + "type" + ] + }, + { + "name": "chat_hub_sessions_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.chat_hub_sessions", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_e9ecf8ede7d989fcd18790fe36a", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"ownerId\") REFERENCES \"user\"(id) ON DELETE CASCADE", + "table": "public.chat_hub_sessions", + "referenced_table": "public.user", + "columns": [ + "ownerId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_9f9293d9f552496c40e0d1a8f80", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE SET NULL", + "table": "public.chat_hub_sessions", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_7bc13b4c7e6afbfaf9be326c189", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"credentialId\") REFERENCES credentials_entity(id) ON DELETE SET NULL", + "table": "public.chat_hub_sessions", + "referenced_table": "public.credentials_entity", + "columns": [ + "credentialId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_1eafef1273c70e4464fec703412", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.chat_hub_sessions", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "FK_chat_hub_sessions_agentId", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"agentId\") REFERENCES chat_hub_agents(id) ON DELETE SET NULL", + "table": "public.chat_hub_sessions", + "referenced_table": "public.chat_hub_agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + } + ] + }, + { + "name": "public.chat_hub_messages", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "uuid", + "nullable": false + }, + { + "name": "sessionId", + "type": "uuid", + "nullable": false + }, + { + "name": "previousMessageId", + "type": "uuid", + "nullable": true + }, + { + "name": "revisionOfMessageId", + "type": "uuid", + "nullable": true + }, + { + "name": "retryOfMessageId", + "type": "uuid", + "nullable": true + }, + { + "name": "type", + "type": "varchar(16)", + "nullable": false, + "comment": "ChatHubMessageType enum: \"human\", \"ai\", \"system\", \"tool\", \"generic\"" + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "content", + "type": "text", + "nullable": false + }, + { + "name": "provider", + "type": "varchar(16)", + "nullable": true, + "comment": "ChatHubProvider enum: \"openai\", \"anthropic\", \"google\", \"n8n\"" + }, + { + "name": "model", + "type": "varchar(256)", + "nullable": true, + "comment": "Model name used at the respective Model node, ie. \"gpt-4\"" + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "executionId", + "type": "integer", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "agentId", + "type": "uuid", + "nullable": true, + "comment": "ID of the custom agent (if provider is \"custom-agent\")" + }, + { + "name": "status", + "type": "varchar(16)", + "nullable": false, + "default": "'success'::character varying", + "comment": "ChatHubMessageStatus enum, eg. \"success\", \"error\", \"running\", \"cancelled\"" + }, + { + "name": "attachments", + "type": "json", + "nullable": true, + "comment": "File attachments for the message (if any), stored as JSON. Files are stored as base64-encoded data URLs." + } + ], + "indexes": [ + { + "name": "PK_7704a5add6baed43eef835f0bfb", + "def": "CREATE UNIQUE INDEX \"PK_7704a5add6baed43eef835f0bfb\" ON public.chat_hub_messages USING btree (id)", + "table": "public.chat_hub_messages", + "columns": [ + "id" + ] + }, + { + "name": "IDX_chat_hub_messages_sessionId", + "def": "CREATE INDEX \"IDX_chat_hub_messages_sessionId\" ON public.chat_hub_messages USING btree (\"sessionId\")", + "table": "public.chat_hub_messages", + "columns": [ + "sessionId" + ] + } + ], + "constraints": [ + { + "name": "chat_hub_messages_content_not_null", + "type": "n", + "def": "NOT NULL content", + "table": "public.chat_hub_messages", + "referenced_table": "", + "columns": [ + "content" + ] + }, + { + "name": "chat_hub_messages_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.chat_hub_messages", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "chat_hub_messages_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.chat_hub_messages", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "chat_hub_messages_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.chat_hub_messages", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "chat_hub_messages_sessionId_not_null", + "type": "n", + "def": "NOT NULL \"sessionId\"", + "table": "public.chat_hub_messages", + "referenced_table": "", + "columns": [ + "sessionId" + ] + }, + { + "name": "chat_hub_messages_status_not_null", + "type": "n", + "def": "NOT NULL status", + "table": "public.chat_hub_messages", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "chat_hub_messages_type_not_null", + "type": "n", + "def": "NOT NULL type", + "table": "public.chat_hub_messages", + "referenced_table": "", + "columns": [ + "type" + ] + }, + { + "name": "chat_hub_messages_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.chat_hub_messages", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_6afb260449dd7a9b85355d4e0c9", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"executionId\") REFERENCES execution_entity(id) ON DELETE SET NULL", + "table": "public.chat_hub_messages", + "referenced_table": "public.execution_entity", + "columns": [ + "executionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_acf8926098f063cdbbad8497fd1", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE SET NULL", + "table": "public.chat_hub_messages", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_e22538eb50a71a17954cd7e076c", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"sessionId\") REFERENCES chat_hub_sessions(id) ON DELETE CASCADE", + "table": "public.chat_hub_messages", + "referenced_table": "public.chat_hub_sessions", + "columns": [ + "sessionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_1f4998c8a7dec9e00a9ab15550e", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"revisionOfMessageId\") REFERENCES chat_hub_messages(id) ON DELETE CASCADE", + "table": "public.chat_hub_messages", + "referenced_table": "public.chat_hub_messages", + "columns": [ + "revisionOfMessageId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_25c9736e7f769f3a005eef4b372", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"retryOfMessageId\") REFERENCES chat_hub_messages(id) ON DELETE CASCADE", + "table": "public.chat_hub_messages", + "referenced_table": "public.chat_hub_messages", + "columns": [ + "retryOfMessageId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_e5d1fa722c5a8d38ac204746662", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"previousMessageId\") REFERENCES chat_hub_messages(id) ON DELETE CASCADE", + "table": "public.chat_hub_messages", + "referenced_table": "public.chat_hub_messages", + "columns": [ + "previousMessageId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_7704a5add6baed43eef835f0bfb", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.chat_hub_messages", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "FK_chat_hub_messages_agentId", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"agentId\") REFERENCES chat_hub_agents(id) ON DELETE SET NULL", + "table": "public.chat_hub_messages", + "referenced_table": "public.chat_hub_agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + } + ] + }, + { + "name": "public.chat_hub_agents", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "uuid", + "nullable": false + }, + { + "name": "name", + "type": "varchar(256)", + "nullable": false + }, + { + "name": "description", + "type": "varchar(512)", + "nullable": true + }, + { + "name": "systemPrompt", + "type": "text", + "nullable": false + }, + { + "name": "ownerId", + "type": "uuid", + "nullable": false + }, + { + "name": "credentialId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "provider", + "type": "varchar(16)", + "nullable": false, + "comment": "ChatHubProvider enum: \"openai\", \"anthropic\", \"google\", \"n8n\"" + }, + { + "name": "model", + "type": "varchar(64)", + "nullable": false, + "comment": "Model name used at the respective Model node, ie. \"gpt-4\"" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "icon", + "type": "json", + "nullable": true + }, + { + "name": "files", + "type": "json", + "nullable": false, + "default": "'[]'::json" + }, + { + "name": "suggestedPrompts", + "type": "json", + "nullable": false, + "default": "'[]'::json" + } + ], + "indexes": [ + { + "name": "PK_f39a3b36bbdf0e2979ddb21cf78", + "def": "CREATE UNIQUE INDEX \"PK_f39a3b36bbdf0e2979ddb21cf78\" ON public.chat_hub_agents USING btree (id)", + "table": "public.chat_hub_agents", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "chat_hub_agents_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.chat_hub_agents", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "chat_hub_agents_files_not_null", + "type": "n", + "def": "NOT NULL files", + "table": "public.chat_hub_agents", + "referenced_table": "", + "columns": [ + "files" + ] + }, + { + "name": "chat_hub_agents_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.chat_hub_agents", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "chat_hub_agents_model_not_null", + "type": "n", + "def": "NOT NULL model", + "table": "public.chat_hub_agents", + "referenced_table": "", + "columns": [ + "model" + ] + }, + { + "name": "chat_hub_agents_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.chat_hub_agents", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "chat_hub_agents_ownerId_not_null", + "type": "n", + "def": "NOT NULL \"ownerId\"", + "table": "public.chat_hub_agents", + "referenced_table": "", + "columns": [ + "ownerId" + ] + }, + { + "name": "chat_hub_agents_provider_not_null", + "type": "n", + "def": "NOT NULL provider", + "table": "public.chat_hub_agents", + "referenced_table": "", + "columns": [ + "provider" + ] + }, + { + "name": "chat_hub_agents_suggestedPrompts_not_null", + "type": "n", + "def": "NOT NULL \"suggestedPrompts\"", + "table": "public.chat_hub_agents", + "referenced_table": "", + "columns": [ + "suggestedPrompts" + ] + }, + { + "name": "chat_hub_agents_systemPrompt_not_null", + "type": "n", + "def": "NOT NULL \"systemPrompt\"", + "table": "public.chat_hub_agents", + "referenced_table": "", + "columns": [ + "systemPrompt" + ] + }, + { + "name": "chat_hub_agents_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.chat_hub_agents", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_441ba2caba11e077ce3fbfa2cd8", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"ownerId\") REFERENCES \"user\"(id) ON DELETE CASCADE", + "table": "public.chat_hub_agents", + "referenced_table": "public.user", + "columns": [ + "ownerId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_9c61ad497dcbae499c96a6a78ba", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"credentialId\") REFERENCES credentials_entity(id) ON DELETE SET NULL", + "table": "public.chat_hub_agents", + "referenced_table": "public.credentials_entity", + "columns": [ + "credentialId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_f39a3b36bbdf0e2979ddb21cf78", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.chat_hub_agents", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.oauth_clients", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar", + "nullable": false + }, + { + "name": "name", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "redirectUris", + "type": "json", + "nullable": false + }, + { + "name": "grantTypes", + "type": "json", + "nullable": false + }, + { + "name": "clientSecret", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "clientSecretExpiresAt", + "type": "bigint", + "nullable": true + }, + { + "name": "tokenEndpointAuthMethod", + "type": "varchar(255)", + "nullable": false, + "default": "'none'::character varying", + "comment": "Possible values: none, client_secret_basic or client_secret_post" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_c4759172d3431bae6f04e678e0d", + "def": "CREATE UNIQUE INDEX \"PK_c4759172d3431bae6f04e678e0d\" ON public.oauth_clients USING btree (id)", + "table": "public.oauth_clients", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "oauth_clients_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.oauth_clients", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "oauth_clients_grantTypes_not_null", + "type": "n", + "def": "NOT NULL \"grantTypes\"", + "table": "public.oauth_clients", + "referenced_table": "", + "columns": [ + "grantTypes" + ] + }, + { + "name": "oauth_clients_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.oauth_clients", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "oauth_clients_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.oauth_clients", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "oauth_clients_redirectUris_not_null", + "type": "n", + "def": "NOT NULL \"redirectUris\"", + "table": "public.oauth_clients", + "referenced_table": "", + "columns": [ + "redirectUris" + ] + }, + { + "name": "oauth_clients_tokenEndpointAuthMethod_not_null", + "type": "n", + "def": "NOT NULL \"tokenEndpointAuthMethod\"", + "table": "public.oauth_clients", + "referenced_table": "", + "columns": [ + "tokenEndpointAuthMethod" + ] + }, + { + "name": "oauth_clients_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.oauth_clients", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "PK_c4759172d3431bae6f04e678e0d", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.oauth_clients", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.oauth_authorization_codes", + "type": "BASE TABLE", + "columns": [ + { + "name": "code", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "clientId", + "type": "varchar", + "nullable": false + }, + { + "name": "userId", + "type": "uuid", + "nullable": false + }, + { + "name": "redirectUri", + "type": "varchar", + "nullable": false + }, + { + "name": "codeChallenge", + "type": "varchar", + "nullable": false + }, + { + "name": "codeChallengeMethod", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "expiresAt", + "type": "bigint", + "nullable": false, + "comment": "Unix timestamp in milliseconds" + }, + { + "name": "state", + "type": "varchar", + "nullable": true + }, + { + "name": "used", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "resource", + "type": "varchar", + "nullable": true, + "comment": "RFC 8707 resource indicator URI (e.g. https://n8n.example.com/mcp-server/http). NULL = legacy flow predating resource indicator support; defaults to the instance canonical MCP resource URL." + }, + { + "name": "scope", + "type": "json", + "nullable": false, + "default": "'[\"tool:listWorkflows\",\"tool:getWorkflowDetails\"]'::json", + "comment": "OAuth scopes granted for this authorization code" + } + ], + "indexes": [ + { + "name": "PK_fb91ab932cfbd694061501cc20f", + "def": "CREATE UNIQUE INDEX \"PK_fb91ab932cfbd694061501cc20f\" ON public.oauth_authorization_codes USING btree (code)", + "table": "public.oauth_authorization_codes", + "columns": [ + "code" + ] + } + ], + "constraints": [ + { + "name": "oauth_authorization_codes_clientId_not_null", + "type": "n", + "def": "NOT NULL \"clientId\"", + "table": "public.oauth_authorization_codes", + "referenced_table": "", + "columns": [ + "clientId" + ] + }, + { + "name": "oauth_authorization_codes_codeChallengeMethod_not_null", + "type": "n", + "def": "NOT NULL \"codeChallengeMethod\"", + "table": "public.oauth_authorization_codes", + "referenced_table": "", + "columns": [ + "codeChallengeMethod" + ] + }, + { + "name": "oauth_authorization_codes_codeChallenge_not_null", + "type": "n", + "def": "NOT NULL \"codeChallenge\"", + "table": "public.oauth_authorization_codes", + "referenced_table": "", + "columns": [ + "codeChallenge" + ] + }, + { + "name": "oauth_authorization_codes_code_not_null", + "type": "n", + "def": "NOT NULL code", + "table": "public.oauth_authorization_codes", + "referenced_table": "", + "columns": [ + "code" + ] + }, + { + "name": "oauth_authorization_codes_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.oauth_authorization_codes", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "oauth_authorization_codes_expiresAt_not_null", + "type": "n", + "def": "NOT NULL \"expiresAt\"", + "table": "public.oauth_authorization_codes", + "referenced_table": "", + "columns": [ + "expiresAt" + ] + }, + { + "name": "oauth_authorization_codes_redirectUri_not_null", + "type": "n", + "def": "NOT NULL \"redirectUri\"", + "table": "public.oauth_authorization_codes", + "referenced_table": "", + "columns": [ + "redirectUri" + ] + }, + { + "name": "oauth_authorization_codes_scope_not_null", + "type": "n", + "def": "NOT NULL scope", + "table": "public.oauth_authorization_codes", + "referenced_table": "", + "columns": [ + "scope" + ] + }, + { + "name": "oauth_authorization_codes_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.oauth_authorization_codes", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "oauth_authorization_codes_used_not_null", + "type": "n", + "def": "NOT NULL used", + "table": "public.oauth_authorization_codes", + "referenced_table": "", + "columns": [ + "used" + ] + }, + { + "name": "oauth_authorization_codes_userId_not_null", + "type": "n", + "def": "NOT NULL \"userId\"", + "table": "public.oauth_authorization_codes", + "referenced_table": "", + "columns": [ + "userId" + ] + }, + { + "name": "FK_aa8d3560484944c19bdf79ffa16", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE", + "table": "public.oauth_authorization_codes", + "referenced_table": "public.user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_64d965bd072ea24fb6da55468cd", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"clientId\") REFERENCES oauth_clients(id) ON DELETE CASCADE", + "table": "public.oauth_authorization_codes", + "referenced_table": "public.oauth_clients", + "columns": [ + "clientId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_fb91ab932cfbd694061501cc20f", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (code)", + "table": "public.oauth_authorization_codes", + "referenced_table": "", + "columns": [ + "code" + ] + } + ] + }, + { + "name": "public.oauth_access_tokens", + "type": "BASE TABLE", + "columns": [ + { + "name": "token", + "type": "varchar", + "nullable": false + }, + { + "name": "clientId", + "type": "varchar", + "nullable": false + }, + { + "name": "userId", + "type": "uuid", + "nullable": false + } + ], + "indexes": [ + { + "name": "PK_dcd71f96a5d5f4bf79e67d322bf", + "def": "CREATE UNIQUE INDEX \"PK_dcd71f96a5d5f4bf79e67d322bf\" ON public.oauth_access_tokens USING btree (token)", + "table": "public.oauth_access_tokens", + "columns": [ + "token" + ] + } + ], + "constraints": [ + { + "name": "oauth_access_tokens_clientId_not_null", + "type": "n", + "def": "NOT NULL \"clientId\"", + "table": "public.oauth_access_tokens", + "referenced_table": "", + "columns": [ + "clientId" + ] + }, + { + "name": "oauth_access_tokens_token_not_null", + "type": "n", + "def": "NOT NULL token", + "table": "public.oauth_access_tokens", + "referenced_table": "", + "columns": [ + "token" + ] + }, + { + "name": "oauth_access_tokens_userId_not_null", + "type": "n", + "def": "NOT NULL \"userId\"", + "table": "public.oauth_access_tokens", + "referenced_table": "", + "columns": [ + "userId" + ] + }, + { + "name": "FK_7234a36d8e49a1fa85095328845", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE", + "table": "public.oauth_access_tokens", + "referenced_table": "public.user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_78b26968132b7e5e45b75876481", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"clientId\") REFERENCES oauth_clients(id) ON DELETE CASCADE", + "table": "public.oauth_access_tokens", + "referenced_table": "public.oauth_clients", + "columns": [ + "clientId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_dcd71f96a5d5f4bf79e67d322bf", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (token)", + "table": "public.oauth_access_tokens", + "referenced_table": "", + "columns": [ + "token" + ] + } + ] + }, + { + "name": "public.oauth_refresh_tokens", + "type": "BASE TABLE", + "columns": [ + { + "name": "token", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "clientId", + "type": "varchar", + "nullable": false + }, + { + "name": "userId", + "type": "uuid", + "nullable": false + }, + { + "name": "expiresAt", + "type": "bigint", + "nullable": false, + "comment": "Unix timestamp in milliseconds" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "scope", + "type": "json", + "nullable": false, + "default": "'[\"tool:listWorkflows\",\"tool:getWorkflowDetails\"]'::json", + "comment": "OAuth scopes granted for this refresh token" + } + ], + "indexes": [ + { + "name": "PK_74abaed0b30711b6532598b0392", + "def": "CREATE UNIQUE INDEX \"PK_74abaed0b30711b6532598b0392\" ON public.oauth_refresh_tokens USING btree (token)", + "table": "public.oauth_refresh_tokens", + "columns": [ + "token" + ] + } + ], + "constraints": [ + { + "name": "oauth_refresh_tokens_clientId_not_null", + "type": "n", + "def": "NOT NULL \"clientId\"", + "table": "public.oauth_refresh_tokens", + "referenced_table": "", + "columns": [ + "clientId" + ] + }, + { + "name": "oauth_refresh_tokens_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.oauth_refresh_tokens", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "oauth_refresh_tokens_expiresAt_not_null", + "type": "n", + "def": "NOT NULL \"expiresAt\"", + "table": "public.oauth_refresh_tokens", + "referenced_table": "", + "columns": [ + "expiresAt" + ] + }, + { + "name": "oauth_refresh_tokens_scope_not_null", + "type": "n", + "def": "NOT NULL scope", + "table": "public.oauth_refresh_tokens", + "referenced_table": "", + "columns": [ + "scope" + ] + }, + { + "name": "oauth_refresh_tokens_token_not_null", + "type": "n", + "def": "NOT NULL token", + "table": "public.oauth_refresh_tokens", + "referenced_table": "", + "columns": [ + "token" + ] + }, + { + "name": "oauth_refresh_tokens_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.oauth_refresh_tokens", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "oauth_refresh_tokens_userId_not_null", + "type": "n", + "def": "NOT NULL \"userId\"", + "table": "public.oauth_refresh_tokens", + "referenced_table": "", + "columns": [ + "userId" + ] + }, + { + "name": "FK_a699f3ed9fd0c1b19bc2608ac53", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE", + "table": "public.oauth_refresh_tokens", + "referenced_table": "public.user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_b388696ce4d8be7ffbe8d3e4b69", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"clientId\") REFERENCES oauth_clients(id) ON DELETE CASCADE", + "table": "public.oauth_refresh_tokens", + "referenced_table": "public.oauth_clients", + "columns": [ + "clientId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_74abaed0b30711b6532598b0392", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (token)", + "table": "public.oauth_refresh_tokens", + "referenced_table": "", + "columns": [ + "token" + ] + } + ] + }, + { + "name": "public.oauth_user_consents", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "integer", + "nullable": false + }, + { + "name": "userId", + "type": "uuid", + "nullable": false + }, + { + "name": "clientId", + "type": "varchar", + "nullable": false + }, + { + "name": "grantedAt", + "type": "bigint", + "nullable": false, + "comment": "Unix timestamp in milliseconds" + } + ], + "indexes": [ + { + "name": "PK_85b9ada746802c8993103470f05", + "def": "CREATE UNIQUE INDEX \"PK_85b9ada746802c8993103470f05\" ON public.oauth_user_consents USING btree (id)", + "table": "public.oauth_user_consents", + "columns": [ + "id" + ] + }, + { + "name": "UQ_083721d99ce8db4033e2958ebb4", + "def": "CREATE UNIQUE INDEX \"UQ_083721d99ce8db4033e2958ebb4\" ON public.oauth_user_consents USING btree (\"userId\", \"clientId\")", + "table": "public.oauth_user_consents", + "columns": [ + "userId", + "clientId" + ] + } + ], + "constraints": [ + { + "name": "oauth_user_consents_clientId_not_null", + "type": "n", + "def": "NOT NULL \"clientId\"", + "table": "public.oauth_user_consents", + "referenced_table": "", + "columns": [ + "clientId" + ] + }, + { + "name": "oauth_user_consents_grantedAt_not_null", + "type": "n", + "def": "NOT NULL \"grantedAt\"", + "table": "public.oauth_user_consents", + "referenced_table": "", + "columns": [ + "grantedAt" + ] + }, + { + "name": "oauth_user_consents_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.oauth_user_consents", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "oauth_user_consents_userId_not_null", + "type": "n", + "def": "NOT NULL \"userId\"", + "table": "public.oauth_user_consents", + "referenced_table": "", + "columns": [ + "userId" + ] + }, + { + "name": "FK_21e6c3c2d78a097478fae6aaefa", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE", + "table": "public.oauth_user_consents", + "referenced_table": "public.user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_a651acea2f6c97f8c4514935486", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"clientId\") REFERENCES oauth_clients(id) ON DELETE CASCADE", + "table": "public.oauth_user_consents", + "referenced_table": "public.oauth_clients", + "columns": [ + "clientId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_85b9ada746802c8993103470f05", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.oauth_user_consents", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "UQ_083721d99ce8db4033e2958ebb4", + "type": "UNIQUE", + "def": "UNIQUE (\"userId\", \"clientId\")", + "table": "public.oauth_user_consents", + "referenced_table": "", + "columns": [ + "userId", + "clientId" + ] + } + ] + }, + { + "name": "public.workflow_dependency", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "integer", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "workflowVersionId", + "type": "integer", + "nullable": false, + "comment": "Version of the workflow" + }, + { + "name": "dependencyType", + "type": "varchar(32)", + "nullable": false, + "comment": "Type of dependency: \"credential\", \"nodeType\", \"webhookPath\", or \"workflowCall\"" + }, + { + "name": "dependencyKey", + "type": "varchar(255)", + "nullable": false, + "comment": "ID or name of the dependency" + }, + { + "name": "dependencyInfo", + "type": "json", + "nullable": true, + "comment": "Additional info about the dependency, interpreted based on type" + }, + { + "name": "indexVersionId", + "type": "smallint", + "nullable": false, + "default": "1", + "comment": "Version of the index structure" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "publishedVersionId", + "type": "varchar(36)", + "nullable": true + } + ], + "indexes": [ + { + "name": "PK_52325e34cd7a2f0f67b0f3cad65", + "def": "CREATE UNIQUE INDEX \"PK_52325e34cd7a2f0f67b0f3cad65\" ON public.workflow_dependency USING btree (id)", + "table": "public.workflow_dependency", + "columns": [ + "id" + ] + }, + { + "name": "IDX_a4ff2d9b9628ea988fa9e7d0bf", + "def": "CREATE INDEX \"IDX_a4ff2d9b9628ea988fa9e7d0bf\" ON public.workflow_dependency USING btree (\"workflowId\")", + "table": "public.workflow_dependency", + "columns": [ + "workflowId" + ] + }, + { + "name": "IDX_e7fe1cfda990c14a445937d0b9", + "def": "CREATE INDEX \"IDX_e7fe1cfda990c14a445937d0b9\" ON public.workflow_dependency USING btree (\"dependencyType\")", + "table": "public.workflow_dependency", + "columns": [ + "dependencyType" + ] + }, + { + "name": "IDX_e48a201071ab85d9d09119d640", + "def": "CREATE INDEX \"IDX_e48a201071ab85d9d09119d640\" ON public.workflow_dependency USING btree (\"dependencyKey\")", + "table": "public.workflow_dependency", + "columns": [ + "dependencyKey" + ] + }, + { + "name": "IDX_workflow_dependency_publishedVersionId", + "def": "CREATE INDEX \"IDX_workflow_dependency_publishedVersionId\" ON public.workflow_dependency USING btree (\"publishedVersionId\")", + "table": "public.workflow_dependency", + "columns": [ + "publishedVersionId" + ] + } + ], + "constraints": [ + { + "name": "workflow_dependency_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.workflow_dependency", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "workflow_dependency_dependencyKey_not_null", + "type": "n", + "def": "NOT NULL \"dependencyKey\"", + "table": "public.workflow_dependency", + "referenced_table": "", + "columns": [ + "dependencyKey" + ] + }, + { + "name": "workflow_dependency_dependencyType_not_null", + "type": "n", + "def": "NOT NULL \"dependencyType\"", + "table": "public.workflow_dependency", + "referenced_table": "", + "columns": [ + "dependencyType" + ] + }, + { + "name": "workflow_dependency_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.workflow_dependency", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "workflow_dependency_indexVersionId_not_null", + "type": "n", + "def": "NOT NULL \"indexVersionId\"", + "table": "public.workflow_dependency", + "referenced_table": "", + "columns": [ + "indexVersionId" + ] + }, + { + "name": "workflow_dependency_workflowId_not_null", + "type": "n", + "def": "NOT NULL \"workflowId\"", + "table": "public.workflow_dependency", + "referenced_table": "", + "columns": [ + "workflowId" + ] + }, + { + "name": "workflow_dependency_workflowVersionId_not_null", + "type": "n", + "def": "NOT NULL \"workflowVersionId\"", + "table": "public.workflow_dependency", + "referenced_table": "", + "columns": [ + "workflowVersionId" + ] + }, + { + "name": "FK_a4ff2d9b9628ea988fa9e7d0bf8", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE", + "table": "public.workflow_dependency", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_52325e34cd7a2f0f67b0f3cad65", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.workflow_dependency", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.binary_data", + "type": "BASE TABLE", + "columns": [ + { + "name": "fileId", + "type": "uuid", + "nullable": false + }, + { + "name": "sourceType", + "type": "varchar(50)", + "nullable": false, + "comment": "Source the file belongs to, e.g. 'execution'" + }, + { + "name": "sourceId", + "type": "varchar(255)", + "nullable": false, + "comment": "ID of the source, e.g. execution ID" + }, + { + "name": "data", + "type": "bytea", + "nullable": false, + "comment": "Raw, not base64 encoded" + }, + { + "name": "mimeType", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "fileName", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "fileSize", + "type": "integer", + "nullable": false, + "comment": "In bytes" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_fc3691585b39408bb0551122af6", + "def": "CREATE UNIQUE INDEX \"PK_fc3691585b39408bb0551122af6\" ON public.binary_data USING btree (\"fileId\")", + "table": "public.binary_data", + "columns": [ + "fileId" + ] + }, + { + "name": "IDX_56900edc3cfd16612e2ef2c6a8", + "def": "CREATE INDEX \"IDX_56900edc3cfd16612e2ef2c6a8\" ON public.binary_data USING btree (\"sourceType\", \"sourceId\")", + "table": "public.binary_data", + "columns": [ + "sourceType", + "sourceId" + ] + } + ], + "constraints": [ + { + "name": "CHK_binary_data_sourceType", + "type": "CHECK", + "def": "CHECK (((\"sourceType\")::text = ANY ((ARRAY['execution'::character varying, 'chat_message_attachment'::character varying, 'agent_file'::character varying])::text[])))", + "table": "public.binary_data", + "referenced_table": "", + "columns": [ + "sourceType" + ] + }, + { + "name": "binary_data_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.binary_data", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "binary_data_data_not_null", + "type": "n", + "def": "NOT NULL data", + "table": "public.binary_data", + "referenced_table": "", + "columns": [ + "data" + ] + }, + { + "name": "binary_data_fileId_not_null", + "type": "n", + "def": "NOT NULL \"fileId\"", + "table": "public.binary_data", + "referenced_table": "", + "columns": [ + "fileId" + ] + }, + { + "name": "binary_data_fileSize_not_null", + "type": "n", + "def": "NOT NULL \"fileSize\"", + "table": "public.binary_data", + "referenced_table": "", + "columns": [ + "fileSize" + ] + }, + { + "name": "binary_data_sourceId_not_null", + "type": "n", + "def": "NOT NULL \"sourceId\"", + "table": "public.binary_data", + "referenced_table": "", + "columns": [ + "sourceId" + ] + }, + { + "name": "binary_data_sourceType_not_null", + "type": "n", + "def": "NOT NULL \"sourceType\"", + "table": "public.binary_data", + "referenced_table": "", + "columns": [ + "sourceType" + ] + }, + { + "name": "binary_data_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.binary_data", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "PK_fc3691585b39408bb0551122af6", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"fileId\")", + "table": "public.binary_data", + "referenced_table": "", + "columns": [ + "fileId" + ] + } + ] + }, + { + "name": "public.workflow_publish_history", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "integer", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "versionId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "event", + "type": "varchar(36)", + "nullable": false, + "comment": "Type of history record: activated (workflow is now active), deactivated (workflow is now inactive)" + }, + { + "name": "userId", + "type": "uuid", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_c788f7caf88e91e365c97d6d04a", + "def": "CREATE UNIQUE INDEX \"PK_c788f7caf88e91e365c97d6d04a\" ON public.workflow_publish_history USING btree (id)", + "table": "public.workflow_publish_history", + "columns": [ + "id" + ] + }, + { + "name": "IDX_070b5de842ece9ccdda0d9738b", + "def": "CREATE INDEX \"IDX_070b5de842ece9ccdda0d9738b\" ON public.workflow_publish_history USING btree (\"workflowId\", \"versionId\")", + "table": "public.workflow_publish_history", + "columns": [ + "workflowId", + "versionId" + ] + } + ], + "constraints": [ + { + "name": "CHK_workflow_publish_history_event", + "type": "CHECK", + "def": "CHECK (((event)::text = ANY ((ARRAY['activated'::character varying, 'deactivated'::character varying])::text[])))", + "table": "public.workflow_publish_history", + "referenced_table": "", + "columns": [ + "event" + ] + }, + { + "name": "workflow_publish_history_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.workflow_publish_history", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "workflow_publish_history_event_not_null", + "type": "n", + "def": "NOT NULL event", + "table": "public.workflow_publish_history", + "referenced_table": "", + "columns": [ + "event" + ] + }, + { + "name": "workflow_publish_history_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.workflow_publish_history", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "workflow_publish_history_workflowId_not_null", + "type": "n", + "def": "NOT NULL \"workflowId\"", + "table": "public.workflow_publish_history", + "referenced_table": "", + "columns": [ + "workflowId" + ] + }, + { + "name": "FK_6eab5bd9eedabe9c54bd879fc40", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE SET NULL", + "table": "public.workflow_publish_history", + "referenced_table": "public.user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_c01316f8c2d7101ec4fa9809267", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE", + "table": "public.workflow_publish_history", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_b4cfbc7556d07f36ca177f5e473", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"versionId\") REFERENCES workflow_history(\"versionId\") ON DELETE SET NULL", + "table": "public.workflow_publish_history", + "referenced_table": "public.workflow_history", + "columns": [ + "versionId" + ], + "referenced_columns": [ + "versionId" + ] + }, + { + "name": "PK_c788f7caf88e91e365c97d6d04a", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.workflow_publish_history", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.dynamic_credential_resolver", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "config", + "type": "text", + "nullable": false, + "comment": "Encrypted resolver configuration (JSON encrypted as string)" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_b76cfb088dcdaf5275e9980bb64", + "def": "CREATE UNIQUE INDEX \"PK_b76cfb088dcdaf5275e9980bb64\" ON public.dynamic_credential_resolver USING btree (id)", + "table": "public.dynamic_credential_resolver", + "columns": [ + "id" + ] + }, + { + "name": "IDX_9c9ee9df586e60bb723234e499", + "def": "CREATE INDEX \"IDX_9c9ee9df586e60bb723234e499\" ON public.dynamic_credential_resolver USING btree (type)", + "table": "public.dynamic_credential_resolver", + "columns": [ + "type" + ] + } + ], + "constraints": [ + { + "name": "dynamic_credential_resolver_config_not_null", + "type": "n", + "def": "NOT NULL config", + "table": "public.dynamic_credential_resolver", + "referenced_table": "", + "columns": [ + "config" + ] + }, + { + "name": "dynamic_credential_resolver_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.dynamic_credential_resolver", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "dynamic_credential_resolver_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.dynamic_credential_resolver", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "dynamic_credential_resolver_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.dynamic_credential_resolver", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "dynamic_credential_resolver_type_not_null", + "type": "n", + "def": "NOT NULL type", + "table": "public.dynamic_credential_resolver", + "referenced_table": "", + "columns": [ + "type" + ] + }, + { + "name": "dynamic_credential_resolver_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.dynamic_credential_resolver", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "PK_b76cfb088dcdaf5275e9980bb64", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.dynamic_credential_resolver", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.dynamic_credential_user_entry", + "type": "BASE TABLE", + "columns": [ + { + "name": "credentialId", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "userId", + "type": "uuid", + "nullable": false + }, + { + "name": "resolverId", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "data", + "type": "text", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_74f548e633abc66dc27c8f0ca77", + "def": "CREATE UNIQUE INDEX \"PK_74f548e633abc66dc27c8f0ca77\" ON public.dynamic_credential_user_entry USING btree (\"credentialId\", \"userId\", \"resolverId\")", + "table": "public.dynamic_credential_user_entry", + "columns": [ + "credentialId", + "userId", + "resolverId" + ] + }, + { + "name": "IDX_a36dc616fabc3f736bb82410a2", + "def": "CREATE INDEX \"IDX_a36dc616fabc3f736bb82410a2\" ON public.dynamic_credential_user_entry USING btree (\"userId\")", + "table": "public.dynamic_credential_user_entry", + "columns": [ + "userId" + ] + }, + { + "name": "IDX_6edec973a6450990977bb854c3", + "def": "CREATE INDEX \"IDX_6edec973a6450990977bb854c3\" ON public.dynamic_credential_user_entry USING btree (\"resolverId\")", + "table": "public.dynamic_credential_user_entry", + "columns": [ + "resolverId" + ] + } + ], + "constraints": [ + { + "name": "dynamic_credential_user_entry_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.dynamic_credential_user_entry", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "dynamic_credential_user_entry_credentialId_not_null", + "type": "n", + "def": "NOT NULL \"credentialId\"", + "table": "public.dynamic_credential_user_entry", + "referenced_table": "", + "columns": [ + "credentialId" + ] + }, + { + "name": "dynamic_credential_user_entry_data_not_null", + "type": "n", + "def": "NOT NULL data", + "table": "public.dynamic_credential_user_entry", + "referenced_table": "", + "columns": [ + "data" + ] + }, + { + "name": "dynamic_credential_user_entry_resolverId_not_null", + "type": "n", + "def": "NOT NULL \"resolverId\"", + "table": "public.dynamic_credential_user_entry", + "referenced_table": "", + "columns": [ + "resolverId" + ] + }, + { + "name": "dynamic_credential_user_entry_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.dynamic_credential_user_entry", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "dynamic_credential_user_entry_userId_not_null", + "type": "n", + "def": "NOT NULL \"userId\"", + "table": "public.dynamic_credential_user_entry", + "referenced_table": "", + "columns": [ + "userId" + ] + }, + { + "name": "FK_a36dc616fabc3f736bb82410a22", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE", + "table": "public.dynamic_credential_user_entry", + "referenced_table": "public.user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_945ba70b342a066d1306b12ccd2", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"credentialId\") REFERENCES credentials_entity(id) ON DELETE CASCADE", + "table": "public.dynamic_credential_user_entry", + "referenced_table": "public.credentials_entity", + "columns": [ + "credentialId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_6edec973a6450990977bb854c38", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"resolverId\") REFERENCES dynamic_credential_resolver(id) ON DELETE CASCADE", + "table": "public.dynamic_credential_user_entry", + "referenced_table": "public.dynamic_credential_resolver", + "columns": [ + "resolverId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_74f548e633abc66dc27c8f0ca77", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"credentialId\", \"userId\", \"resolverId\")", + "table": "public.dynamic_credential_user_entry", + "referenced_table": "", + "columns": [ + "credentialId", + "userId", + "resolverId" + ] + } + ] + }, + { + "name": "public.secrets_provider_connection", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "integer", + "nullable": false + }, + { + "name": "providerKey", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(36)", + "nullable": false, + "comment": "Type of secrets provider. Possible values: awsSecretsManager, gcpSecretsManager, vault, azureKeyVault, infisical" + }, + { + "name": "encryptedSettings", + "type": "text", + "nullable": false + }, + { + "name": "isEnabled", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_4350ae85e76f9ba7df1370acb5d", + "def": "CREATE UNIQUE INDEX \"PK_4350ae85e76f9ba7df1370acb5d\" ON public.secrets_provider_connection USING btree (id)", + "table": "public.secrets_provider_connection", + "columns": [ + "id" + ] + }, + { + "name": "IDX_secrets_provider_connection_providerKey", + "def": "CREATE UNIQUE INDEX \"IDX_secrets_provider_connection_providerKey\" ON public.secrets_provider_connection USING btree (\"providerKey\")", + "table": "public.secrets_provider_connection", + "columns": [ + "providerKey" + ] + } + ], + "constraints": [ + { + "name": "secrets_provider_connection_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.secrets_provider_connection", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "secrets_provider_connection_encryptedSettings_not_null", + "type": "n", + "def": "NOT NULL \"encryptedSettings\"", + "table": "public.secrets_provider_connection", + "referenced_table": "", + "columns": [ + "encryptedSettings" + ] + }, + { + "name": "secrets_provider_connection_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.secrets_provider_connection", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "secrets_provider_connection_isEnabled_not_null", + "type": "n", + "def": "NOT NULL \"isEnabled\"", + "table": "public.secrets_provider_connection", + "referenced_table": "", + "columns": [ + "isEnabled" + ] + }, + { + "name": "secrets_provider_connection_providerKey_not_null", + "type": "n", + "def": "NOT NULL \"providerKey\"", + "table": "public.secrets_provider_connection", + "referenced_table": "", + "columns": [ + "providerKey" + ] + }, + { + "name": "secrets_provider_connection_type_not_null", + "type": "n", + "def": "NOT NULL type", + "table": "public.secrets_provider_connection", + "referenced_table": "", + "columns": [ + "type" + ] + }, + { + "name": "secrets_provider_connection_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.secrets_provider_connection", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "PK_4350ae85e76f9ba7df1370acb5d", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.secrets_provider_connection", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.project_secrets_provider_access", + "type": "BASE TABLE", + "columns": [ + { + "name": "secretsProviderConnectionId", + "type": "integer", + "nullable": false + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "role", + "type": "varchar(128)", + "nullable": false, + "default": "'secretsProviderConnection:user'::character varying" + } + ], + "indexes": [ + { + "name": "PK_0402b7fcec5415246656f102f83", + "def": "CREATE UNIQUE INDEX \"PK_0402b7fcec5415246656f102f83\" ON public.project_secrets_provider_access USING btree (\"secretsProviderConnectionId\", \"projectId\")", + "table": "public.project_secrets_provider_access", + "columns": [ + "secretsProviderConnectionId", + "projectId" + ] + } + ], + "constraints": [ + { + "name": "CHK_project_secrets_provider_access_role", + "type": "CHECK", + "def": "CHECK (((role)::text = ANY ((ARRAY['secretsProviderConnection:owner'::character varying, 'secretsProviderConnection:user'::character varying])::text[])))", + "table": "public.project_secrets_provider_access", + "referenced_table": "", + "columns": [ + "role" + ] + }, + { + "name": "project_secrets_provider_ac_secretsProviderConnectionI_not_null", + "type": "n", + "def": "NOT NULL \"secretsProviderConnectionId\"", + "table": "public.project_secrets_provider_access", + "referenced_table": "", + "columns": [ + "secretsProviderConnectionId" + ] + }, + { + "name": "project_secrets_provider_access_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.project_secrets_provider_access", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "project_secrets_provider_access_projectId_not_null", + "type": "n", + "def": "NOT NULL \"projectId\"", + "table": "public.project_secrets_provider_access", + "referenced_table": "", + "columns": [ + "projectId" + ] + }, + { + "name": "project_secrets_provider_access_role_not_null", + "type": "n", + "def": "NOT NULL role", + "table": "public.project_secrets_provider_access", + "referenced_table": "", + "columns": [ + "role" + ] + }, + { + "name": "project_secrets_provider_access_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.project_secrets_provider_access", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_bd264b81209355b543878deedb1", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE", + "table": "public.project_secrets_provider_access", + "referenced_table": "public.project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_18e5c27d2524b1638b292904e48", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"secretsProviderConnectionId\") REFERENCES secrets_provider_connection(id) ON DELETE CASCADE", + "table": "public.project_secrets_provider_access", + "referenced_table": "public.secrets_provider_connection", + "columns": [ + "secretsProviderConnectionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_0402b7fcec5415246656f102f83", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"secretsProviderConnectionId\", \"projectId\")", + "table": "public.project_secrets_provider_access", + "referenced_table": "", + "columns": [ + "secretsProviderConnectionId", + "projectId" + ] + } + ] + }, + { + "name": "public.workflow_published_version", + "type": "BASE TABLE", + "columns": [ + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "publishedVersionId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_5c76fb7ee939fe2530374d3f75a", + "def": "CREATE UNIQUE INDEX \"PK_5c76fb7ee939fe2530374d3f75a\" ON public.workflow_published_version USING btree (\"workflowId\")", + "table": "public.workflow_published_version", + "columns": [ + "workflowId" + ] + } + ], + "constraints": [ + { + "name": "workflow_published_version_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.workflow_published_version", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "workflow_published_version_publishedVersionId_not_null", + "type": "n", + "def": "NOT NULL \"publishedVersionId\"", + "table": "public.workflow_published_version", + "referenced_table": "", + "columns": [ + "publishedVersionId" + ] + }, + { + "name": "workflow_published_version_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.workflow_published_version", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "workflow_published_version_workflowId_not_null", + "type": "n", + "def": "NOT NULL \"workflowId\"", + "table": "public.workflow_published_version", + "referenced_table": "", + "columns": [ + "workflowId" + ] + }, + { + "name": "FK_5c76fb7ee939fe2530374d3f75a", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE RESTRICT", + "table": "public.workflow_published_version", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_df3428a541b802d6a63ac56e330", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"publishedVersionId\") REFERENCES workflow_history(\"versionId\") ON DELETE RESTRICT", + "table": "public.workflow_published_version", + "referenced_table": "public.workflow_history", + "columns": [ + "publishedVersionId" + ], + "referenced_columns": [ + "versionId" + ] + }, + { + "name": "PK_5c76fb7ee939fe2530374d3f75a", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"workflowId\")", + "table": "public.workflow_published_version", + "referenced_table": "", + "columns": [ + "workflowId" + ] + } + ] + }, + { + "name": "public.dynamic_credential_entry", + "type": "BASE TABLE", + "columns": [ + { + "name": "credential_id", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "subject_id", + "type": "varchar(2048)", + "nullable": false + }, + { + "name": "resolver_id", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "data", + "type": "text", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_5135ffcabecad4727ff6b9b803d", + "def": "CREATE UNIQUE INDEX \"PK_5135ffcabecad4727ff6b9b803d\" ON public.dynamic_credential_entry USING btree (credential_id, subject_id, resolver_id)", + "table": "public.dynamic_credential_entry", + "columns": [ + "credential_id", + "subject_id", + "resolver_id" + ] + }, + { + "name": "IDX_62476b94b56d9dc7ed9ed75d3d", + "def": "CREATE INDEX \"IDX_62476b94b56d9dc7ed9ed75d3d\" ON public.dynamic_credential_entry USING btree (subject_id)", + "table": "public.dynamic_credential_entry", + "columns": [ + "subject_id" + ] + }, + { + "name": "IDX_d61a12235d268a49af6a3c09c1", + "def": "CREATE INDEX \"IDX_d61a12235d268a49af6a3c09c1\" ON public.dynamic_credential_entry USING btree (resolver_id)", + "table": "public.dynamic_credential_entry", + "columns": [ + "resolver_id" + ] + } + ], + "constraints": [ + { + "name": "tmp_dynamic_credential_entry_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.dynamic_credential_entry", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "tmp_dynamic_credential_entry_credential_id_not_null", + "type": "n", + "def": "NOT NULL credential_id", + "table": "public.dynamic_credential_entry", + "referenced_table": "", + "columns": [ + "credential_id" + ] + }, + { + "name": "tmp_dynamic_credential_entry_data_not_null", + "type": "n", + "def": "NOT NULL data", + "table": "public.dynamic_credential_entry", + "referenced_table": "", + "columns": [ + "data" + ] + }, + { + "name": "tmp_dynamic_credential_entry_resolver_id_not_null", + "type": "n", + "def": "NOT NULL resolver_id", + "table": "public.dynamic_credential_entry", + "referenced_table": "", + "columns": [ + "resolver_id" + ] + }, + { + "name": "tmp_dynamic_credential_entry_subject_id_not_null", + "type": "n", + "def": "NOT NULL subject_id", + "table": "public.dynamic_credential_entry", + "referenced_table": "", + "columns": [ + "subject_id" + ] + }, + { + "name": "tmp_dynamic_credential_entry_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.dynamic_credential_entry", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_a6d1dd080958304a47a02952aab", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (credential_id) REFERENCES credentials_entity(id) ON DELETE CASCADE", + "table": "public.dynamic_credential_entry", + "referenced_table": "public.credentials_entity", + "columns": [ + "credential_id" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_d61a12235d268a49af6a3c09c13", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (resolver_id) REFERENCES dynamic_credential_resolver(id) ON DELETE CASCADE", + "table": "public.dynamic_credential_entry", + "referenced_table": "public.dynamic_credential_resolver", + "columns": [ + "resolver_id" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_5135ffcabecad4727ff6b9b803d", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (credential_id, subject_id, resolver_id)", + "table": "public.dynamic_credential_entry", + "referenced_table": "", + "columns": [ + "credential_id", + "subject_id", + "resolver_id" + ] + } + ] + }, + { + "name": "public.chat_hub_tools", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "uuid", + "nullable": false + }, + { + "name": "name", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "typeVersion", + "type": "double precision", + "nullable": false + }, + { + "name": "ownerId", + "type": "uuid", + "nullable": false + }, + { + "name": "definition", + "type": "json", + "nullable": false + }, + { + "name": "enabled", + "type": "boolean", + "nullable": false, + "default": "true" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_696d26426c704fba79b2c195ef5", + "def": "CREATE UNIQUE INDEX \"PK_696d26426c704fba79b2c195ef5\" ON public.chat_hub_tools USING btree (id)", + "table": "public.chat_hub_tools", + "columns": [ + "id" + ] + }, + { + "name": "IDX_4c72ebdb265d1775bf61147af0", + "def": "CREATE UNIQUE INDEX \"IDX_4c72ebdb265d1775bf61147af0\" ON public.chat_hub_tools USING btree (\"ownerId\", name)", + "table": "public.chat_hub_tools", + "columns": [ + "ownerId", + "name" + ] + } + ], + "constraints": [ + { + "name": "chat_hub_tools_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.chat_hub_tools", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "chat_hub_tools_definition_not_null", + "type": "n", + "def": "NOT NULL definition", + "table": "public.chat_hub_tools", + "referenced_table": "", + "columns": [ + "definition" + ] + }, + { + "name": "chat_hub_tools_enabled_not_null", + "type": "n", + "def": "NOT NULL enabled", + "table": "public.chat_hub_tools", + "referenced_table": "", + "columns": [ + "enabled" + ] + }, + { + "name": "chat_hub_tools_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.chat_hub_tools", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "chat_hub_tools_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.chat_hub_tools", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "chat_hub_tools_ownerId_not_null", + "type": "n", + "def": "NOT NULL \"ownerId\"", + "table": "public.chat_hub_tools", + "referenced_table": "", + "columns": [ + "ownerId" + ] + }, + { + "name": "chat_hub_tools_typeVersion_not_null", + "type": "n", + "def": "NOT NULL \"typeVersion\"", + "table": "public.chat_hub_tools", + "referenced_table": "", + "columns": [ + "typeVersion" + ] + }, + { + "name": "chat_hub_tools_type_not_null", + "type": "n", + "def": "NOT NULL type", + "table": "public.chat_hub_tools", + "referenced_table": "", + "columns": [ + "type" + ] + }, + { + "name": "chat_hub_tools_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.chat_hub_tools", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_b8030b47af9213f1fd15450fb7f", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"ownerId\") REFERENCES \"user\"(id) ON DELETE CASCADE", + "table": "public.chat_hub_tools", + "referenced_table": "public.user", + "columns": [ + "ownerId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_696d26426c704fba79b2c195ef5", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.chat_hub_tools", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.chat_hub_session_tools", + "type": "BASE TABLE", + "columns": [ + { + "name": "sessionId", + "type": "uuid", + "nullable": false + }, + { + "name": "toolId", + "type": "uuid", + "nullable": false + } + ], + "indexes": [ + { + "name": "PK_87aea76ff4c274c4a5ac838ebe3", + "def": "CREATE UNIQUE INDEX \"PK_87aea76ff4c274c4a5ac838ebe3\" ON public.chat_hub_session_tools USING btree (\"sessionId\", \"toolId\")", + "table": "public.chat_hub_session_tools", + "columns": [ + "sessionId", + "toolId" + ] + } + ], + "constraints": [ + { + "name": "chat_hub_session_tools_sessionId_not_null", + "type": "n", + "def": "NOT NULL \"sessionId\"", + "table": "public.chat_hub_session_tools", + "referenced_table": "", + "columns": [ + "sessionId" + ] + }, + { + "name": "chat_hub_session_tools_toolId_not_null", + "type": "n", + "def": "NOT NULL \"toolId\"", + "table": "public.chat_hub_session_tools", + "referenced_table": "", + "columns": [ + "toolId" + ] + }, + { + "name": "FK_e649bf1295f4ed8d4299ed290f9", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"sessionId\") REFERENCES chat_hub_sessions(id) ON DELETE CASCADE", + "table": "public.chat_hub_session_tools", + "referenced_table": "public.chat_hub_sessions", + "columns": [ + "sessionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_6596a328affd8d4967ffb303eee", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"toolId\") REFERENCES chat_hub_tools(id) ON DELETE CASCADE", + "table": "public.chat_hub_session_tools", + "referenced_table": "public.chat_hub_tools", + "columns": [ + "toolId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_87aea76ff4c274c4a5ac838ebe3", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"sessionId\", \"toolId\")", + "table": "public.chat_hub_session_tools", + "referenced_table": "", + "columns": [ + "sessionId", + "toolId" + ] + } + ] + }, + { + "name": "public.chat_hub_agent_tools", + "type": "BASE TABLE", + "columns": [ + { + "name": "agentId", + "type": "uuid", + "nullable": false + }, + { + "name": "toolId", + "type": "uuid", + "nullable": false + } + ], + "indexes": [ + { + "name": "PK_cc8806fdea48297a7d497035d72", + "def": "CREATE UNIQUE INDEX \"PK_cc8806fdea48297a7d497035d72\" ON public.chat_hub_agent_tools USING btree (\"agentId\", \"toolId\")", + "table": "public.chat_hub_agent_tools", + "columns": [ + "agentId", + "toolId" + ] + } + ], + "constraints": [ + { + "name": "chat_hub_agent_tools_agentId_not_null", + "type": "n", + "def": "NOT NULL \"agentId\"", + "table": "public.chat_hub_agent_tools", + "referenced_table": "", + "columns": [ + "agentId" + ] + }, + { + "name": "chat_hub_agent_tools_toolId_not_null", + "type": "n", + "def": "NOT NULL \"toolId\"", + "table": "public.chat_hub_agent_tools", + "referenced_table": "", + "columns": [ + "toolId" + ] + }, + { + "name": "FK_2b53d796b3dbae91b1a9553c048", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"agentId\") REFERENCES chat_hub_agents(id) ON DELETE CASCADE", + "table": "public.chat_hub_agent_tools", + "referenced_table": "public.chat_hub_agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_43e70f04c53344f82483d0570f6", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"toolId\") REFERENCES chat_hub_tools(id) ON DELETE CASCADE", + "table": "public.chat_hub_agent_tools", + "referenced_table": "public.chat_hub_tools", + "columns": [ + "toolId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_cc8806fdea48297a7d497035d72", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"agentId\", \"toolId\")", + "table": "public.chat_hub_agent_tools", + "referenced_table": "", + "columns": [ + "agentId", + "toolId" + ] + } + ] + }, + { + "name": "public.workflow_builder_session", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "uuid", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "userId", + "type": "uuid", + "nullable": false + }, + { + "name": "messages", + "type": "json", + "nullable": false, + "default": "'[]'::json" + }, + { + "name": "previousSummary", + "type": "text", + "nullable": true, + "comment": "Summary of prior conversation from compaction (/compact or auto-compact)" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "activeVersionCardId", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "resumeAfterRestoreMessageId", + "type": "varchar(255)", + "nullable": true + } + ], + "indexes": [ + { + "name": "PK_e69ef0d385986e273423b0e8695", + "def": "CREATE UNIQUE INDEX \"PK_e69ef0d385986e273423b0e8695\" ON public.workflow_builder_session USING btree (id)", + "table": "public.workflow_builder_session", + "columns": [ + "id" + ] + }, + { + "name": "UQ_ec2aa73632932d485a1d5192ce1", + "def": "CREATE UNIQUE INDEX \"UQ_ec2aa73632932d485a1d5192ce1\" ON public.workflow_builder_session USING btree (\"workflowId\", \"userId\")", + "table": "public.workflow_builder_session", + "columns": [ + "workflowId", + "userId" + ] + } + ], + "constraints": [ + { + "name": "workflow_builder_session_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.workflow_builder_session", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "workflow_builder_session_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.workflow_builder_session", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "workflow_builder_session_messages_not_null", + "type": "n", + "def": "NOT NULL messages", + "table": "public.workflow_builder_session", + "referenced_table": "", + "columns": [ + "messages" + ] + }, + { + "name": "workflow_builder_session_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.workflow_builder_session", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "workflow_builder_session_userId_not_null", + "type": "n", + "def": "NOT NULL \"userId\"", + "table": "public.workflow_builder_session", + "referenced_table": "", + "columns": [ + "userId" + ] + }, + { + "name": "workflow_builder_session_workflowId_not_null", + "type": "n", + "def": "NOT NULL \"workflowId\"", + "table": "public.workflow_builder_session", + "referenced_table": "", + "columns": [ + "workflowId" + ] + }, + { + "name": "FK_00290cdeee4d4d7db84709be936", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE", + "table": "public.workflow_builder_session", + "referenced_table": "public.user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_7983c618db48f47bf5a4cc1e1e4", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE", + "table": "public.workflow_builder_session", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_e69ef0d385986e273423b0e8695", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.workflow_builder_session", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "UQ_ec2aa73632932d485a1d5192ce1", + "type": "UNIQUE", + "def": "UNIQUE (\"workflowId\", \"userId\")", + "table": "public.workflow_builder_session", + "referenced_table": "", + "columns": [ + "workflowId", + "userId" + ] + } + ] + }, + { + "name": "public.role_mapping_rule", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "expression", + "type": "text", + "nullable": false + }, + { + "name": "role", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(64)", + "nullable": false, + "comment": "Expected values: 'instance' (maps to a global role) or 'project' (maps to a project role; projects linked via role_mapping_rule_project)." + }, + { + "name": "order", + "type": "integer", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_d772c8ec1a89b52d31c882bc560", + "def": "CREATE UNIQUE INDEX \"PK_d772c8ec1a89b52d31c882bc560\" ON public.role_mapping_rule USING btree (id)", + "table": "public.role_mapping_rule", + "columns": [ + "id" + ] + }, + { + "name": "UQ_b33ac896ad3099fc8de36fdc1c4", + "def": "CREATE UNIQUE INDEX \"UQ_b33ac896ad3099fc8de36fdc1c4\" ON public.role_mapping_rule USING btree (type, \"order\")", + "table": "public.role_mapping_rule", + "columns": [ + "type", + "order" + ] + }, + { + "name": "IDX_bb66e404c35996b0d694617750", + "def": "CREATE INDEX \"IDX_bb66e404c35996b0d694617750\" ON public.role_mapping_rule USING btree (role)", + "table": "public.role_mapping_rule", + "columns": [ + "role" + ] + } + ], + "constraints": [ + { + "name": "role_mapping_rule_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.role_mapping_rule", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "role_mapping_rule_expression_not_null", + "type": "n", + "def": "NOT NULL expression", + "table": "public.role_mapping_rule", + "referenced_table": "", + "columns": [ + "expression" + ] + }, + { + "name": "role_mapping_rule_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.role_mapping_rule", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "role_mapping_rule_order_not_null", + "type": "n", + "def": "NOT NULL \"order\"", + "table": "public.role_mapping_rule", + "referenced_table": "", + "columns": [ + "order" + ] + }, + { + "name": "role_mapping_rule_role_not_null", + "type": "n", + "def": "NOT NULL role", + "table": "public.role_mapping_rule", + "referenced_table": "", + "columns": [ + "role" + ] + }, + { + "name": "role_mapping_rule_type_not_null", + "type": "n", + "def": "NOT NULL type", + "table": "public.role_mapping_rule", + "referenced_table": "", + "columns": [ + "type" + ] + }, + { + "name": "role_mapping_rule_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.role_mapping_rule", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_bb66e404c35996b0d6946177501", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (role) REFERENCES role(slug) ON UPDATE CASCADE ON DELETE CASCADE", + "table": "public.role_mapping_rule", + "referenced_table": "public.role", + "columns": [ + "role" + ], + "referenced_columns": [ + "slug" + ] + }, + { + "name": "PK_d772c8ec1a89b52d31c882bc560", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.role_mapping_rule", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "UQ_b33ac896ad3099fc8de36fdc1c4", + "type": "UNIQUE", + "def": "UNIQUE (type, \"order\")", + "table": "public.role_mapping_rule", + "referenced_table": "", + "columns": [ + "type", + "order" + ] + } + ] + }, + { + "name": "public.role_mapping_rule_project", + "type": "BASE TABLE", + "columns": [ + { + "name": "roleMappingRuleId", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": false + } + ], + "indexes": [ + { + "name": "PK_198c5b5aea509d139274efcaf9a", + "def": "CREATE UNIQUE INDEX \"PK_198c5b5aea509d139274efcaf9a\" ON public.role_mapping_rule_project USING btree (\"roleMappingRuleId\", \"projectId\")", + "table": "public.role_mapping_rule_project", + "columns": [ + "roleMappingRuleId", + "projectId" + ] + }, + { + "name": "IDX_35a78869286c65d9330d02b88f", + "def": "CREATE INDEX \"IDX_35a78869286c65d9330d02b88f\" ON public.role_mapping_rule_project USING btree (\"projectId\")", + "table": "public.role_mapping_rule_project", + "columns": [ + "projectId" + ] + } + ], + "constraints": [ + { + "name": "role_mapping_rule_project_projectId_not_null", + "type": "n", + "def": "NOT NULL \"projectId\"", + "table": "public.role_mapping_rule_project", + "referenced_table": "", + "columns": [ + "projectId" + ] + }, + { + "name": "role_mapping_rule_project_roleMappingRuleId_not_null", + "type": "n", + "def": "NOT NULL \"roleMappingRuleId\"", + "table": "public.role_mapping_rule_project", + "referenced_table": "", + "columns": [ + "roleMappingRuleId" + ] + }, + { + "name": "FK_35a78869286c65d9330d02b88f5", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE", + "table": "public.role_mapping_rule_project", + "referenced_table": "public.project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_dd7ce4dfa09e95b36a626bd9de3", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"roleMappingRuleId\") REFERENCES role_mapping_rule(id) ON DELETE CASCADE", + "table": "public.role_mapping_rule_project", + "referenced_table": "public.role_mapping_rule", + "columns": [ + "roleMappingRuleId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_198c5b5aea509d139274efcaf9a", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"roleMappingRuleId\", \"projectId\")", + "table": "public.role_mapping_rule_project", + "referenced_table": "", + "columns": [ + "roleMappingRuleId", + "projectId" + ] + } + ] + }, + { + "name": "public.credential_dependency", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "integer", + "nullable": false + }, + { + "name": "credentialId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "dependencyType", + "type": "varchar(64)", + "nullable": false + }, + { + "name": "dependencyId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_80212729ed0ffa0709417ab28f4", + "def": "CREATE UNIQUE INDEX \"PK_80212729ed0ffa0709417ab28f4\" ON public.credential_dependency USING btree (id)", + "table": "public.credential_dependency", + "columns": [ + "id" + ] + }, + { + "name": "IDX_5ec8e8c8d3539f3696cf73b43b", + "def": "CREATE INDEX \"IDX_5ec8e8c8d3539f3696cf73b43b\" ON public.credential_dependency USING btree (\"credentialId\")", + "table": "public.credential_dependency", + "columns": [ + "credentialId" + ] + }, + { + "name": "IDX_91ee85fa9619dd6776725e117b", + "def": "CREATE INDEX \"IDX_91ee85fa9619dd6776725e117b\" ON public.credential_dependency USING btree (\"dependencyType\", \"dependencyId\")", + "table": "public.credential_dependency", + "columns": [ + "dependencyType", + "dependencyId" + ] + }, + { + "name": "IDX_credential_dependency_credentialId_dependencyType_dependenc", + "def": "CREATE UNIQUE INDEX \"IDX_credential_dependency_credentialId_dependencyType_dependenc\" ON public.credential_dependency USING btree (\"credentialId\", \"dependencyType\", \"dependencyId\")", + "table": "public.credential_dependency", + "columns": [ + "credentialId", + "dependencyType", + "dependencyId" + ] + } + ], + "constraints": [ + { + "name": "credential_dependency_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.credential_dependency", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "credential_dependency_credentialId_not_null", + "type": "n", + "def": "NOT NULL \"credentialId\"", + "table": "public.credential_dependency", + "referenced_table": "", + "columns": [ + "credentialId" + ] + }, + { + "name": "credential_dependency_dependencyId_not_null", + "type": "n", + "def": "NOT NULL \"dependencyId\"", + "table": "public.credential_dependency", + "referenced_table": "", + "columns": [ + "dependencyId" + ] + }, + { + "name": "credential_dependency_dependencyType_not_null", + "type": "n", + "def": "NOT NULL \"dependencyType\"", + "table": "public.credential_dependency", + "referenced_table": "", + "columns": [ + "dependencyType" + ] + }, + { + "name": "credential_dependency_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.credential_dependency", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "FK_5ec8e8c8d3539f3696cf73b43bf", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"credentialId\") REFERENCES credentials_entity(id) ON DELETE CASCADE", + "table": "public.credential_dependency", + "referenced_table": "public.credentials_entity", + "columns": [ + "credentialId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_80212729ed0ffa0709417ab28f4", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.credential_dependency", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.instance_version_history", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "integer", + "nullable": false, + "default": "nextval('instance_version_history_id_seq'::regclass)" + }, + { + "name": "major", + "type": "integer", + "nullable": false + }, + { + "name": "minor", + "type": "integer", + "nullable": false + }, + { + "name": "patch", + "type": "integer", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_874f58cb616935bf49d9dbd67e9", + "def": "CREATE UNIQUE INDEX \"PK_874f58cb616935bf49d9dbd67e9\" ON public.instance_version_history USING btree (id)", + "table": "public.instance_version_history", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "instance_version_history_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.instance_version_history", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "instance_version_history_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.instance_version_history", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "instance_version_history_major_not_null", + "type": "n", + "def": "NOT NULL major", + "table": "public.instance_version_history", + "referenced_table": "", + "columns": [ + "major" + ] + }, + { + "name": "instance_version_history_minor_not_null", + "type": "n", + "def": "NOT NULL minor", + "table": "public.instance_version_history", + "referenced_table": "", + "columns": [ + "minor" + ] + }, + { + "name": "instance_version_history_patch_not_null", + "type": "n", + "def": "NOT NULL patch", + "table": "public.instance_version_history", + "referenced_table": "", + "columns": [ + "patch" + ] + }, + { + "name": "PK_874f58cb616935bf49d9dbd67e9", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.instance_version_history", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.instance_ai_threads", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "uuid", + "nullable": false + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "title", + "type": "text", + "nullable": false, + "default": "''::text" + }, + { + "name": "metadata", + "type": "json", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": false, + "comment": "Project this thread is scoped to" + } + ], + "indexes": [ + { + "name": "PK_35575100e45cdedeb89ae0643e9", + "def": "CREATE UNIQUE INDEX \"PK_35575100e45cdedeb89ae0643e9\" ON public.instance_ai_threads USING btree (id)", + "table": "public.instance_ai_threads", + "columns": [ + "id" + ] + }, + { + "name": "IDX_f36dea4d38fe92e0e8f44d5a56", + "def": "CREATE INDEX \"IDX_f36dea4d38fe92e0e8f44d5a56\" ON public.instance_ai_threads USING btree (\"resourceId\")", + "table": "public.instance_ai_threads", + "columns": [ + "resourceId" + ] + }, + { + "name": "IDX_instance_ai_threads_projectId", + "def": "CREATE INDEX \"IDX_instance_ai_threads_projectId\" ON public.instance_ai_threads USING btree (\"projectId\")", + "table": "public.instance_ai_threads", + "columns": [ + "projectId" + ] + } + ], + "constraints": [ + { + "name": "instance_ai_threads_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.instance_ai_threads", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "instance_ai_threads_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.instance_ai_threads", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "instance_ai_threads_projectId_not_null", + "type": "n", + "def": "NOT NULL \"projectId\"", + "table": "public.instance_ai_threads", + "referenced_table": "", + "columns": [ + "projectId" + ] + }, + { + "name": "instance_ai_threads_resourceId_not_null", + "type": "n", + "def": "NOT NULL \"resourceId\"", + "table": "public.instance_ai_threads", + "referenced_table": "", + "columns": [ + "resourceId" + ] + }, + { + "name": "instance_ai_threads_title_not_null", + "type": "n", + "def": "NOT NULL title", + "table": "public.instance_ai_threads", + "referenced_table": "", + "columns": [ + "title" + ] + }, + { + "name": "instance_ai_threads_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.instance_ai_threads", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_instance_ai_threads_projectId", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE", + "table": "public.instance_ai_threads", + "referenced_table": "public.project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_35575100e45cdedeb89ae0643e9", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.instance_ai_threads", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.instance_ai_messages", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "threadId", + "type": "uuid", + "nullable": false + }, + { + "name": "content", + "type": "text", + "nullable": false + }, + { + "name": "role", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(32)", + "nullable": true + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_156c6f287225e9befe0181bb02b", + "def": "CREATE UNIQUE INDEX \"PK_156c6f287225e9befe0181bb02b\" ON public.instance_ai_messages USING btree (id)", + "table": "public.instance_ai_messages", + "columns": [ + "id" + ] + }, + { + "name": "IDX_1eeb64cb9d66a927988de759e6", + "def": "CREATE INDEX \"IDX_1eeb64cb9d66a927988de759e6\" ON public.instance_ai_messages USING btree (\"threadId\")", + "table": "public.instance_ai_messages", + "columns": [ + "threadId" + ] + }, + { + "name": "IDX_76e212c6867fbaa06bf0decd6f", + "def": "CREATE INDEX \"IDX_76e212c6867fbaa06bf0decd6f\" ON public.instance_ai_messages USING btree (\"resourceId\")", + "table": "public.instance_ai_messages", + "columns": [ + "resourceId" + ] + } + ], + "constraints": [ + { + "name": "instance_ai_messages_content_not_null", + "type": "n", + "def": "NOT NULL content", + "table": "public.instance_ai_messages", + "referenced_table": "", + "columns": [ + "content" + ] + }, + { + "name": "instance_ai_messages_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.instance_ai_messages", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "instance_ai_messages_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.instance_ai_messages", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "instance_ai_messages_role_not_null", + "type": "n", + "def": "NOT NULL role", + "table": "public.instance_ai_messages", + "referenced_table": "", + "columns": [ + "role" + ] + }, + { + "name": "instance_ai_messages_threadId_not_null", + "type": "n", + "def": "NOT NULL \"threadId\"", + "table": "public.instance_ai_messages", + "referenced_table": "", + "columns": [ + "threadId" + ] + }, + { + "name": "instance_ai_messages_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.instance_ai_messages", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_1eeb64cb9d66a927988de759e6e", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"threadId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE", + "table": "public.instance_ai_messages", + "referenced_table": "public.instance_ai_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_156c6f287225e9befe0181bb02b", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.instance_ai_messages", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.instance_ai_resources", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "workingMemory", + "type": "text", + "nullable": true + }, + { + "name": "metadata", + "type": "json", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_45b5b0b6f715dae4292b86603d8", + "def": "CREATE UNIQUE INDEX \"PK_45b5b0b6f715dae4292b86603d8\" ON public.instance_ai_resources USING btree (id)", + "table": "public.instance_ai_resources", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "instance_ai_resources_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.instance_ai_resources", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "instance_ai_resources_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.instance_ai_resources", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "instance_ai_resources_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.instance_ai_resources", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "PK_45b5b0b6f715dae4292b86603d8", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.instance_ai_resources", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.instance_ai_observational_memory", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "lookupKey", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "scope", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "threadId", + "type": "uuid", + "nullable": true + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "activeObservations", + "type": "text", + "nullable": false, + "default": "''::text" + }, + { + "name": "originType", + "type": "varchar(32)", + "nullable": false + }, + { + "name": "config", + "type": "text", + "nullable": false + }, + { + "name": "generationCount", + "type": "integer", + "nullable": false, + "default": "0" + }, + { + "name": "lastObservedAt", + "type": "timestamp(3) with time zone", + "nullable": true + }, + { + "name": "pendingMessageTokens", + "type": "integer", + "nullable": false, + "default": "0" + }, + { + "name": "totalTokensObserved", + "type": "integer", + "nullable": false, + "default": "0" + }, + { + "name": "observationTokenCount", + "type": "integer", + "nullable": false, + "default": "0" + }, + { + "name": "isObserving", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "isReflecting", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "observedMessageIds", + "type": "json", + "nullable": true + }, + { + "name": "observedTimezone", + "type": "varchar", + "nullable": true + }, + { + "name": "bufferedObservations", + "type": "text", + "nullable": true + }, + { + "name": "bufferedObservationTokens", + "type": "integer", + "nullable": true + }, + { + "name": "bufferedMessageIds", + "type": "json", + "nullable": true + }, + { + "name": "bufferedReflection", + "type": "text", + "nullable": true + }, + { + "name": "bufferedReflectionTokens", + "type": "integer", + "nullable": true + }, + { + "name": "bufferedReflectionInputTokens", + "type": "integer", + "nullable": true + }, + { + "name": "reflectedObservationLineCount", + "type": "integer", + "nullable": true + }, + { + "name": "bufferedObservationChunks", + "type": "json", + "nullable": true + }, + { + "name": "isBufferingObservation", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "isBufferingReflection", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "lastBufferedAtTokens", + "type": "integer", + "nullable": false, + "default": "0" + }, + { + "name": "lastBufferedAtTime", + "type": "timestamp(3) with time zone", + "nullable": true + }, + { + "name": "metadata", + "type": "json", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_7192dd00cddba039bf1d3e6a098", + "def": "CREATE UNIQUE INDEX \"PK_7192dd00cddba039bf1d3e6a098\" ON public.instance_ai_observational_memory USING btree (id)", + "table": "public.instance_ai_observational_memory", + "columns": [ + "id" + ] + }, + { + "name": "IDX_92f13cb6bc694227e069447f7b", + "def": "CREATE INDEX \"IDX_92f13cb6bc694227e069447f7b\" ON public.instance_ai_observational_memory USING btree (\"lookupKey\")", + "table": "public.instance_ai_observational_memory", + "columns": [ + "lookupKey" + ] + }, + { + "name": "IDX_a680ac96aae02dc887bbaac512", + "def": "CREATE UNIQUE INDEX \"IDX_a680ac96aae02dc887bbaac512\" ON public.instance_ai_observational_memory USING btree (scope, \"threadId\", \"resourceId\")", + "table": "public.instance_ai_observational_memory", + "columns": [ + "scope", + "threadId", + "resourceId" + ] + } + ], + "constraints": [ + { + "name": "instance_ai_observational_memor_isBufferingObservation_not_null", + "type": "n", + "def": "NOT NULL \"isBufferingObservation\"", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "isBufferingObservation" + ] + }, + { + "name": "instance_ai_observational_memory_activeObservations_not_null", + "type": "n", + "def": "NOT NULL \"activeObservations\"", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "activeObservations" + ] + }, + { + "name": "instance_ai_observational_memory_config_not_null", + "type": "n", + "def": "NOT NULL config", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "config" + ] + }, + { + "name": "instance_ai_observational_memory_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "instance_ai_observational_memory_generationCount_not_null", + "type": "n", + "def": "NOT NULL \"generationCount\"", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "generationCount" + ] + }, + { + "name": "instance_ai_observational_memory_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "instance_ai_observational_memory_isBufferingReflection_not_null", + "type": "n", + "def": "NOT NULL \"isBufferingReflection\"", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "isBufferingReflection" + ] + }, + { + "name": "instance_ai_observational_memory_isObserving_not_null", + "type": "n", + "def": "NOT NULL \"isObserving\"", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "isObserving" + ] + }, + { + "name": "instance_ai_observational_memory_isReflecting_not_null", + "type": "n", + "def": "NOT NULL \"isReflecting\"", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "isReflecting" + ] + }, + { + "name": "instance_ai_observational_memory_lastBufferedAtTokens_not_null", + "type": "n", + "def": "NOT NULL \"lastBufferedAtTokens\"", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "lastBufferedAtTokens" + ] + }, + { + "name": "instance_ai_observational_memory_lookupKey_not_null", + "type": "n", + "def": "NOT NULL \"lookupKey\"", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "lookupKey" + ] + }, + { + "name": "instance_ai_observational_memory_observationTokenCount_not_null", + "type": "n", + "def": "NOT NULL \"observationTokenCount\"", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "observationTokenCount" + ] + }, + { + "name": "instance_ai_observational_memory_originType_not_null", + "type": "n", + "def": "NOT NULL \"originType\"", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "originType" + ] + }, + { + "name": "instance_ai_observational_memory_pendingMessageTokens_not_null", + "type": "n", + "def": "NOT NULL \"pendingMessageTokens\"", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "pendingMessageTokens" + ] + }, + { + "name": "instance_ai_observational_memory_resourceId_not_null", + "type": "n", + "def": "NOT NULL \"resourceId\"", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "resourceId" + ] + }, + { + "name": "instance_ai_observational_memory_scope_not_null", + "type": "n", + "def": "NOT NULL scope", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "scope" + ] + }, + { + "name": "instance_ai_observational_memory_totalTokensObserved_not_null", + "type": "n", + "def": "NOT NULL \"totalTokensObserved\"", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "totalTokensObserved" + ] + }, + { + "name": "instance_ai_observational_memory_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_34018c303885cd37093458e6409", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"threadId\") REFERENCES instance_ai_threads(id) ON DELETE SET NULL", + "table": "public.instance_ai_observational_memory", + "referenced_table": "public.instance_ai_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_7192dd00cddba039bf1d3e6a098", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.instance_ai_observational_memory", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.instance_ai_workflow_snapshots", + "type": "BASE TABLE", + "columns": [ + { + "name": "runId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "workflowName", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "status", + "type": "varchar", + "nullable": true + }, + { + "name": "snapshot", + "type": "text", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_93f2696eb321dfe1d7defe7073f", + "def": "CREATE UNIQUE INDEX \"PK_93f2696eb321dfe1d7defe7073f\" ON public.instance_ai_workflow_snapshots USING btree (\"runId\", \"workflowName\")", + "table": "public.instance_ai_workflow_snapshots", + "columns": [ + "runId", + "workflowName" + ] + }, + { + "name": "IDX_a371ee6b8e0ebb5635f8baa46d", + "def": "CREATE INDEX \"IDX_a371ee6b8e0ebb5635f8baa46d\" ON public.instance_ai_workflow_snapshots USING btree (\"workflowName\", status)", + "table": "public.instance_ai_workflow_snapshots", + "columns": [ + "workflowName", + "status" + ] + } + ], + "constraints": [ + { + "name": "instance_ai_workflow_snapshots_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.instance_ai_workflow_snapshots", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "instance_ai_workflow_snapshots_runId_not_null", + "type": "n", + "def": "NOT NULL \"runId\"", + "table": "public.instance_ai_workflow_snapshots", + "referenced_table": "", + "columns": [ + "runId" + ] + }, + { + "name": "instance_ai_workflow_snapshots_snapshot_not_null", + "type": "n", + "def": "NOT NULL snapshot", + "table": "public.instance_ai_workflow_snapshots", + "referenced_table": "", + "columns": [ + "snapshot" + ] + }, + { + "name": "instance_ai_workflow_snapshots_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.instance_ai_workflow_snapshots", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "instance_ai_workflow_snapshots_workflowName_not_null", + "type": "n", + "def": "NOT NULL \"workflowName\"", + "table": "public.instance_ai_workflow_snapshots", + "referenced_table": "", + "columns": [ + "workflowName" + ] + }, + { + "name": "PK_93f2696eb321dfe1d7defe7073f", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"runId\", \"workflowName\")", + "table": "public.instance_ai_workflow_snapshots", + "referenced_table": "", + "columns": [ + "runId", + "workflowName" + ] + } + ] + }, + { + "name": "public.instance_ai_run_snapshots", + "type": "BASE TABLE", + "columns": [ + { + "name": "threadId", + "type": "uuid", + "nullable": false + }, + { + "name": "runId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "messageGroupId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "runIds", + "type": "json", + "nullable": true + }, + { + "name": "tree", + "type": "text", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "langsmithRunId", + "type": "varchar(36)", + "nullable": true, + "comment": "LangSmith run ID (UUID v4, e.g. \"f47ac10b-58cc-4372-a567-0e02b2c3d479\")." + }, + { + "name": "langsmithTraceId", + "type": "varchar(36)", + "nullable": true, + "comment": "LangSmith trace ID (UUID v4, e.g. \"f47ac10b-58cc-4372-a567-0e02b2c3d479\")." + }, + { + "name": "traceId", + "type": "varchar(64)", + "nullable": true, + "comment": "OpenTelemetry trace ID for the root Instance AI run." + }, + { + "name": "spanId", + "type": "varchar(64)", + "nullable": true, + "comment": "OpenTelemetry span ID for the root Instance AI run." + } + ], + "indexes": [ + { + "name": "PK_0a5fc9690a84950ebf1416fb146", + "def": "CREATE UNIQUE INDEX \"PK_0a5fc9690a84950ebf1416fb146\" ON public.instance_ai_run_snapshots USING btree (\"threadId\", \"runId\")", + "table": "public.instance_ai_run_snapshots", + "columns": [ + "threadId", + "runId" + ] + }, + { + "name": "IDX_d926c16c2ad9728cb9a81790c0", + "def": "CREATE INDEX \"IDX_d926c16c2ad9728cb9a81790c0\" ON public.instance_ai_run_snapshots USING btree (\"threadId\", \"messageGroupId\")", + "table": "public.instance_ai_run_snapshots", + "columns": [ + "threadId", + "messageGroupId" + ] + }, + { + "name": "IDX_d3a2bc880e7a8626802e5474ad", + "def": "CREATE INDEX \"IDX_d3a2bc880e7a8626802e5474ad\" ON public.instance_ai_run_snapshots USING btree (\"threadId\", \"createdAt\")", + "table": "public.instance_ai_run_snapshots", + "columns": [ + "threadId", + "createdAt" + ] + } + ], + "constraints": [ + { + "name": "instance_ai_run_snapshots_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.instance_ai_run_snapshots", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "instance_ai_run_snapshots_runId_not_null", + "type": "n", + "def": "NOT NULL \"runId\"", + "table": "public.instance_ai_run_snapshots", + "referenced_table": "", + "columns": [ + "runId" + ] + }, + { + "name": "instance_ai_run_snapshots_threadId_not_null", + "type": "n", + "def": "NOT NULL \"threadId\"", + "table": "public.instance_ai_run_snapshots", + "referenced_table": "", + "columns": [ + "threadId" + ] + }, + { + "name": "instance_ai_run_snapshots_tree_not_null", + "type": "n", + "def": "NOT NULL tree", + "table": "public.instance_ai_run_snapshots", + "referenced_table": "", + "columns": [ + "tree" + ] + }, + { + "name": "instance_ai_run_snapshots_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.instance_ai_run_snapshots", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_2f63fa21d09d7918f347ddbdf70", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"threadId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE", + "table": "public.instance_ai_run_snapshots", + "referenced_table": "public.instance_ai_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_0a5fc9690a84950ebf1416fb146", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"threadId\", \"runId\")", + "table": "public.instance_ai_run_snapshots", + "referenced_table": "", + "columns": [ + "threadId", + "runId" + ] + } + ] + }, + { + "name": "public.instance_ai_iteration_logs", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "threadId", + "type": "uuid", + "nullable": false + }, + { + "name": "taskKey", + "type": "varchar", + "nullable": false + }, + { + "name": "entry", + "type": "text", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_21c2b214b44bc6c34a6d3551c90", + "def": "CREATE UNIQUE INDEX \"PK_21c2b214b44bc6c34a6d3551c90\" ON public.instance_ai_iteration_logs USING btree (id)", + "table": "public.instance_ai_iteration_logs", + "columns": [ + "id" + ] + }, + { + "name": "IDX_02751202c9a2ad75f2d8e14f5e", + "def": "CREATE INDEX \"IDX_02751202c9a2ad75f2d8e14f5e\" ON public.instance_ai_iteration_logs USING btree (\"threadId\", \"taskKey\", \"createdAt\")", + "table": "public.instance_ai_iteration_logs", + "columns": [ + "threadId", + "taskKey", + "createdAt" + ] + } + ], + "constraints": [ + { + "name": "instance_ai_iteration_logs_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.instance_ai_iteration_logs", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "instance_ai_iteration_logs_entry_not_null", + "type": "n", + "def": "NOT NULL entry", + "table": "public.instance_ai_iteration_logs", + "referenced_table": "", + "columns": [ + "entry" + ] + }, + { + "name": "instance_ai_iteration_logs_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.instance_ai_iteration_logs", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "instance_ai_iteration_logs_taskKey_not_null", + "type": "n", + "def": "NOT NULL \"taskKey\"", + "table": "public.instance_ai_iteration_logs", + "referenced_table": "", + "columns": [ + "taskKey" + ] + }, + { + "name": "instance_ai_iteration_logs_threadId_not_null", + "type": "n", + "def": "NOT NULL \"threadId\"", + "table": "public.instance_ai_iteration_logs", + "referenced_table": "", + "columns": [ + "threadId" + ] + }, + { + "name": "instance_ai_iteration_logs_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.instance_ai_iteration_logs", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_8bfcc6c51fd3d69b1eae8aebd49", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"threadId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE", + "table": "public.instance_ai_iteration_logs", + "referenced_table": "public.instance_ai_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_21c2b214b44bc6c34a6d3551c90", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.instance_ai_iteration_logs", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.token_exchange_jti", + "type": "BASE TABLE", + "columns": [ + { + "name": "jti", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "expiresAt", + "type": "timestamp(3) with time zone", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false + } + ], + "indexes": [ + { + "name": "PK_d8e8a6f737d530fdd2dd716e89c", + "def": "CREATE UNIQUE INDEX \"PK_d8e8a6f737d530fdd2dd716e89c\" ON public.token_exchange_jti USING btree (jti)", + "table": "public.token_exchange_jti", + "columns": [ + "jti" + ] + } + ], + "constraints": [ + { + "name": "token_exchange_jti_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.token_exchange_jti", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "token_exchange_jti_expiresAt_not_null", + "type": "n", + "def": "NOT NULL \"expiresAt\"", + "table": "public.token_exchange_jti", + "referenced_table": "", + "columns": [ + "expiresAt" + ] + }, + { + "name": "token_exchange_jti_jti_not_null", + "type": "n", + "def": "NOT NULL jti", + "table": "public.token_exchange_jti", + "referenced_table": "", + "columns": [ + "jti" + ] + }, + { + "name": "PK_d8e8a6f737d530fdd2dd716e89c", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (jti)", + "table": "public.token_exchange_jti", + "referenced_table": "", + "columns": [ + "jti" + ] + } + ] + }, + { + "name": "public.trusted_key_source", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(32)", + "nullable": false + }, + { + "name": "config", + "type": "text", + "nullable": false + }, + { + "name": "status", + "type": "varchar(32)", + "nullable": false, + "default": "'pending'::character varying" + }, + { + "name": "lastError", + "type": "text", + "nullable": true + }, + { + "name": "lastRefreshedAt", + "type": "timestamp(3) with time zone", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_99e8908ce2c2cdccce487db7fc6", + "def": "CREATE UNIQUE INDEX \"PK_99e8908ce2c2cdccce487db7fc6\" ON public.trusted_key_source USING btree (id)", + "table": "public.trusted_key_source", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "trusted_key_source_config_not_null", + "type": "n", + "def": "NOT NULL config", + "table": "public.trusted_key_source", + "referenced_table": "", + "columns": [ + "config" + ] + }, + { + "name": "trusted_key_source_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.trusted_key_source", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "trusted_key_source_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.trusted_key_source", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "trusted_key_source_status_not_null", + "type": "n", + "def": "NOT NULL status", + "table": "public.trusted_key_source", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "trusted_key_source_type_not_null", + "type": "n", + "def": "NOT NULL type", + "table": "public.trusted_key_source", + "referenced_table": "", + "columns": [ + "type" + ] + }, + { + "name": "trusted_key_source_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.trusted_key_source", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "PK_99e8908ce2c2cdccce487db7fc6", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.trusted_key_source", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.trusted_key", + "type": "BASE TABLE", + "columns": [ + { + "name": "sourceId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "kid", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "data", + "type": "text", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_dc7d93798f3dbb6959f974c97e1", + "def": "CREATE UNIQUE INDEX \"PK_dc7d93798f3dbb6959f974c97e1\" ON public.trusted_key USING btree (\"sourceId\", kid)", + "table": "public.trusted_key", + "columns": [ + "sourceId", + "kid" + ] + } + ], + "constraints": [ + { + "name": "trusted_key_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.trusted_key", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "trusted_key_data_not_null", + "type": "n", + "def": "NOT NULL data", + "table": "public.trusted_key", + "referenced_table": "", + "columns": [ + "data" + ] + }, + { + "name": "trusted_key_kid_not_null", + "type": "n", + "def": "NOT NULL kid", + "table": "public.trusted_key", + "referenced_table": "", + "columns": [ + "kid" + ] + }, + { + "name": "trusted_key_sourceId_not_null", + "type": "n", + "def": "NOT NULL \"sourceId\"", + "table": "public.trusted_key", + "referenced_table": "", + "columns": [ + "sourceId" + ] + }, + { + "name": "FK_8c2938d746943dd8f608d23c891", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"sourceId\") REFERENCES trusted_key_source(id) ON DELETE CASCADE", + "table": "public.trusted_key", + "referenced_table": "public.trusted_key_source", + "columns": [ + "sourceId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_dc7d93798f3dbb6959f974c97e1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"sourceId\", kid)", + "table": "public.trusted_key", + "referenced_table": "", + "columns": [ + "sourceId", + "kid" + ] + } + ] + }, + { + "name": "public.user_favorites", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "integer", + "nullable": false + }, + { + "name": "userId", + "type": "uuid", + "nullable": false + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "resourceType", + "type": "varchar(64)", + "nullable": false + } + ], + "indexes": [ + { + "name": "PK_6c472a19a7423cfbbf6b7c75939", + "def": "CREATE UNIQUE INDEX \"PK_6c472a19a7423cfbbf6b7c75939\" ON public.user_favorites USING btree (id)", + "table": "public.user_favorites", + "columns": [ + "id" + ] + }, + { + "name": "UQ_cf6ae658ead9ffc124723413c65", + "def": "CREATE UNIQUE INDEX \"UQ_cf6ae658ead9ffc124723413c65\" ON public.user_favorites USING btree (\"userId\", \"resourceId\", \"resourceType\")", + "table": "public.user_favorites", + "columns": [ + "userId", + "resourceId", + "resourceType" + ] + }, + { + "name": "IDX_1dd5c393ad0517be3c31a7af83", + "def": "CREATE INDEX \"IDX_1dd5c393ad0517be3c31a7af83\" ON public.user_favorites USING btree (\"userId\")", + "table": "public.user_favorites", + "columns": [ + "userId" + ] + }, + { + "name": "IDX_1d11050a381548c42c32cc25c4", + "def": "CREATE INDEX \"IDX_1d11050a381548c42c32cc25c4\" ON public.user_favorites USING btree (\"resourceType\", \"resourceId\")", + "table": "public.user_favorites", + "columns": [ + "resourceType", + "resourceId" + ] + } + ], + "constraints": [ + { + "name": "user_favorites_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.user_favorites", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "user_favorites_resourceId_not_null", + "type": "n", + "def": "NOT NULL \"resourceId\"", + "table": "public.user_favorites", + "referenced_table": "", + "columns": [ + "resourceId" + ] + }, + { + "name": "user_favorites_resourceType_not_null", + "type": "n", + "def": "NOT NULL \"resourceType\"", + "table": "public.user_favorites", + "referenced_table": "", + "columns": [ + "resourceType" + ] + }, + { + "name": "user_favorites_userId_not_null", + "type": "n", + "def": "NOT NULL \"userId\"", + "table": "public.user_favorites", + "referenced_table": "", + "columns": [ + "userId" + ] + }, + { + "name": "FK_1dd5c393ad0517be3c31a7af836", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE", + "table": "public.user_favorites", + "referenced_table": "public.user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_6c472a19a7423cfbbf6b7c75939", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.user_favorites", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "UQ_cf6ae658ead9ffc124723413c65", + "type": "UNIQUE", + "def": "UNIQUE (\"userId\", \"resourceId\", \"resourceType\")", + "table": "public.user_favorites", + "referenced_table": "", + "columns": [ + "userId", + "resourceId", + "resourceType" + ] + } + ] + }, + { + "name": "public.deployment_key", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(64)", + "nullable": false + }, + { + "name": "value", + "type": "text", + "nullable": false + }, + { + "name": "algorithm", + "type": "varchar(20)", + "nullable": true + }, + { + "name": "status", + "type": "varchar(20)", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_94bb7aeb5def5a0284a5fe9f9a0", + "def": "CREATE UNIQUE INDEX \"PK_94bb7aeb5def5a0284a5fe9f9a0\" ON public.deployment_key USING btree (id)", + "table": "public.deployment_key", + "columns": [ + "id" + ] + }, + { + "name": "IDX_deployment_key_data_encryption_active", + "def": "CREATE UNIQUE INDEX \"IDX_deployment_key_data_encryption_active\" ON public.deployment_key USING btree (type) WHERE (((status)::text = 'active'::text) AND ((type)::text = 'data_encryption'::text))", + "table": "public.deployment_key", + "columns": [ + "type" + ] + }, + { + "name": "IDX_deployment_key_instance_id_active", + "def": "CREATE UNIQUE INDEX \"IDX_deployment_key_instance_id_active\" ON public.deployment_key USING btree (type) WHERE (((status)::text = 'active'::text) AND ((type)::text = 'instance.id'::text))", + "table": "public.deployment_key", + "columns": [ + "type" + ] + }, + { + "name": "IDX_deployment_key_signing_jwt_active", + "def": "CREATE UNIQUE INDEX \"IDX_deployment_key_signing_jwt_active\" ON public.deployment_key USING btree (type) WHERE (((status)::text = 'active'::text) AND ((type)::text = 'signing.jwt'::text))", + "table": "public.deployment_key", + "columns": [ + "type" + ] + }, + { + "name": "IDX_deployment_key_signing_hmac_active", + "def": "CREATE UNIQUE INDEX \"IDX_deployment_key_signing_hmac_active\" ON public.deployment_key USING btree (type) WHERE (((status)::text = 'active'::text) AND ((type)::text = 'signing.hmac'::text))", + "table": "public.deployment_key", + "columns": [ + "type" + ] + }, + { + "name": "IDX_deployment_key_signing_binary_data_active", + "def": "CREATE UNIQUE INDEX \"IDX_deployment_key_signing_binary_data_active\" ON public.deployment_key USING btree (type) WHERE (((status)::text = 'active'::text) AND ((type)::text = 'signing.binary_data'::text))", + "table": "public.deployment_key", + "columns": [ + "type" + ] + }, + { + "name": "IDX_deployment_key_jwe_private_key_active", + "def": "CREATE UNIQUE INDEX \"IDX_deployment_key_jwe_private_key_active\" ON public.deployment_key USING btree (type, algorithm) WHERE (((status)::text = 'active'::text) AND ((type)::text = 'jwe.private-key'::text))", + "table": "public.deployment_key", + "columns": [ + "type", + "algorithm" + ] + } + ], + "constraints": [ + { + "name": "deployment_key_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.deployment_key", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "deployment_key_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.deployment_key", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "deployment_key_status_not_null", + "type": "n", + "def": "NOT NULL status", + "table": "public.deployment_key", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "deployment_key_type_not_null", + "type": "n", + "def": "NOT NULL type", + "table": "public.deployment_key", + "referenced_table": "", + "columns": [ + "type" + ] + }, + { + "name": "deployment_key_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.deployment_key", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "deployment_key_value_not_null", + "type": "n", + "def": "NOT NULL value", + "table": "public.deployment_key", + "referenced_table": "", + "columns": [ + "value" + ] + }, + { + "name": "PK_94bb7aeb5def5a0284a5fe9f9a0", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.deployment_key", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.ai_builder_temporary_workflow", + "type": "BASE TABLE", + "columns": [ + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "threadId", + "type": "uuid", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_85a87a1ba0f61999fe11dc56325", + "def": "CREATE UNIQUE INDEX \"PK_85a87a1ba0f61999fe11dc56325\" ON public.ai_builder_temporary_workflow USING btree (\"workflowId\")", + "table": "public.ai_builder_temporary_workflow", + "columns": [ + "workflowId" + ] + }, + { + "name": "IDX_39b07732e819fb561d74c38763", + "def": "CREATE INDEX \"IDX_39b07732e819fb561d74c38763\" ON public.ai_builder_temporary_workflow USING btree (\"threadId\")", + "table": "public.ai_builder_temporary_workflow", + "columns": [ + "threadId" + ] + } + ], + "constraints": [ + { + "name": "ai_builder_temporary_workflow_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.ai_builder_temporary_workflow", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "ai_builder_temporary_workflow_threadId_not_null", + "type": "n", + "def": "NOT NULL \"threadId\"", + "table": "public.ai_builder_temporary_workflow", + "referenced_table": "", + "columns": [ + "threadId" + ] + }, + { + "name": "ai_builder_temporary_workflow_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.ai_builder_temporary_workflow", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "ai_builder_temporary_workflow_workflowId_not_null", + "type": "n", + "def": "NOT NULL \"workflowId\"", + "table": "public.ai_builder_temporary_workflow", + "referenced_table": "", + "columns": [ + "workflowId" + ] + }, + { + "name": "FK_85a87a1ba0f61999fe11dc56325", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE", + "table": "public.ai_builder_temporary_workflow", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_39b07732e819fb561d74c38763f", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"threadId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE", + "table": "public.ai_builder_temporary_workflow", + "referenced_table": "public.instance_ai_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_85a87a1ba0f61999fe11dc56325", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"workflowId\")", + "table": "public.ai_builder_temporary_workflow", + "referenced_table": "", + "columns": [ + "workflowId" + ] + } + ] + }, + { + "name": "public.evaluation_config", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "status", + "type": "varchar(16)", + "nullable": false, + "default": "'valid'::character varying" + }, + { + "name": "invalidReason", + "type": "varchar(64)", + "nullable": true + }, + { + "name": "datasetSource", + "type": "varchar(32)", + "nullable": false + }, + { + "name": "datasetRef", + "type": "json", + "nullable": false + }, + { + "name": "startNodeName", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "endNodeName", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "metrics", + "type": "json", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_59c14dccf8989df94070c2dcfda", + "def": "CREATE UNIQUE INDEX \"PK_59c14dccf8989df94070c2dcfda\" ON public.evaluation_config USING btree (id)", + "table": "public.evaluation_config", + "columns": [ + "id" + ] + }, + { + "name": "UQ_3c3c99a712e971835c52292e44c", + "def": "CREATE UNIQUE INDEX \"UQ_3c3c99a712e971835c52292e44c\" ON public.evaluation_config USING btree (\"workflowId\", name)", + "table": "public.evaluation_config", + "columns": [ + "workflowId", + "name" + ] + }, + { + "name": "IDX_fd7542bb123074760285dc1bbf", + "def": "CREATE INDEX \"IDX_fd7542bb123074760285dc1bbf\" ON public.evaluation_config USING btree (\"workflowId\")", + "table": "public.evaluation_config", + "columns": [ + "workflowId" + ] + } + ], + "constraints": [ + { + "name": "evaluation_config_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.evaluation_config", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "evaluation_config_datasetRef_not_null", + "type": "n", + "def": "NOT NULL \"datasetRef\"", + "table": "public.evaluation_config", + "referenced_table": "", + "columns": [ + "datasetRef" + ] + }, + { + "name": "evaluation_config_datasetSource_not_null", + "type": "n", + "def": "NOT NULL \"datasetSource\"", + "table": "public.evaluation_config", + "referenced_table": "", + "columns": [ + "datasetSource" + ] + }, + { + "name": "evaluation_config_endNodeName_not_null", + "type": "n", + "def": "NOT NULL \"endNodeName\"", + "table": "public.evaluation_config", + "referenced_table": "", + "columns": [ + "endNodeName" + ] + }, + { + "name": "evaluation_config_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.evaluation_config", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "evaluation_config_metrics_not_null", + "type": "n", + "def": "NOT NULL metrics", + "table": "public.evaluation_config", + "referenced_table": "", + "columns": [ + "metrics" + ] + }, + { + "name": "evaluation_config_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.evaluation_config", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "evaluation_config_startNodeName_not_null", + "type": "n", + "def": "NOT NULL \"startNodeName\"", + "table": "public.evaluation_config", + "referenced_table": "", + "columns": [ + "startNodeName" + ] + }, + { + "name": "evaluation_config_status_not_null", + "type": "n", + "def": "NOT NULL status", + "table": "public.evaluation_config", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "evaluation_config_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.evaluation_config", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "evaluation_config_workflowId_not_null", + "type": "n", + "def": "NOT NULL \"workflowId\"", + "table": "public.evaluation_config", + "referenced_table": "", + "columns": [ + "workflowId" + ] + }, + { + "name": "FK_fd7542bb123074760285dc1bbf3", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE", + "table": "public.evaluation_config", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_59c14dccf8989df94070c2dcfda", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.evaluation_config", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "UQ_3c3c99a712e971835c52292e44c", + "type": "UNIQUE", + "def": "UNIQUE (\"workflowId\", name)", + "table": "public.evaluation_config", + "referenced_table": "", + "columns": [ + "workflowId", + "name" + ] + } + ] + }, + { + "name": "public.evaluation_collection", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "description", + "type": "text", + "nullable": true + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "evaluationConfigId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "createdById", + "type": "uuid", + "nullable": true + }, + { + "name": "insightsCache", + "type": "json", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_e720b6efc1e45b878ebb0b2ca30", + "def": "CREATE UNIQUE INDEX \"PK_e720b6efc1e45b878ebb0b2ca30\" ON public.evaluation_collection USING btree (id)", + "table": "public.evaluation_collection", + "columns": [ + "id" + ] + }, + { + "name": "IDX_a48ce930c3bc7604894b8f0eaa", + "def": "CREATE INDEX \"IDX_a48ce930c3bc7604894b8f0eaa\" ON public.evaluation_collection USING btree (\"workflowId\")", + "table": "public.evaluation_collection", + "columns": [ + "workflowId" + ] + }, + { + "name": "IDX_d634a0c93fd7de68a87eab951b", + "def": "CREATE INDEX \"IDX_d634a0c93fd7de68a87eab951b\" ON public.evaluation_collection USING btree (\"evaluationConfigId\")", + "table": "public.evaluation_collection", + "columns": [ + "evaluationConfigId" + ] + } + ], + "constraints": [ + { + "name": "evaluation_collection_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.evaluation_collection", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "evaluation_collection_evaluationConfigId_not_null", + "type": "n", + "def": "NOT NULL \"evaluationConfigId\"", + "table": "public.evaluation_collection", + "referenced_table": "", + "columns": [ + "evaluationConfigId" + ] + }, + { + "name": "evaluation_collection_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.evaluation_collection", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "evaluation_collection_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.evaluation_collection", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "evaluation_collection_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.evaluation_collection", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "evaluation_collection_workflowId_not_null", + "type": "n", + "def": "NOT NULL \"workflowId\"", + "table": "public.evaluation_collection", + "referenced_table": "", + "columns": [ + "workflowId" + ] + }, + { + "name": "FK_f4561f38b5a22a4f090d5cd3eae", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"createdById\") REFERENCES \"user\"(id) ON DELETE SET NULL", + "table": "public.evaluation_collection", + "referenced_table": "public.user", + "columns": [ + "createdById" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_a48ce930c3bc7604894b8f0eaad", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE", + "table": "public.evaluation_collection", + "referenced_table": "public.workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_d634a0c93fd7de68a87eab951b2", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"evaluationConfigId\") REFERENCES evaluation_config(id) ON DELETE CASCADE", + "table": "public.evaluation_collection", + "referenced_table": "public.evaluation_config", + "columns": [ + "evaluationConfigId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_e720b6efc1e45b878ebb0b2ca30", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.evaluation_collection", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.agents", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "description", + "type": "varchar(512)", + "nullable": true + }, + { + "name": "projectId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "integrations", + "type": "json", + "nullable": false, + "default": "'[]'::json" + }, + { + "name": "schema", + "type": "json", + "nullable": true + }, + { + "name": "tools", + "type": "json", + "nullable": false, + "default": "'{}'::json" + }, + { + "name": "skills", + "type": "json", + "nullable": false, + "default": "'{}'::json" + }, + { + "name": "versionId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "activeVersionId", + "type": "varchar(36)", + "nullable": true + } + ], + "indexes": [ + { + "name": "PK_9c653f28ae19c5884d5baf6a1d9", + "def": "CREATE UNIQUE INDEX \"PK_9c653f28ae19c5884d5baf6a1d9\" ON public.agents USING btree (id)", + "table": "public.agents", + "columns": [ + "id" + ] + }, + { + "name": "IDX_a30d560207c4071d98aa03c179", + "def": "CREATE INDEX \"IDX_a30d560207c4071d98aa03c179\" ON public.agents USING btree (\"projectId\")", + "table": "public.agents", + "columns": [ + "projectId" + ] + }, + { + "name": "IDX_agents_projectId", + "def": "CREATE INDEX \"IDX_agents_projectId\" ON public.agents USING btree (\"projectId\")", + "table": "public.agents", + "columns": [ + "projectId" + ] + } + ], + "constraints": [ + { + "name": "agents_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agents", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agents_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.agents", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "agents_integrations_not_null", + "type": "n", + "def": "NOT NULL integrations", + "table": "public.agents", + "referenced_table": "", + "columns": [ + "integrations" + ] + }, + { + "name": "agents_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.agents", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "agents_projectId_not_null", + "type": "n", + "def": "NOT NULL \"projectId\"", + "table": "public.agents", + "referenced_table": "", + "columns": [ + "projectId" + ] + }, + { + "name": "agents_skills_not_null", + "type": "n", + "def": "NOT NULL skills", + "table": "public.agents", + "referenced_table": "", + "columns": [ + "skills" + ] + }, + { + "name": "agents_tools_not_null", + "type": "n", + "def": "NOT NULL tools", + "table": "public.agents", + "referenced_table": "", + "columns": [ + "tools" + ] + }, + { + "name": "agents_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agents", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_a30d560207c4071d98aa03c179c", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE", + "table": "public.agents", + "referenced_table": "public.project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_9c653f28ae19c5884d5baf6a1d9", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.agents", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "FK_940597dfe9753375309ce6aeea0", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"activeVersionId\") REFERENCES agent_history(\"versionId\") ON DELETE SET NULL", + "table": "public.agents", + "referenced_table": "public.agent_history", + "columns": [ + "activeVersionId" + ], + "referenced_columns": [ + "versionId" + ] + } + ] + }, + { + "name": "public.agent_checkpoints", + "type": "BASE TABLE", + "columns": [ + { + "name": "runId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "agentId", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "state", + "type": "text", + "nullable": true + }, + { + "name": "expired", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_50a27cbafa6806c9b162304b5fd", + "def": "CREATE UNIQUE INDEX \"PK_50a27cbafa6806c9b162304b5fd\" ON public.agent_checkpoints USING btree (\"runId\")", + "table": "public.agent_checkpoints", + "columns": [ + "runId" + ] + }, + { + "name": "IDX_5e31c210f896d539964bf99fe3", + "def": "CREATE INDEX \"IDX_5e31c210f896d539964bf99fe3\" ON public.agent_checkpoints USING btree (\"agentId\")", + "table": "public.agent_checkpoints", + "columns": [ + "agentId" + ] + } + ], + "constraints": [ + { + "name": "agent_checkpoints_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agent_checkpoints", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agent_checkpoints_expired_not_null", + "type": "n", + "def": "NOT NULL expired", + "table": "public.agent_checkpoints", + "referenced_table": "", + "columns": [ + "expired" + ] + }, + { + "name": "agent_checkpoints_runId_not_null", + "type": "n", + "def": "NOT NULL \"runId\"", + "table": "public.agent_checkpoints", + "referenced_table": "", + "columns": [ + "runId" + ] + }, + { + "name": "agent_checkpoints_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agent_checkpoints", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_5e31c210f896d539964bf99fe32", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE", + "table": "public.agent_checkpoints", + "referenced_table": "public.agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_50a27cbafa6806c9b162304b5fd", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"runId\")", + "table": "public.agent_checkpoints", + "referenced_table": "", + "columns": [ + "runId" + ] + } + ] + }, + { + "name": "public.agents_resources", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "metadata", + "type": "text", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_fa6b20b2d31a9991529dbf8ef7d", + "def": "CREATE UNIQUE INDEX \"PK_fa6b20b2d31a9991529dbf8ef7d\" ON public.agents_resources USING btree (id)", + "table": "public.agents_resources", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "agents_resources_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agents_resources", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agents_resources_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.agents_resources", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "agents_resources_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agents_resources", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "PK_fa6b20b2d31a9991529dbf8ef7d", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.agents_resources", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.agents_threads", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "title", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "metadata", + "type": "text", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "IDX_54fa1b94f34a409beafae567a4", + "def": "CREATE INDEX \"IDX_54fa1b94f34a409beafae567a4\" ON public.agents_threads USING btree (\"resourceId\")", + "table": "public.agents_threads", + "columns": [ + "resourceId" + ] + }, + { + "name": "PK_4a3feb0a13ffe315c009cce64e5", + "def": "CREATE UNIQUE INDEX \"PK_4a3feb0a13ffe315c009cce64e5\" ON public.agents_threads USING btree (id)", + "table": "public.agents_threads", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "agents_threads_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agents_threads", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agents_threads_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.agents_threads", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "agents_threads_resourceId_not_null", + "type": "n", + "def": "NOT NULL \"resourceId\"", + "table": "public.agents_threads", + "referenced_table": "", + "columns": [ + "resourceId" + ] + }, + { + "name": "agents_threads_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agents_threads", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "PK_4a3feb0a13ffe315c009cce64e5", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.agents_threads", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.agents_messages", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "threadId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "role", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "content", + "type": "json", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_81020dc608dfb0af1ede386d907", + "def": "CREATE UNIQUE INDEX \"PK_81020dc608dfb0af1ede386d907\" ON public.agents_messages USING btree (id)", + "table": "public.agents_messages", + "columns": [ + "id" + ] + }, + { + "name": "IDX_fc7bf858660bfafd19181e8e35", + "def": "CREATE INDEX \"IDX_fc7bf858660bfafd19181e8e35\" ON public.agents_messages USING btree (\"threadId\", \"createdAt\")", + "table": "public.agents_messages", + "columns": [ + "threadId", + "createdAt" + ] + }, + { + "name": "IDX_agents_messages_threadId_createdAt", + "def": "CREATE INDEX \"IDX_agents_messages_threadId_createdAt\" ON public.agents_messages USING btree (\"threadId\", \"createdAt\")", + "table": "public.agents_messages", + "columns": [ + "threadId", + "createdAt" + ] + } + ], + "constraints": [ + { + "name": "agents_messages_content_not_null", + "type": "n", + "def": "NOT NULL content", + "table": "public.agents_messages", + "referenced_table": "", + "columns": [ + "content" + ] + }, + { + "name": "agents_messages_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agents_messages", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agents_messages_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.agents_messages", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "agents_messages_resourceId_not_null", + "type": "n", + "def": "NOT NULL \"resourceId\"", + "table": "public.agents_messages", + "referenced_table": "", + "columns": [ + "resourceId" + ] + }, + { + "name": "agents_messages_role_not_null", + "type": "n", + "def": "NOT NULL role", + "table": "public.agents_messages", + "referenced_table": "", + "columns": [ + "role" + ] + }, + { + "name": "agents_messages_threadId_not_null", + "type": "n", + "def": "NOT NULL \"threadId\"", + "table": "public.agents_messages", + "referenced_table": "", + "columns": [ + "threadId" + ] + }, + { + "name": "agents_messages_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agents_messages", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "PK_81020dc608dfb0af1ede386d907", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.agents_messages", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "FK_0a8057a61afabd2999608ffd0d9", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"threadId\") REFERENCES agents_threads(id) ON DELETE CASCADE", + "table": "public.agents_messages", + "referenced_table": "public.agents_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + } + ] + }, + { + "name": "public.agent_execution_threads", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "agentName", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "projectId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "sessionNumber", + "type": "integer", + "nullable": false, + "default": "0" + }, + { + "name": "totalPromptTokens", + "type": "integer", + "nullable": false, + "default": "0" + }, + { + "name": "totalCompletionTokens", + "type": "integer", + "nullable": false, + "default": "0" + }, + { + "name": "totalCost", + "type": "double precision", + "nullable": false, + "default": "0" + }, + { + "name": "totalDuration", + "type": "integer", + "nullable": false, + "default": "0" + }, + { + "name": "title", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "emoji", + "type": "varchar(8)", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "taskId", + "type": "varchar(32)", + "nullable": true, + "comment": "Published task ID that triggered this session; not an FK because published runs can outlive draft task definition rows" + }, + { + "name": "taskVersionId", + "type": "varchar(36)", + "nullable": true, + "comment": "Published agent_history version that supplied the task snapshot" + }, + { + "name": "parentThreadId", + "type": "varchar(128)", + "nullable": true, + "comment": "Parent session thread id that delegated this subagent run." + }, + { + "name": "parentAgentId", + "type": "varchar(36)", + "nullable": true, + "comment": "Saved agent id of the parent that delegated this subagent run." + } + ], + "indexes": [ + { + "name": "IDX_0468a9dc35597314e641d4722a", + "def": "CREATE INDEX \"IDX_0468a9dc35597314e641d4722a\" ON public.agent_execution_threads USING btree (\"agentId\")", + "table": "public.agent_execution_threads", + "columns": [ + "agentId" + ] + }, + { + "name": "IDX_0e2f8bf92a7a9c88b89670f701", + "def": "CREATE INDEX \"IDX_0e2f8bf92a7a9c88b89670f701\" ON public.agent_execution_threads USING btree (\"projectId\")", + "table": "public.agent_execution_threads", + "columns": [ + "projectId" + ] + }, + { + "name": "IDX_agent_execution_threads_taskVersionId", + "def": "CREATE INDEX \"IDX_agent_execution_threads_taskVersionId\" ON public.agent_execution_threads USING btree (\"taskVersionId\")", + "table": "public.agent_execution_threads", + "columns": [ + "taskVersionId" + ] + }, + { + "name": "PK_22373dbf6ba6929d8ac50093309", + "def": "CREATE UNIQUE INDEX \"PK_22373dbf6ba6929d8ac50093309\" ON public.agent_execution_threads USING btree (id)", + "table": "public.agent_execution_threads", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "agent_execution_threads_agentId_not_null", + "type": "n", + "def": "NOT NULL \"agentId\"", + "table": "public.agent_execution_threads", + "referenced_table": "", + "columns": [ + "agentId" + ] + }, + { + "name": "agent_execution_threads_agentName_not_null", + "type": "n", + "def": "NOT NULL \"agentName\"", + "table": "public.agent_execution_threads", + "referenced_table": "", + "columns": [ + "agentName" + ] + }, + { + "name": "agent_execution_threads_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agent_execution_threads", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agent_execution_threads_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.agent_execution_threads", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "agent_execution_threads_projectId_not_null", + "type": "n", + "def": "NOT NULL \"projectId\"", + "table": "public.agent_execution_threads", + "referenced_table": "", + "columns": [ + "projectId" + ] + }, + { + "name": "agent_execution_threads_sessionNumber_not_null", + "type": "n", + "def": "NOT NULL \"sessionNumber\"", + "table": "public.agent_execution_threads", + "referenced_table": "", + "columns": [ + "sessionNumber" + ] + }, + { + "name": "agent_execution_threads_totalCompletionTokens_not_null", + "type": "n", + "def": "NOT NULL \"totalCompletionTokens\"", + "table": "public.agent_execution_threads", + "referenced_table": "", + "columns": [ + "totalCompletionTokens" + ] + }, + { + "name": "agent_execution_threads_totalCost_not_null", + "type": "n", + "def": "NOT NULL \"totalCost\"", + "table": "public.agent_execution_threads", + "referenced_table": "", + "columns": [ + "totalCost" + ] + }, + { + "name": "agent_execution_threads_totalDuration_not_null", + "type": "n", + "def": "NOT NULL \"totalDuration\"", + "table": "public.agent_execution_threads", + "referenced_table": "", + "columns": [ + "totalDuration" + ] + }, + { + "name": "agent_execution_threads_totalPromptTokens_not_null", + "type": "n", + "def": "NOT NULL \"totalPromptTokens\"", + "table": "public.agent_execution_threads", + "referenced_table": "", + "columns": [ + "totalPromptTokens" + ] + }, + { + "name": "agent_execution_threads_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agent_execution_threads", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_0e2f8bf92a7a9c88b89670f701c", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE", + "table": "public.agent_execution_threads", + "referenced_table": "public.project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_0468a9dc35597314e641d4722aa", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE", + "table": "public.agent_execution_threads", + "referenced_table": "public.agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_f00b52d74fe11838e1fe086deea", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"taskVersionId\") REFERENCES agent_history(\"versionId\") ON DELETE SET NULL", + "table": "public.agent_execution_threads", + "referenced_table": "public.agent_history", + "columns": [ + "taskVersionId" + ], + "referenced_columns": [ + "versionId" + ] + }, + { + "name": "PK_22373dbf6ba6929d8ac50093309", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.agent_execution_threads", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.agent_execution", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "threadId", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "status", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "startedAt", + "type": "timestamp(3) with time zone", + "nullable": true + }, + { + "name": "stoppedAt", + "type": "timestamp(3) with time zone", + "nullable": true + }, + { + "name": "duration", + "type": "integer", + "nullable": false, + "default": "0" + }, + { + "name": "userMessage", + "type": "text", + "nullable": false + }, + { + "name": "assistantResponse", + "type": "text", + "nullable": false + }, + { + "name": "model", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "promptTokens", + "type": "integer", + "nullable": true + }, + { + "name": "completionTokens", + "type": "integer", + "nullable": true + }, + { + "name": "totalTokens", + "type": "integer", + "nullable": true + }, + { + "name": "cost", + "type": "double precision", + "nullable": true + }, + { + "name": "toolCalls", + "type": "json", + "nullable": true + }, + { + "name": "timeline", + "type": "json", + "nullable": true + }, + { + "name": "error", + "type": "text", + "nullable": true + }, + { + "name": "hitlStatus", + "type": "varchar(16)", + "nullable": true + }, + { + "name": "source", + "type": "varchar(32)", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_ba438acc8532addc12d1ef17049", + "def": "CREATE UNIQUE INDEX \"PK_ba438acc8532addc12d1ef17049\" ON public.agent_execution USING btree (id)", + "table": "public.agent_execution", + "columns": [ + "id" + ] + }, + { + "name": "IDX_63d3c3a68b9cebf05f967f0b1c", + "def": "CREATE INDEX \"IDX_63d3c3a68b9cebf05f967f0b1c\" ON public.agent_execution USING btree (\"threadId\", \"createdAt\")", + "table": "public.agent_execution", + "columns": [ + "threadId", + "createdAt" + ] + } + ], + "constraints": [ + { + "name": "CHK_agent_execution_hitlStatus", + "type": "CHECK", + "def": "CHECK (((\"hitlStatus\")::text = ANY ((ARRAY['suspended'::character varying, 'resumed'::character varying])::text[])))", + "table": "public.agent_execution", + "referenced_table": "", + "columns": [ + "hitlStatus" + ] + }, + { + "name": "CHK_agent_execution_status", + "type": "CHECK", + "def": "CHECK (((status)::text = ANY ((ARRAY['success'::character varying, 'error'::character varying])::text[])))", + "table": "public.agent_execution", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "agent_execution_assistantResponse_not_null", + "type": "n", + "def": "NOT NULL \"assistantResponse\"", + "table": "public.agent_execution", + "referenced_table": "", + "columns": [ + "assistantResponse" + ] + }, + { + "name": "agent_execution_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agent_execution", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agent_execution_duration_not_null", + "type": "n", + "def": "NOT NULL duration", + "table": "public.agent_execution", + "referenced_table": "", + "columns": [ + "duration" + ] + }, + { + "name": "agent_execution_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.agent_execution", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "agent_execution_status_not_null", + "type": "n", + "def": "NOT NULL status", + "table": "public.agent_execution", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "agent_execution_threadId_not_null", + "type": "n", + "def": "NOT NULL \"threadId\"", + "table": "public.agent_execution", + "referenced_table": "", + "columns": [ + "threadId" + ] + }, + { + "name": "agent_execution_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agent_execution", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "agent_execution_userMessage_not_null", + "type": "n", + "def": "NOT NULL \"userMessage\"", + "table": "public.agent_execution", + "referenced_table": "", + "columns": [ + "userMessage" + ] + }, + { + "name": "PK_ba438acc8532addc12d1ef17049", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.agent_execution", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "FK_add2432fb6034cc18b6af299dce", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"threadId\") REFERENCES agent_execution_threads(id) ON DELETE CASCADE", + "table": "public.agent_execution", + "referenced_table": "public.agent_execution_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + } + ] + }, + { + "name": "public.instance_ai_checkpoints", + "type": "BASE TABLE", + "columns": [ + { + "name": "key", + "type": "varchar(255)", + "nullable": false, + "comment": "Opaque checkpoint key from the agent runtime." + }, + { + "name": "runId", + "type": "varchar(255)", + "nullable": true, + "comment": "Run ID parsed from the checkpoint key when available." + }, + { + "name": "threadId", + "type": "uuid", + "nullable": false, + "comment": "Instance AI thread that owns the checkpoint." + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": true, + "comment": "Resource ID recorded by the agent runtime." + }, + { + "name": "state", + "type": "json", + "nullable": true, + "comment": "Serializable agent state snapshot stored as JSON." + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "expiredAt", + "type": "timestamp(3) with time zone", + "nullable": true, + "comment": "Soft-delete timestamp: null means live; non-null marks the row as a tombstone." + } + ], + "indexes": [ + { + "name": "PK_5315a45f0846d1f9d128c18a2ed", + "def": "CREATE UNIQUE INDEX \"PK_5315a45f0846d1f9d128c18a2ed\" ON public.instance_ai_checkpoints USING btree (key)", + "table": "public.instance_ai_checkpoints", + "columns": [ + "key" + ] + }, + { + "name": "IDX_768189b506cc26c4fe878b87cb", + "def": "CREATE INDEX \"IDX_768189b506cc26c4fe878b87cb\" ON public.instance_ai_checkpoints USING btree (\"runId\")", + "table": "public.instance_ai_checkpoints", + "columns": [ + "runId" + ] + }, + { + "name": "IDX_2b23f3f24a70bebb990203b011", + "def": "CREATE INDEX \"IDX_2b23f3f24a70bebb990203b011\" ON public.instance_ai_checkpoints USING btree (\"threadId\")", + "table": "public.instance_ai_checkpoints", + "columns": [ + "threadId" + ] + }, + { + "name": "IDX_be9d0eca0b19fb93d4eb74b327", + "def": "CREATE INDEX \"IDX_be9d0eca0b19fb93d4eb74b327\" ON public.instance_ai_checkpoints USING btree (\"resourceId\")", + "table": "public.instance_ai_checkpoints", + "columns": [ + "resourceId" + ] + } + ], + "constraints": [ + { + "name": "instance_ai_checkpoints_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.instance_ai_checkpoints", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "instance_ai_checkpoints_key_not_null", + "type": "n", + "def": "NOT NULL key", + "table": "public.instance_ai_checkpoints", + "referenced_table": "", + "columns": [ + "key" + ] + }, + { + "name": "instance_ai_checkpoints_state_tombstone_check", + "type": "CHECK", + "def": "CHECK ((((\"expiredAt\" IS NOT NULL) AND (state IS NULL)) OR (\"expiredAt\" IS NULL)))", + "table": "public.instance_ai_checkpoints", + "referenced_table": "", + "columns": [ + "expiredAt", + "state" + ] + }, + { + "name": "instance_ai_checkpoints_threadId_not_null", + "type": "n", + "def": "NOT NULL \"threadId\"", + "table": "public.instance_ai_checkpoints", + "referenced_table": "", + "columns": [ + "threadId" + ] + }, + { + "name": "instance_ai_checkpoints_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.instance_ai_checkpoints", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_2b23f3f24a70bebb990203b011e", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"threadId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE", + "table": "public.instance_ai_checkpoints", + "referenced_table": "public.instance_ai_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_5315a45f0846d1f9d128c18a2ed", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (key)", + "table": "public.instance_ai_checkpoints", + "referenced_table": "", + "columns": [ + "key" + ] + } + ] + }, + { + "name": "public.agents_observations", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false, + "comment": "Application-generated n8n string ID, not a database UUID" + }, + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false, + "comment": "Agent that owns this observation row" + }, + { + "name": "observationScopeId", + "type": "varchar(255)", + "nullable": false, + "comment": "agents_threads.id source stream for this observation log" + }, + { + "name": "marker", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "text", + "type": "text", + "nullable": false + }, + { + "name": "parentId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "tokenCount", + "type": "integer", + "nullable": false, + "default": "0" + }, + { + "name": "status", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "supersededBy", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_9ad319654d12c2649f7caf27135", + "def": "CREATE UNIQUE INDEX \"PK_9ad319654d12c2649f7caf27135\" ON public.agents_observations USING btree (id)", + "table": "public.agents_observations", + "columns": [ + "id" + ] + }, + { + "name": "IDX_07cb1e4a302629c5fa5d74d2bb", + "def": "CREATE INDEX \"IDX_07cb1e4a302629c5fa5d74d2bb\" ON public.agents_observations USING btree (\"agentId\", \"observationScopeId\", status)", + "table": "public.agents_observations", + "columns": [ + "agentId", + "observationScopeId", + "status" + ] + }, + { + "name": "IDX_4cfd8a70ebb0a5b0cf047dca3c", + "def": "CREATE INDEX \"IDX_4cfd8a70ebb0a5b0cf047dca3c\" ON public.agents_observations USING btree (\"observationScopeId\")", + "table": "public.agents_observations", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "IDX_501e2d1701a10e24fb69ab5fc5", + "def": "CREATE INDEX \"IDX_501e2d1701a10e24fb69ab5fc5\" ON public.agents_observations USING btree (\"parentId\")", + "table": "public.agents_observations", + "columns": [ + "parentId" + ] + }, + { + "name": "IDX_127ee1078ffa952bb37b511efa", + "def": "CREATE INDEX \"IDX_127ee1078ffa952bb37b511efa\" ON public.agents_observations USING btree (\"supersededBy\")", + "table": "public.agents_observations", + "columns": [ + "supersededBy" + ] + } + ], + "constraints": [ + { + "name": "CHK_agents_observations_marker", + "type": "CHECK", + "def": "CHECK (((marker)::text = ANY ((ARRAY['critical'::character varying, 'important'::character varying, 'info'::character varying, 'completion'::character varying])::text[])))", + "table": "public.agents_observations", + "referenced_table": "", + "columns": [ + "marker" + ] + }, + { + "name": "CHK_agents_observations_status", + "type": "CHECK", + "def": "CHECK (((status)::text = ANY ((ARRAY['active'::character varying, 'superseded'::character varying, 'dropped'::character varying])::text[])))", + "table": "public.agents_observations", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "agents_observations_agentId_not_null", + "type": "n", + "def": "NOT NULL \"agentId\"", + "table": "public.agents_observations", + "referenced_table": "", + "columns": [ + "agentId" + ] + }, + { + "name": "agents_observations_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agents_observations", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agents_observations_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.agents_observations", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "agents_observations_marker_not_null", + "type": "n", + "def": "NOT NULL marker", + "table": "public.agents_observations", + "referenced_table": "", + "columns": [ + "marker" + ] + }, + { + "name": "agents_observations_observationScopeId_not_null", + "type": "n", + "def": "NOT NULL \"observationScopeId\"", + "table": "public.agents_observations", + "referenced_table": "", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "agents_observations_status_not_null", + "type": "n", + "def": "NOT NULL status", + "table": "public.agents_observations", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "agents_observations_text_not_null", + "type": "n", + "def": "NOT NULL text", + "table": "public.agents_observations", + "referenced_table": "", + "columns": [ + "text" + ] + }, + { + "name": "agents_observations_tokenCount_not_null", + "type": "n", + "def": "NOT NULL \"tokenCount\"", + "table": "public.agents_observations", + "referenced_table": "", + "columns": [ + "tokenCount" + ] + }, + { + "name": "agents_observations_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agents_observations", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_d206432be97b7ed88d187479b1b", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE", + "table": "public.agents_observations", + "referenced_table": "public.agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_127ee1078ffa952bb37b511efad", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"supersededBy\") REFERENCES agents_observations(id)", + "table": "public.agents_observations", + "referenced_table": "public.agents_observations", + "columns": [ + "supersededBy" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_501e2d1701a10e24fb69ab5fc5f", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"parentId\") REFERENCES agents_observations(id)", + "table": "public.agents_observations", + "referenced_table": "public.agents_observations", + "columns": [ + "parentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_9ad319654d12c2649f7caf27135", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.agents_observations", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "FK_4cfd8a70ebb0a5b0cf047dca3cf", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"observationScopeId\") REFERENCES agents_threads(id) ON DELETE CASCADE", + "table": "public.agents_observations", + "referenced_table": "public.agents_threads", + "columns": [ + "observationScopeId" + ], + "referenced_columns": [ + "id" + ] + } + ] + }, + { + "name": "public.agents_observation_cursors", + "type": "BASE TABLE", + "columns": [ + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false, + "comment": "Agent that owns this cursor" + }, + { + "name": "observationScopeId", + "type": "varchar(255)", + "nullable": false, + "comment": "agents_threads.id source stream checkpointed by this cursor" + }, + { + "name": "lastObservedMessageId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "lastObservedAt", + "type": "timestamp(3) with time zone", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_eb777ac57ab872d38f8ebd19317", + "def": "CREATE UNIQUE INDEX \"PK_eb777ac57ab872d38f8ebd19317\" ON public.agents_observation_cursors USING btree (\"agentId\", \"observationScopeId\")", + "table": "public.agents_observation_cursors", + "columns": [ + "agentId", + "observationScopeId" + ] + }, + { + "name": "IDX_87aa187d27ea67eafd16490515", + "def": "CREATE INDEX \"IDX_87aa187d27ea67eafd16490515\" ON public.agents_observation_cursors USING btree (\"observationScopeId\")", + "table": "public.agents_observation_cursors", + "columns": [ + "observationScopeId" + ] + } + ], + "constraints": [ + { + "name": "agents_observation_cursors_agentId_not_null", + "type": "n", + "def": "NOT NULL \"agentId\"", + "table": "public.agents_observation_cursors", + "referenced_table": "", + "columns": [ + "agentId" + ] + }, + { + "name": "agents_observation_cursors_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agents_observation_cursors", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agents_observation_cursors_lastObservedAt_not_null", + "type": "n", + "def": "NOT NULL \"lastObservedAt\"", + "table": "public.agents_observation_cursors", + "referenced_table": "", + "columns": [ + "lastObservedAt" + ] + }, + { + "name": "agents_observation_cursors_lastObservedMessageId_not_null", + "type": "n", + "def": "NOT NULL \"lastObservedMessageId\"", + "table": "public.agents_observation_cursors", + "referenced_table": "", + "columns": [ + "lastObservedMessageId" + ] + }, + { + "name": "agents_observation_cursors_observationScopeId_not_null", + "type": "n", + "def": "NOT NULL \"observationScopeId\"", + "table": "public.agents_observation_cursors", + "referenced_table": "", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "agents_observation_cursors_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agents_observation_cursors", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_64e92819f4b413661ed6e2c3c3d", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE", + "table": "public.agents_observation_cursors", + "referenced_table": "public.agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_eb777ac57ab872d38f8ebd19317", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"agentId\", \"observationScopeId\")", + "table": "public.agents_observation_cursors", + "referenced_table": "", + "columns": [ + "agentId", + "observationScopeId" + ] + }, + { + "name": "FK_87aa187d27ea67eafd164905154", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"observationScopeId\") REFERENCES agents_threads(id) ON DELETE CASCADE", + "table": "public.agents_observation_cursors", + "referenced_table": "public.agents_threads", + "columns": [ + "observationScopeId" + ], + "referenced_columns": [ + "id" + ] + } + ] + }, + { + "name": "public.agents_observation_locks", + "type": "BASE TABLE", + "columns": [ + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false, + "comment": "Agent that owns this lock" + }, + { + "name": "observationScopeId", + "type": "varchar(255)", + "nullable": false, + "comment": "agents_threads.id source stream locked for observation tasks" + }, + { + "name": "taskKind", + "type": "varchar(20)", + "nullable": false + }, + { + "name": "holderId", + "type": "varchar(64)", + "nullable": false, + "comment": "Ephemeral background-task lock owner token, not a user ID" + }, + { + "name": "heldUntil", + "type": "timestamp(3) with time zone", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_7e2e315162ac3d80587e15ac2c3", + "def": "CREATE UNIQUE INDEX \"PK_7e2e315162ac3d80587e15ac2c3\" ON public.agents_observation_locks USING btree (\"agentId\", \"observationScopeId\", \"taskKind\")", + "table": "public.agents_observation_locks", + "columns": [ + "agentId", + "observationScopeId", + "taskKind" + ] + }, + { + "name": "IDX_6b55089892e447c2f82e5ec60e", + "def": "CREATE INDEX \"IDX_6b55089892e447c2f82e5ec60e\" ON public.agents_observation_locks USING btree (\"observationScopeId\")", + "table": "public.agents_observation_locks", + "columns": [ + "observationScopeId" + ] + } + ], + "constraints": [ + { + "name": "CHK_agents_observation_locks_taskKind", + "type": "CHECK", + "def": "CHECK (((\"taskKind\")::text = ANY ((ARRAY['observer'::character varying, 'reflector'::character varying])::text[])))", + "table": "public.agents_observation_locks", + "referenced_table": "", + "columns": [ + "taskKind" + ] + }, + { + "name": "agents_observation_locks_agentId_not_null", + "type": "n", + "def": "NOT NULL \"agentId\"", + "table": "public.agents_observation_locks", + "referenced_table": "", + "columns": [ + "agentId" + ] + }, + { + "name": "agents_observation_locks_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agents_observation_locks", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agents_observation_locks_heldUntil_not_null", + "type": "n", + "def": "NOT NULL \"heldUntil\"", + "table": "public.agents_observation_locks", + "referenced_table": "", + "columns": [ + "heldUntil" + ] + }, + { + "name": "agents_observation_locks_holderId_not_null", + "type": "n", + "def": "NOT NULL \"holderId\"", + "table": "public.agents_observation_locks", + "referenced_table": "", + "columns": [ + "holderId" + ] + }, + { + "name": "agents_observation_locks_observationScopeId_not_null", + "type": "n", + "def": "NOT NULL \"observationScopeId\"", + "table": "public.agents_observation_locks", + "referenced_table": "", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "agents_observation_locks_taskKind_not_null", + "type": "n", + "def": "NOT NULL \"taskKind\"", + "table": "public.agents_observation_locks", + "referenced_table": "", + "columns": [ + "taskKind" + ] + }, + { + "name": "agents_observation_locks_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agents_observation_locks", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_093e44ae20f2518e97d83a95433", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE", + "table": "public.agents_observation_locks", + "referenced_table": "public.agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_7e2e315162ac3d80587e15ac2c3", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"agentId\", \"observationScopeId\", \"taskKind\")", + "table": "public.agents_observation_locks", + "referenced_table": "", + "columns": [ + "agentId", + "observationScopeId", + "taskKind" + ] + }, + { + "name": "FK_6b55089892e447c2f82e5ec60ed", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"observationScopeId\") REFERENCES agents_threads(id) ON DELETE CASCADE", + "table": "public.agents_observation_locks", + "referenced_table": "public.agents_threads", + "columns": [ + "observationScopeId" + ], + "referenced_columns": [ + "id" + ] + } + ] + }, + { + "name": "public.agents_memory_entries", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false, + "comment": "Agent that owns this episodic memory entry" + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": false, + "comment": "agents_resources.id partition used for episodic recall scope" + }, + { + "name": "content", + "type": "text", + "nullable": false + }, + { + "name": "contentHash", + "type": "varchar(64)", + "nullable": false + }, + { + "name": "status", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "supersededBy", + "type": "varchar(36)", + "nullable": true, + "comment": "Self-reference to replacement memory entry" + }, + { + "name": "embeddingModel", + "type": "varchar(128)", + "nullable": true, + "comment": "Embedding model used to produce embedding" + }, + { + "name": "embedding", + "type": "json", + "nullable": true, + "comment": "Embedding vector for episodic recall" + }, + { + "name": "metadata", + "type": "json", + "nullable": true, + "comment": "Optional system metadata for ranking and debugging" + }, + { + "name": "lastSeenAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "comment": "Last time equivalent content was observed; updatedAt tracks row mutation time" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_bfbc45dc88f66fae4e4b4a15fec", + "def": "CREATE UNIQUE INDEX \"PK_bfbc45dc88f66fae4e4b4a15fec\" ON public.agents_memory_entries USING btree (id)", + "table": "public.agents_memory_entries", + "columns": [ + "id" + ] + }, + { + "name": "IDX_aff2807b31eccbafe59d0474f0", + "def": "CREATE INDEX \"IDX_aff2807b31eccbafe59d0474f0\" ON public.agents_memory_entries USING btree (\"agentId\", \"resourceId\", status, \"createdAt\", id)", + "table": "public.agents_memory_entries", + "columns": [ + "agentId", + "resourceId", + "status", + "createdAt", + "id" + ] + }, + { + "name": "IDX_a03e04e94bea8439dd166d4b52", + "def": "CREATE UNIQUE INDEX \"IDX_a03e04e94bea8439dd166d4b52\" ON public.agents_memory_entries USING btree (\"agentId\", \"resourceId\", \"contentHash\")", + "table": "public.agents_memory_entries", + "columns": [ + "agentId", + "resourceId", + "contentHash" + ] + }, + { + "name": "IDX_1443a75e59adbfb796071d6639", + "def": "CREATE INDEX \"IDX_1443a75e59adbfb796071d6639\" ON public.agents_memory_entries USING btree (\"resourceId\")", + "table": "public.agents_memory_entries", + "columns": [ + "resourceId" + ] + }, + { + "name": "IDX_0edf1226b77ddc525eae493807", + "def": "CREATE INDEX \"IDX_0edf1226b77ddc525eae493807\" ON public.agents_memory_entries USING btree (\"supersededBy\")", + "table": "public.agents_memory_entries", + "columns": [ + "supersededBy" + ] + } + ], + "constraints": [ + { + "name": "CHK_agents_memory_entries_status", + "type": "CHECK", + "def": "CHECK (((status)::text = ANY ((ARRAY['active'::character varying, 'superseded'::character varying, 'dropped'::character varying])::text[])))", + "table": "public.agents_memory_entries", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "agents_memory_entries_agentId_not_null", + "type": "n", + "def": "NOT NULL \"agentId\"", + "table": "public.agents_memory_entries", + "referenced_table": "", + "columns": [ + "agentId" + ] + }, + { + "name": "agents_memory_entries_contentHash_not_null", + "type": "n", + "def": "NOT NULL \"contentHash\"", + "table": "public.agents_memory_entries", + "referenced_table": "", + "columns": [ + "contentHash" + ] + }, + { + "name": "agents_memory_entries_content_not_null", + "type": "n", + "def": "NOT NULL content", + "table": "public.agents_memory_entries", + "referenced_table": "", + "columns": [ + "content" + ] + }, + { + "name": "agents_memory_entries_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agents_memory_entries", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agents_memory_entries_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.agents_memory_entries", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "agents_memory_entries_lastSeenAt_not_null", + "type": "n", + "def": "NOT NULL \"lastSeenAt\"", + "table": "public.agents_memory_entries", + "referenced_table": "", + "columns": [ + "lastSeenAt" + ] + }, + { + "name": "agents_memory_entries_resourceId_not_null", + "type": "n", + "def": "NOT NULL \"resourceId\"", + "table": "public.agents_memory_entries", + "referenced_table": "", + "columns": [ + "resourceId" + ] + }, + { + "name": "agents_memory_entries_status_not_null", + "type": "n", + "def": "NOT NULL status", + "table": "public.agents_memory_entries", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "agents_memory_entries_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agents_memory_entries", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_28e981fb675e9b44ce02f0ec1dd", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE", + "table": "public.agents_memory_entries", + "referenced_table": "public.agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_1443a75e59adbfb796071d66393", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"resourceId\") REFERENCES agents_resources(id) ON DELETE CASCADE", + "table": "public.agents_memory_entries", + "referenced_table": "public.agents_resources", + "columns": [ + "resourceId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_0edf1226b77ddc525eae4938079", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"supersededBy\") REFERENCES agents_memory_entries(id)", + "table": "public.agents_memory_entries", + "referenced_table": "public.agents_memory_entries", + "columns": [ + "supersededBy" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_bfbc45dc88f66fae4e4b4a15fec", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.agents_memory_entries", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.agents_memory_entry_locks", + "type": "BASE TABLE", + "columns": [ + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false, + "comment": "Agent that owns this lock" + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": false, + "comment": "agents_resources.id partition locked for episodic indexing" + }, + { + "name": "holderId", + "type": "varchar(64)", + "nullable": false, + "comment": "Ephemeral background-task lock owner token" + }, + { + "name": "heldUntil", + "type": "timestamp(3) with time zone", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_a8e0f570d04a174292bea104ae6", + "def": "CREATE UNIQUE INDEX \"PK_a8e0f570d04a174292bea104ae6\" ON public.agents_memory_entry_locks USING btree (\"agentId\", \"resourceId\")", + "table": "public.agents_memory_entry_locks", + "columns": [ + "agentId", + "resourceId" + ] + }, + { + "name": "IDX_9594c0983cfee1c8ff49b05848", + "def": "CREATE INDEX \"IDX_9594c0983cfee1c8ff49b05848\" ON public.agents_memory_entry_locks USING btree (\"resourceId\")", + "table": "public.agents_memory_entry_locks", + "columns": [ + "resourceId" + ] + } + ], + "constraints": [ + { + "name": "agents_memory_entry_locks_agentId_not_null", + "type": "n", + "def": "NOT NULL \"agentId\"", + "table": "public.agents_memory_entry_locks", + "referenced_table": "", + "columns": [ + "agentId" + ] + }, + { + "name": "agents_memory_entry_locks_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agents_memory_entry_locks", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agents_memory_entry_locks_heldUntil_not_null", + "type": "n", + "def": "NOT NULL \"heldUntil\"", + "table": "public.agents_memory_entry_locks", + "referenced_table": "", + "columns": [ + "heldUntil" + ] + }, + { + "name": "agents_memory_entry_locks_holderId_not_null", + "type": "n", + "def": "NOT NULL \"holderId\"", + "table": "public.agents_memory_entry_locks", + "referenced_table": "", + "columns": [ + "holderId" + ] + }, + { + "name": "agents_memory_entry_locks_resourceId_not_null", + "type": "n", + "def": "NOT NULL \"resourceId\"", + "table": "public.agents_memory_entry_locks", + "referenced_table": "", + "columns": [ + "resourceId" + ] + }, + { + "name": "agents_memory_entry_locks_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agents_memory_entry_locks", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_0ccf6d9ea6f44fa1c264fc2f795", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE", + "table": "public.agents_memory_entry_locks", + "referenced_table": "public.agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_9594c0983cfee1c8ff49b05848b", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"resourceId\") REFERENCES agents_resources(id) ON DELETE CASCADE", + "table": "public.agents_memory_entry_locks", + "referenced_table": "public.agents_resources", + "columns": [ + "resourceId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_a8e0f570d04a174292bea104ae6", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"agentId\", \"resourceId\")", + "table": "public.agents_memory_entry_locks", + "referenced_table": "", + "columns": [ + "agentId", + "resourceId" + ] + } + ] + }, + { + "name": "public.agents_memory_entry_sources", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false, + "comment": "Agent that owns the linked episodic memory entry source" + }, + { + "name": "memoryEntryId", + "type": "varchar(36)", + "nullable": false, + "comment": "Episodic memory entry linked to this source evidence" + }, + { + "name": "observationId", + "type": "varchar(36)", + "nullable": false, + "comment": "Observation-log row used as source evidence" + }, + { + "name": "threadId", + "type": "varchar(255)", + "nullable": false, + "comment": "Source conversation thread that produced the linked observation" + }, + { + "name": "evidenceHash", + "type": "varchar(64)", + "nullable": false, + "comment": "Bounded hash used to deduplicate exact evidence links" + }, + { + "name": "evidenceText", + "type": "text", + "nullable": false, + "comment": "Exact source evidence text from the observation, not recall scope" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_278f05e98e74baaaa93f52b4bab", + "def": "CREATE UNIQUE INDEX \"PK_278f05e98e74baaaa93f52b4bab\" ON public.agents_memory_entry_sources USING btree (id)", + "table": "public.agents_memory_entry_sources", + "columns": [ + "id" + ] + }, + { + "name": "IDX_a353ac251315ef0af6ad3c9f0a", + "def": "CREATE UNIQUE INDEX \"IDX_a353ac251315ef0af6ad3c9f0a\" ON public.agents_memory_entry_sources USING btree (\"memoryEntryId\", \"observationId\", \"evidenceHash\")", + "table": "public.agents_memory_entry_sources", + "columns": [ + "memoryEntryId", + "observationId", + "evidenceHash" + ] + }, + { + "name": "IDX_cb7c15d22fd068a0806aa57fc0", + "def": "CREATE INDEX \"IDX_cb7c15d22fd068a0806aa57fc0\" ON public.agents_memory_entry_sources USING btree (\"observationId\")", + "table": "public.agents_memory_entry_sources", + "columns": [ + "observationId" + ] + }, + { + "name": "IDX_f9573af4ed653f13b0ba1f7b12", + "def": "CREATE INDEX \"IDX_f9573af4ed653f13b0ba1f7b12\" ON public.agents_memory_entry_sources USING btree (\"agentId\", \"threadId\")", + "table": "public.agents_memory_entry_sources", + "columns": [ + "agentId", + "threadId" + ] + }, + { + "name": "IDX_451d387a182fa8dd8002dfc3a7", + "def": "CREATE INDEX \"IDX_451d387a182fa8dd8002dfc3a7\" ON public.agents_memory_entry_sources USING btree (\"threadId\")", + "table": "public.agents_memory_entry_sources", + "columns": [ + "threadId" + ] + } + ], + "constraints": [ + { + "name": "agents_memory_entry_sources_agentId_not_null", + "type": "n", + "def": "NOT NULL \"agentId\"", + "table": "public.agents_memory_entry_sources", + "referenced_table": "", + "columns": [ + "agentId" + ] + }, + { + "name": "agents_memory_entry_sources_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agents_memory_entry_sources", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agents_memory_entry_sources_evidenceHash_not_null", + "type": "n", + "def": "NOT NULL \"evidenceHash\"", + "table": "public.agents_memory_entry_sources", + "referenced_table": "", + "columns": [ + "evidenceHash" + ] + }, + { + "name": "agents_memory_entry_sources_evidenceText_not_null", + "type": "n", + "def": "NOT NULL \"evidenceText\"", + "table": "public.agents_memory_entry_sources", + "referenced_table": "", + "columns": [ + "evidenceText" + ] + }, + { + "name": "agents_memory_entry_sources_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.agents_memory_entry_sources", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "agents_memory_entry_sources_memoryEntryId_not_null", + "type": "n", + "def": "NOT NULL \"memoryEntryId\"", + "table": "public.agents_memory_entry_sources", + "referenced_table": "", + "columns": [ + "memoryEntryId" + ] + }, + { + "name": "agents_memory_entry_sources_observationId_not_null", + "type": "n", + "def": "NOT NULL \"observationId\"", + "table": "public.agents_memory_entry_sources", + "referenced_table": "", + "columns": [ + "observationId" + ] + }, + { + "name": "agents_memory_entry_sources_threadId_not_null", + "type": "n", + "def": "NOT NULL \"threadId\"", + "table": "public.agents_memory_entry_sources", + "referenced_table": "", + "columns": [ + "threadId" + ] + }, + { + "name": "agents_memory_entry_sources_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agents_memory_entry_sources", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_c38e8a57a36b880e39a52ada2e8", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE", + "table": "public.agents_memory_entry_sources", + "referenced_table": "public.agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_cb7c15d22fd068a0806aa57fc03", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"observationId\") REFERENCES agents_observations(id) ON DELETE CASCADE", + "table": "public.agents_memory_entry_sources", + "referenced_table": "public.agents_observations", + "columns": [ + "observationId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_4706f6223313959b7437a2b48df", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"memoryEntryId\") REFERENCES agents_memory_entries(id) ON DELETE CASCADE", + "table": "public.agents_memory_entry_sources", + "referenced_table": "public.agents_memory_entries", + "columns": [ + "memoryEntryId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_278f05e98e74baaaa93f52b4bab", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.agents_memory_entry_sources", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "FK_451d387a182fa8dd8002dfc3a77", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"threadId\") REFERENCES agents_threads(id) ON DELETE CASCADE", + "table": "public.agents_memory_entry_sources", + "referenced_table": "public.agents_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + } + ] + }, + { + "name": "public.agents_memory_entry_cursors", + "type": "BASE TABLE", + "columns": [ + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false, + "comment": "Agent that owns this cursor" + }, + { + "name": "observationScopeId", + "type": "varchar(255)", + "nullable": false, + "comment": "agents_threads.id source stream indexed into episodic memory" + }, + { + "name": "lastIndexedObservationId", + "type": "varchar(36)", + "nullable": false, + "comment": "Last observation-log row indexed into episodic memory" + }, + { + "name": "lastIndexedObservationCreatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "comment": "Creation timestamp for the last indexed observation-log row" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_b31a1d5c009a27f4cc5ef8f102a", + "def": "CREATE UNIQUE INDEX \"PK_b31a1d5c009a27f4cc5ef8f102a\" ON public.agents_memory_entry_cursors USING btree (\"agentId\", \"observationScopeId\")", + "table": "public.agents_memory_entry_cursors", + "columns": [ + "agentId", + "observationScopeId" + ] + }, + { + "name": "IDX_069e791e428391a5569e7a96b2", + "def": "CREATE INDEX \"IDX_069e791e428391a5569e7a96b2\" ON public.agents_memory_entry_cursors USING btree (\"observationScopeId\")", + "table": "public.agents_memory_entry_cursors", + "columns": [ + "observationScopeId" + ] + } + ], + "constraints": [ + { + "name": "agents_memory_entry_cursors_agentId_not_null", + "type": "n", + "def": "NOT NULL \"agentId\"", + "table": "public.agents_memory_entry_cursors", + "referenced_table": "", + "columns": [ + "agentId" + ] + }, + { + "name": "agents_memory_entry_cursors_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agents_memory_entry_cursors", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agents_memory_entry_cursors_lastIndexedObservationCrea_not_null", + "type": "n", + "def": "NOT NULL \"lastIndexedObservationCreatedAt\"", + "table": "public.agents_memory_entry_cursors", + "referenced_table": "", + "columns": [ + "lastIndexedObservationCreatedAt" + ] + }, + { + "name": "agents_memory_entry_cursors_lastIndexedObservationId_not_null", + "type": "n", + "def": "NOT NULL \"lastIndexedObservationId\"", + "table": "public.agents_memory_entry_cursors", + "referenced_table": "", + "columns": [ + "lastIndexedObservationId" + ] + }, + { + "name": "agents_memory_entry_cursors_observationScopeId_not_null", + "type": "n", + "def": "NOT NULL \"observationScopeId\"", + "table": "public.agents_memory_entry_cursors", + "referenced_table": "", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "agents_memory_entry_cursors_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agents_memory_entry_cursors", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_746780fd115e5e4352457a3c617", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE", + "table": "public.agents_memory_entry_cursors", + "referenced_table": "public.agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_b31a1d5c009a27f4cc5ef8f102a", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"agentId\", \"observationScopeId\")", + "table": "public.agents_memory_entry_cursors", + "referenced_table": "", + "columns": [ + "agentId", + "observationScopeId" + ] + }, + { + "name": "FK_069e791e428391a5569e7a96b20", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"observationScopeId\") REFERENCES agents_threads(id) ON DELETE CASCADE", + "table": "public.agents_memory_entry_cursors", + "referenced_table": "public.agents_threads", + "columns": [ + "observationScopeId" + ], + "referenced_columns": [ + "id" + ] + } + ] + }, + { + "name": "public.agent_history", + "type": "BASE TABLE", + "columns": [ + { + "name": "versionId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "schema", + "type": "json", + "nullable": true, + "comment": "Frozen snapshot of the published AgentJsonConfig" + }, + { + "name": "tools", + "type": "json", + "nullable": true, + "comment": "Frozen map of `toolId → { code, descriptor }` at publish time" + }, + { + "name": "skills", + "type": "json", + "nullable": true, + "comment": "Frozen map of `skillId → AgentSkill` at publish time" + }, + { + "name": "publishedById", + "type": "uuid", + "nullable": true + }, + { + "name": "author", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_65ffcfe7a8e112fb826311fb092", + "def": "CREATE UNIQUE INDEX \"PK_65ffcfe7a8e112fb826311fb092\" ON public.agent_history USING btree (\"versionId\")", + "table": "public.agent_history", + "columns": [ + "versionId" + ] + }, + { + "name": "IDX_87cd5a8da20304b089ea2f83fe", + "def": "CREATE INDEX \"IDX_87cd5a8da20304b089ea2f83fe\" ON public.agent_history USING btree (\"agentId\")", + "table": "public.agent_history", + "columns": [ + "agentId" + ] + } + ], + "constraints": [ + { + "name": "agent_history_agentId_not_null", + "type": "n", + "def": "NOT NULL \"agentId\"", + "table": "public.agent_history", + "referenced_table": "", + "columns": [ + "agentId" + ] + }, + { + "name": "agent_history_author_not_null", + "type": "n", + "def": "NOT NULL author", + "table": "public.agent_history", + "referenced_table": "", + "columns": [ + "author" + ] + }, + { + "name": "agent_history_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agent_history", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agent_history_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agent_history", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "agent_history_versionId_not_null", + "type": "n", + "def": "NOT NULL \"versionId\"", + "table": "public.agent_history", + "referenced_table": "", + "columns": [ + "versionId" + ] + }, + { + "name": "FK_8771675f44c58fb40e0feb9ee35", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"publishedById\") REFERENCES \"user\"(id) ON DELETE SET NULL", + "table": "public.agent_history", + "referenced_table": "public.user", + "columns": [ + "publishedById" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_87cd5a8da20304b089ea2f83fec", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE", + "table": "public.agent_history", + "referenced_table": "public.agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_65ffcfe7a8e112fb826311fb092", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"versionId\")", + "table": "public.agent_history", + "referenced_table": "", + "columns": [ + "versionId" + ] + } + ] + }, + { + "name": "public.instance_ai_observations", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false, + "comment": "Application-generated n8n string ID, not a database UUID" + }, + { + "name": "observationScopeId", + "type": "uuid", + "nullable": false, + "comment": "instance_ai_threads.id source stream for this observation log" + }, + { + "name": "marker", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "text", + "type": "text", + "nullable": false + }, + { + "name": "parentId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "tokenCount", + "type": "integer", + "nullable": false, + "default": "0" + }, + { + "name": "status", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "supersededBy", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_4d9b514cdf0f0b577650caf2ac2", + "def": "CREATE UNIQUE INDEX \"PK_4d9b514cdf0f0b577650caf2ac2\" ON public.instance_ai_observations USING btree (id)", + "table": "public.instance_ai_observations", + "columns": [ + "id" + ] + }, + { + "name": "IDX_0d5db648188d338df7fb2a8064", + "def": "CREATE INDEX \"IDX_0d5db648188d338df7fb2a8064\" ON public.instance_ai_observations USING btree (\"observationScopeId\", status, \"createdAt\", id)", + "table": "public.instance_ai_observations", + "columns": [ + "observationScopeId", + "status", + "createdAt", + "id" + ] + }, + { + "name": "IDX_daef2195a4a846eb70eed15e03", + "def": "CREATE INDEX \"IDX_daef2195a4a846eb70eed15e03\" ON public.instance_ai_observations USING btree (\"parentId\")", + "table": "public.instance_ai_observations", + "columns": [ + "parentId" + ] + }, + { + "name": "IDX_a80e0ee839a2f10ba4b86e1999", + "def": "CREATE INDEX \"IDX_a80e0ee839a2f10ba4b86e1999\" ON public.instance_ai_observations USING btree (\"supersededBy\")", + "table": "public.instance_ai_observations", + "columns": [ + "supersededBy" + ] + } + ], + "constraints": [ + { + "name": "CHK_instance_ai_observations_marker", + "type": "CHECK", + "def": "CHECK (((marker)::text = ANY ((ARRAY['critical'::character varying, 'important'::character varying, 'info'::character varying, 'completion'::character varying])::text[])))", + "table": "public.instance_ai_observations", + "referenced_table": "", + "columns": [ + "marker" + ] + }, + { + "name": "CHK_instance_ai_observations_status", + "type": "CHECK", + "def": "CHECK (((status)::text = ANY ((ARRAY['active'::character varying, 'superseded'::character varying, 'dropped'::character varying])::text[])))", + "table": "public.instance_ai_observations", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "instance_ai_observations_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.instance_ai_observations", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "instance_ai_observations_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.instance_ai_observations", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "instance_ai_observations_marker_not_null", + "type": "n", + "def": "NOT NULL marker", + "table": "public.instance_ai_observations", + "referenced_table": "", + "columns": [ + "marker" + ] + }, + { + "name": "instance_ai_observations_observationScopeId_not_null", + "type": "n", + "def": "NOT NULL \"observationScopeId\"", + "table": "public.instance_ai_observations", + "referenced_table": "", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "instance_ai_observations_status_not_null", + "type": "n", + "def": "NOT NULL status", + "table": "public.instance_ai_observations", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "instance_ai_observations_text_not_null", + "type": "n", + "def": "NOT NULL text", + "table": "public.instance_ai_observations", + "referenced_table": "", + "columns": [ + "text" + ] + }, + { + "name": "instance_ai_observations_tokenCount_not_null", + "type": "n", + "def": "NOT NULL \"tokenCount\"", + "table": "public.instance_ai_observations", + "referenced_table": "", + "columns": [ + "tokenCount" + ] + }, + { + "name": "instance_ai_observations_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.instance_ai_observations", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_d54fc84a6c8ac91b5e0db0378a4", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"observationScopeId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE", + "table": "public.instance_ai_observations", + "referenced_table": "public.instance_ai_threads", + "columns": [ + "observationScopeId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_a80e0ee839a2f10ba4b86e19998", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"supersededBy\") REFERENCES instance_ai_observations(id)", + "table": "public.instance_ai_observations", + "referenced_table": "public.instance_ai_observations", + "columns": [ + "supersededBy" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_daef2195a4a846eb70eed15e039", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"parentId\") REFERENCES instance_ai_observations(id)", + "table": "public.instance_ai_observations", + "referenced_table": "public.instance_ai_observations", + "columns": [ + "parentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_4d9b514cdf0f0b577650caf2ac2", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.instance_ai_observations", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.instance_ai_observation_cursors", + "type": "BASE TABLE", + "columns": [ + { + "name": "observationScopeId", + "type": "uuid", + "nullable": false, + "comment": "instance_ai_threads.id source stream checkpointed by this cursor" + }, + { + "name": "lastObservedMessageId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "lastObservedAt", + "type": "timestamp(3) with time zone", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_5b6319b2e9a37c1064a72428f9a", + "def": "CREATE UNIQUE INDEX \"PK_5b6319b2e9a37c1064a72428f9a\" ON public.instance_ai_observation_cursors USING btree (\"observationScopeId\")", + "table": "public.instance_ai_observation_cursors", + "columns": [ + "observationScopeId" + ] + } + ], + "constraints": [ + { + "name": "instance_ai_observation_cursors_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.instance_ai_observation_cursors", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "instance_ai_observation_cursors_lastObservedAt_not_null", + "type": "n", + "def": "NOT NULL \"lastObservedAt\"", + "table": "public.instance_ai_observation_cursors", + "referenced_table": "", + "columns": [ + "lastObservedAt" + ] + }, + { + "name": "instance_ai_observation_cursors_lastObservedMessageId_not_null", + "type": "n", + "def": "NOT NULL \"lastObservedMessageId\"", + "table": "public.instance_ai_observation_cursors", + "referenced_table": "", + "columns": [ + "lastObservedMessageId" + ] + }, + { + "name": "instance_ai_observation_cursors_observationScopeId_not_null", + "type": "n", + "def": "NOT NULL \"observationScopeId\"", + "table": "public.instance_ai_observation_cursors", + "referenced_table": "", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "instance_ai_observation_cursors_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.instance_ai_observation_cursors", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_5b6319b2e9a37c1064a72428f9a", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"observationScopeId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE", + "table": "public.instance_ai_observation_cursors", + "referenced_table": "public.instance_ai_threads", + "columns": [ + "observationScopeId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_5b6319b2e9a37c1064a72428f9a", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"observationScopeId\")", + "table": "public.instance_ai_observation_cursors", + "referenced_table": "", + "columns": [ + "observationScopeId" + ] + } + ] + }, + { + "name": "public.instance_ai_observation_locks", + "type": "BASE TABLE", + "columns": [ + { + "name": "observationScopeId", + "type": "uuid", + "nullable": false, + "comment": "instance_ai_threads.id source stream locked for observation tasks" + }, + { + "name": "taskKind", + "type": "varchar(20)", + "nullable": false + }, + { + "name": "holderId", + "type": "varchar(64)", + "nullable": false, + "comment": "Ephemeral background-task lock owner token, not a user ID" + }, + { + "name": "heldUntil", + "type": "timestamp(3) with time zone", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_fc491dd378b9448655c3c683f85", + "def": "CREATE UNIQUE INDEX \"PK_fc491dd378b9448655c3c683f85\" ON public.instance_ai_observation_locks USING btree (\"observationScopeId\", \"taskKind\")", + "table": "public.instance_ai_observation_locks", + "columns": [ + "observationScopeId", + "taskKind" + ] + } + ], + "constraints": [ + { + "name": "CHK_instance_ai_observation_locks_taskKind", + "type": "CHECK", + "def": "CHECK (((\"taskKind\")::text = ANY ((ARRAY['observer'::character varying, 'reflector'::character varying])::text[])))", + "table": "public.instance_ai_observation_locks", + "referenced_table": "", + "columns": [ + "taskKind" + ] + }, + { + "name": "instance_ai_observation_locks_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.instance_ai_observation_locks", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "instance_ai_observation_locks_heldUntil_not_null", + "type": "n", + "def": "NOT NULL \"heldUntil\"", + "table": "public.instance_ai_observation_locks", + "referenced_table": "", + "columns": [ + "heldUntil" + ] + }, + { + "name": "instance_ai_observation_locks_holderId_not_null", + "type": "n", + "def": "NOT NULL \"holderId\"", + "table": "public.instance_ai_observation_locks", + "referenced_table": "", + "columns": [ + "holderId" + ] + }, + { + "name": "instance_ai_observation_locks_observationScopeId_not_null", + "type": "n", + "def": "NOT NULL \"observationScopeId\"", + "table": "public.instance_ai_observation_locks", + "referenced_table": "", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "instance_ai_observation_locks_taskKind_not_null", + "type": "n", + "def": "NOT NULL \"taskKind\"", + "table": "public.instance_ai_observation_locks", + "referenced_table": "", + "columns": [ + "taskKind" + ] + }, + { + "name": "instance_ai_observation_locks_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.instance_ai_observation_locks", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_103e2e5f454860b28ea05a82c74", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"observationScopeId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE", + "table": "public.instance_ai_observation_locks", + "referenced_table": "public.instance_ai_threads", + "columns": [ + "observationScopeId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_fc491dd378b9448655c3c683f85", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"observationScopeId\", \"taskKind\")", + "table": "public.instance_ai_observation_locks", + "referenced_table": "", + "columns": [ + "observationScopeId", + "taskKind" + ] + } + ] + }, + { + "name": "public.instance_ai_pending_confirmations", + "type": "BASE TABLE", + "columns": [ + { + "name": "requestId", + "type": "varchar(36)", + "nullable": false, + "comment": "HITL confirmation request identifier." + }, + { + "name": "threadId", + "type": "uuid", + "nullable": false, + "comment": "Instance AI thread that owns the confirmation." + }, + { + "name": "userId", + "type": "uuid", + "nullable": false, + "comment": "User who is expected to confirm or cancel." + }, + { + "name": "kind", + "type": "varchar(16)", + "nullable": false, + "comment": "'suspended' (resumable from checkpoint) or 'inline' (orchestrator-held Promise)." + }, + { + "name": "runId", + "type": "varchar(36)", + "nullable": false, + "comment": "External run ID; reused on resume for SSE correlation." + }, + { + "name": "toolCallId", + "type": "varchar(64)", + "nullable": true, + "comment": "Suspended tool call awaiting confirmation." + }, + { + "name": "messageGroupId", + "type": "varchar(36)", + "nullable": true, + "comment": "SSE event correlation group." + }, + { + "name": "checkpointKey", + "type": "varchar(255)", + "nullable": true, + "comment": "FK to instance_ai_checkpoints.key; also the SDK runId used to resume." + }, + { + "name": "checkpointTaskId", + "type": "varchar(36)", + "nullable": true, + "comment": "Set when the suspended run was a planned-task checkpoint follow-up." + }, + { + "name": "expiresAt", + "type": "timestamp(3) with time zone", + "nullable": true, + "comment": "TTL for the leader-only sweep; null disables auto-expiry." + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_25c38179c8d45095b168adfff80", + "def": "CREATE UNIQUE INDEX \"PK_25c38179c8d45095b168adfff80\" ON public.instance_ai_pending_confirmations USING btree (\"requestId\")", + "table": "public.instance_ai_pending_confirmations", + "columns": [ + "requestId" + ] + }, + { + "name": "IDX_ba67ee8dc311830a2eea89b6e9", + "def": "CREATE INDEX \"IDX_ba67ee8dc311830a2eea89b6e9\" ON public.instance_ai_pending_confirmations USING btree (\"threadId\")", + "table": "public.instance_ai_pending_confirmations", + "columns": [ + "threadId" + ] + }, + { + "name": "IDX_df5fd25c8bbfd2b042602600d8", + "def": "CREATE INDEX \"IDX_df5fd25c8bbfd2b042602600d8\" ON public.instance_ai_pending_confirmations USING btree (\"userId\")", + "table": "public.instance_ai_pending_confirmations", + "columns": [ + "userId" + ] + }, + { + "name": "IDX_0babdf6e3b897a86fe4678355e", + "def": "CREATE INDEX \"IDX_0babdf6e3b897a86fe4678355e\" ON public.instance_ai_pending_confirmations USING btree (\"checkpointKey\")", + "table": "public.instance_ai_pending_confirmations", + "columns": [ + "checkpointKey" + ] + }, + { + "name": "IDX_d7a4aba7440449865e2b924377", + "def": "CREATE INDEX \"IDX_d7a4aba7440449865e2b924377\" ON public.instance_ai_pending_confirmations USING btree (\"expiresAt\")", + "table": "public.instance_ai_pending_confirmations", + "columns": [ + "expiresAt" + ] + } + ], + "constraints": [ + { + "name": "CHK_instance_ai_pending_confirmations_kind", + "type": "CHECK", + "def": "CHECK (((kind)::text = ANY ((ARRAY['suspended'::character varying, 'inline'::character varying])::text[])))", + "table": "public.instance_ai_pending_confirmations", + "referenced_table": "", + "columns": [ + "kind" + ] + }, + { + "name": "instance_ai_pending_confirmations_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.instance_ai_pending_confirmations", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "instance_ai_pending_confirmations_kind_not_null", + "type": "n", + "def": "NOT NULL kind", + "table": "public.instance_ai_pending_confirmations", + "referenced_table": "", + "columns": [ + "kind" + ] + }, + { + "name": "instance_ai_pending_confirmations_requestId_not_null", + "type": "n", + "def": "NOT NULL \"requestId\"", + "table": "public.instance_ai_pending_confirmations", + "referenced_table": "", + "columns": [ + "requestId" + ] + }, + { + "name": "instance_ai_pending_confirmations_runId_not_null", + "type": "n", + "def": "NOT NULL \"runId\"", + "table": "public.instance_ai_pending_confirmations", + "referenced_table": "", + "columns": [ + "runId" + ] + }, + { + "name": "instance_ai_pending_confirmations_threadId_not_null", + "type": "n", + "def": "NOT NULL \"threadId\"", + "table": "public.instance_ai_pending_confirmations", + "referenced_table": "", + "columns": [ + "threadId" + ] + }, + { + "name": "instance_ai_pending_confirmations_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.instance_ai_pending_confirmations", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "instance_ai_pending_confirmations_userId_not_null", + "type": "n", + "def": "NOT NULL \"userId\"", + "table": "public.instance_ai_pending_confirmations", + "referenced_table": "", + "columns": [ + "userId" + ] + }, + { + "name": "FK_df5fd25c8bbfd2b042602600d8e", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE", + "table": "public.instance_ai_pending_confirmations", + "referenced_table": "public.user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_ba67ee8dc311830a2eea89b6e96", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"threadId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE", + "table": "public.instance_ai_pending_confirmations", + "referenced_table": "public.instance_ai_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_0babdf6e3b897a86fe4678355eb", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"checkpointKey\") REFERENCES instance_ai_checkpoints(key) ON DELETE CASCADE", + "table": "public.instance_ai_pending_confirmations", + "referenced_table": "public.instance_ai_checkpoints", + "columns": [ + "checkpointKey" + ], + "referenced_columns": [ + "key" + ] + }, + { + "name": "PK_25c38179c8d45095b168adfff80", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"requestId\")", + "table": "public.instance_ai_pending_confirmations", + "referenced_table": "", + "columns": [ + "requestId" + ] + } + ] + }, + { + "name": "public.mcp_registry_server", + "type": "BASE TABLE", + "columns": [ + { + "name": "slug", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "status", + "type": "varchar(50)", + "nullable": false, + "comment": "Server status in the MCP registry. Deprecated servers are not surfaced to users." + }, + { + "name": "version", + "type": "varchar(50)", + "nullable": false + }, + { + "name": "registryUpdatedAt", + "type": "timestamp(3) without time zone", + "nullable": false + }, + { + "name": "data", + "type": "json", + "nullable": false, + "default": "'{}'::json", + "comment": "JSON object containing server metadata (icons, remotes, tools, etc.)" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_12fd89a1fb8489513b0a91f5d31", + "def": "CREATE UNIQUE INDEX \"PK_12fd89a1fb8489513b0a91f5d31\" ON public.mcp_registry_server USING btree (slug)", + "table": "public.mcp_registry_server", + "columns": [ + "slug" + ] + } + ], + "constraints": [ + { + "name": "CHK_tmp_mcp_registry_server_status", + "type": "CHECK", + "def": "CHECK (((status)::text = ANY ((ARRAY['active'::character varying, 'deprecated'::character varying])::text[])))", + "table": "public.mcp_registry_server", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "tmp_mcp_registry_server_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.mcp_registry_server", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "tmp_mcp_registry_server_data_not_null", + "type": "n", + "def": "NOT NULL data", + "table": "public.mcp_registry_server", + "referenced_table": "", + "columns": [ + "data" + ] + }, + { + "name": "tmp_mcp_registry_server_registryUpdatedAt_not_null", + "type": "n", + "def": "NOT NULL \"registryUpdatedAt\"", + "table": "public.mcp_registry_server", + "referenced_table": "", + "columns": [ + "registryUpdatedAt" + ] + }, + { + "name": "tmp_mcp_registry_server_slug_not_null", + "type": "n", + "def": "NOT NULL slug", + "table": "public.mcp_registry_server", + "referenced_table": "", + "columns": [ + "slug" + ] + }, + { + "name": "tmp_mcp_registry_server_status_not_null", + "type": "n", + "def": "NOT NULL status", + "table": "public.mcp_registry_server", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "tmp_mcp_registry_server_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.mcp_registry_server", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "tmp_mcp_registry_server_version_not_null", + "type": "n", + "def": "NOT NULL version", + "table": "public.mcp_registry_server", + "referenced_table": "", + "columns": [ + "version" + ] + }, + { + "name": "PK_12fd89a1fb8489513b0a91f5d31", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (slug)", + "table": "public.mcp_registry_server", + "referenced_table": "", + "columns": [ + "slug" + ] + } + ] + }, + { + "name": "public.agent_files", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(16)", + "nullable": false, + "comment": "Application-generated n8n nano ID" + }, + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false, + "comment": "Agent that owns this uploaded file" + }, + { + "name": "binaryDataId", + "type": "text", + "nullable": false, + "comment": "Opaque BinaryDataService reference (mode-prefixed, e.g. \"filesystem-v2:\u003cuuid\u003e\"); not an FK to binary_data, which only has rows in DB storage mode" + }, + { + "name": "fileName", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "mimeType", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "fileSizeBytes", + "type": "integer", + "nullable": false, + "comment": "Uploaded file size in bytes" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_692920e59217af7d124cd95106f", + "def": "CREATE UNIQUE INDEX \"PK_692920e59217af7d124cd95106f\" ON public.agent_files USING btree (id)", + "table": "public.agent_files", + "columns": [ + "id" + ] + }, + { + "name": "IDX_45dafc48fe2ce95eac30fc8ffd", + "def": "CREATE INDEX \"IDX_45dafc48fe2ce95eac30fc8ffd\" ON public.agent_files USING btree (\"agentId\", \"createdAt\")", + "table": "public.agent_files", + "columns": [ + "agentId", + "createdAt" + ] + } + ], + "constraints": [ + { + "name": "agent_files_agentId_not_null", + "type": "n", + "def": "NOT NULL \"agentId\"", + "table": "public.agent_files", + "referenced_table": "", + "columns": [ + "agentId" + ] + }, + { + "name": "agent_files_binaryDataId_not_null", + "type": "n", + "def": "NOT NULL \"binaryDataId\"", + "table": "public.agent_files", + "referenced_table": "", + "columns": [ + "binaryDataId" + ] + }, + { + "name": "agent_files_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agent_files", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agent_files_fileName_not_null", + "type": "n", + "def": "NOT NULL \"fileName\"", + "table": "public.agent_files", + "referenced_table": "", + "columns": [ + "fileName" + ] + }, + { + "name": "agent_files_fileSizeBytes_not_null", + "type": "n", + "def": "NOT NULL \"fileSizeBytes\"", + "table": "public.agent_files", + "referenced_table": "", + "columns": [ + "fileSizeBytes" + ] + }, + { + "name": "agent_files_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.agent_files", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "agent_files_mimeType_not_null", + "type": "n", + "def": "NOT NULL \"mimeType\"", + "table": "public.agent_files", + "referenced_table": "", + "columns": [ + "mimeType" + ] + }, + { + "name": "agent_files_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agent_files", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_aca4514cb500494b64356c2e164", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE", + "table": "public.agent_files", + "referenced_table": "public.agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_692920e59217af7d124cd95106f", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.agent_files", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.agent_task_definition", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "varchar(32)", + "nullable": false, + "comment": "Application-generated task ID referenced from agent JSON config" + }, + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false, + "comment": "Owning agent; task definitions are deleted when the agent is deleted" + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "objective", + "type": "text", + "nullable": false, + "comment": "User-authored instruction sent to the agent when this task runs" + }, + { + "name": "cronExpression", + "type": "varchar(128)", + "nullable": false, + "comment": "Cron schedule evaluated using the instance timezone" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_1756c11c637903e97629a7a784a", + "def": "CREATE UNIQUE INDEX \"PK_1756c11c637903e97629a7a784a\" ON public.agent_task_definition USING btree (id)", + "table": "public.agent_task_definition", + "columns": [ + "id" + ] + }, + { + "name": "IDX_f45d0535a2ed59b6c2dd6da98a", + "def": "CREATE INDEX \"IDX_f45d0535a2ed59b6c2dd6da98a\" ON public.agent_task_definition USING btree (\"agentId\")", + "table": "public.agent_task_definition", + "columns": [ + "agentId" + ] + } + ], + "constraints": [ + { + "name": "agent_task_definition_agentId_not_null", + "type": "n", + "def": "NOT NULL \"agentId\"", + "table": "public.agent_task_definition", + "referenced_table": "", + "columns": [ + "agentId" + ] + }, + { + "name": "agent_task_definition_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agent_task_definition", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agent_task_definition_cronExpression_not_null", + "type": "n", + "def": "NOT NULL \"cronExpression\"", + "table": "public.agent_task_definition", + "referenced_table": "", + "columns": [ + "cronExpression" + ] + }, + { + "name": "agent_task_definition_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.agent_task_definition", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "agent_task_definition_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.agent_task_definition", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "agent_task_definition_objective_not_null", + "type": "n", + "def": "NOT NULL objective", + "table": "public.agent_task_definition", + "referenced_table": "", + "columns": [ + "objective" + ] + }, + { + "name": "agent_task_definition_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agent_task_definition", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_f45d0535a2ed59b6c2dd6da98a0", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE", + "table": "public.agent_task_definition", + "referenced_table": "public.agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_1756c11c637903e97629a7a784a", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.agent_task_definition", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.agent_task_snapshot", + "type": "BASE TABLE", + "columns": [ + { + "name": "versionId", + "type": "varchar(36)", + "nullable": false, + "comment": "Published agent_history version this task snapshot belongs to" + }, + { + "name": "taskId", + "type": "varchar(32)", + "nullable": false, + "comment": "Stable task ID referenced from the published agent JSON config" + }, + { + "name": "enabled", + "type": "boolean", + "nullable": false, + "comment": "Published enabled state for this task at publish time" + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "objective", + "type": "text", + "nullable": false, + "comment": "User-authored instruction sent to the agent when this task runs" + }, + { + "name": "cronExpression", + "type": "varchar(128)", + "nullable": false, + "comment": "Cron schedule evaluated using the instance timezone" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_2142a8bcda2360c3c5e34f82640", + "def": "CREATE UNIQUE INDEX \"PK_2142a8bcda2360c3c5e34f82640\" ON public.agent_task_snapshot USING btree (\"versionId\", \"taskId\")", + "table": "public.agent_task_snapshot", + "columns": [ + "versionId", + "taskId" + ] + } + ], + "constraints": [ + { + "name": "agent_task_snapshot_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agent_task_snapshot", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agent_task_snapshot_cronExpression_not_null", + "type": "n", + "def": "NOT NULL \"cronExpression\"", + "table": "public.agent_task_snapshot", + "referenced_table": "", + "columns": [ + "cronExpression" + ] + }, + { + "name": "agent_task_snapshot_enabled_not_null", + "type": "n", + "def": "NOT NULL enabled", + "table": "public.agent_task_snapshot", + "referenced_table": "", + "columns": [ + "enabled" + ] + }, + { + "name": "agent_task_snapshot_name_not_null", + "type": "n", + "def": "NOT NULL name", + "table": "public.agent_task_snapshot", + "referenced_table": "", + "columns": [ + "name" + ] + }, + { + "name": "agent_task_snapshot_objective_not_null", + "type": "n", + "def": "NOT NULL objective", + "table": "public.agent_task_snapshot", + "referenced_table": "", + "columns": [ + "objective" + ] + }, + { + "name": "agent_task_snapshot_taskId_not_null", + "type": "n", + "def": "NOT NULL \"taskId\"", + "table": "public.agent_task_snapshot", + "referenced_table": "", + "columns": [ + "taskId" + ] + }, + { + "name": "agent_task_snapshot_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agent_task_snapshot", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "agent_task_snapshot_versionId_not_null", + "type": "n", + "def": "NOT NULL \"versionId\"", + "table": "public.agent_task_snapshot", + "referenced_table": "", + "columns": [ + "versionId" + ] + }, + { + "name": "FK_1acedce6690392ef1611cca8b88", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"versionId\") REFERENCES agent_history(\"versionId\") ON DELETE CASCADE", + "table": "public.agent_task_snapshot", + "referenced_table": "public.agent_history", + "columns": [ + "versionId" + ], + "referenced_columns": [ + "versionId" + ] + }, + { + "name": "PK_2142a8bcda2360c3c5e34f82640", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"versionId\", \"taskId\")", + "table": "public.agent_task_snapshot", + "referenced_table": "", + "columns": [ + "versionId", + "taskId" + ] + } + ] + }, + { + "name": "public.agent_task_run_lock", + "type": "BASE TABLE", + "columns": [ + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false, + "comment": "Published agent whose scheduled task run is locked" + }, + { + "name": "taskId", + "type": "varchar(32)", + "nullable": false, + "comment": "Published task ID whose scheduled run is locked" + }, + { + "name": "holderId", + "type": "uuid", + "nullable": false, + "comment": "Ephemeral lock owner token generated by the running main" + }, + { + "name": "heldUntil", + "type": "timestamp(3) with time zone", + "nullable": false, + "comment": "Time after which another main can claim this task run lock" + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_f593adaf7230e964d3c25deda64", + "def": "CREATE UNIQUE INDEX \"PK_f593adaf7230e964d3c25deda64\" ON public.agent_task_run_lock USING btree (\"agentId\", \"taskId\")", + "table": "public.agent_task_run_lock", + "columns": [ + "agentId", + "taskId" + ] + } + ], + "constraints": [ + { + "name": "agent_task_run_lock_agentId_not_null", + "type": "n", + "def": "NOT NULL \"agentId\"", + "table": "public.agent_task_run_lock", + "referenced_table": "", + "columns": [ + "agentId" + ] + }, + { + "name": "agent_task_run_lock_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.agent_task_run_lock", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "agent_task_run_lock_heldUntil_not_null", + "type": "n", + "def": "NOT NULL \"heldUntil\"", + "table": "public.agent_task_run_lock", + "referenced_table": "", + "columns": [ + "heldUntil" + ] + }, + { + "name": "agent_task_run_lock_holderId_not_null", + "type": "n", + "def": "NOT NULL \"holderId\"", + "table": "public.agent_task_run_lock", + "referenced_table": "", + "columns": [ + "holderId" + ] + }, + { + "name": "agent_task_run_lock_taskId_not_null", + "type": "n", + "def": "NOT NULL \"taskId\"", + "table": "public.agent_task_run_lock", + "referenced_table": "", + "columns": [ + "taskId" + ] + }, + { + "name": "agent_task_run_lock_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.agent_task_run_lock", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "FK_b57a2862ae869aab24e54cefd48", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE", + "table": "public.agent_task_run_lock", + "referenced_table": "public.agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "PK_f593adaf7230e964d3c25deda64", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (\"agentId\", \"taskId\")", + "table": "public.agent_task_run_lock", + "referenced_table": "", + "columns": [ + "agentId", + "taskId" + ] + } + ] + }, + { + "name": "public.instance_ai_mcp_registry_connections", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "uuid", + "nullable": false + }, + { + "name": "credentialId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "serverSlug", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "toolFilter", + "type": "json", + "nullable": true, + "comment": "Optional MCP tool filter per registry connection: { mode: \"allow\" | \"exclude\", tools: string[] }" + }, + { + "name": "userId", + "type": "uuid", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_e34e4d15d78eabbe8217e33ef03", + "def": "CREATE UNIQUE INDEX \"PK_e34e4d15d78eabbe8217e33ef03\" ON public.instance_ai_mcp_registry_connections USING btree (id)", + "table": "public.instance_ai_mcp_registry_connections", + "columns": [ + "id" + ] + }, + { + "name": "IDX_16db3adb7b19df1ee55ff06b27", + "def": "CREATE UNIQUE INDEX \"IDX_16db3adb7b19df1ee55ff06b27\" ON public.instance_ai_mcp_registry_connections USING btree (\"userId\", \"serverSlug\", \"credentialId\")", + "table": "public.instance_ai_mcp_registry_connections", + "columns": [ + "userId", + "serverSlug", + "credentialId" + ] + } + ], + "constraints": [ + { + "name": "instance_ai_mcp_registry_connections_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.instance_ai_mcp_registry_connections", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "instance_ai_mcp_registry_connections_credentialId_not_null", + "type": "n", + "def": "NOT NULL \"credentialId\"", + "table": "public.instance_ai_mcp_registry_connections", + "referenced_table": "", + "columns": [ + "credentialId" + ] + }, + { + "name": "instance_ai_mcp_registry_connections_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.instance_ai_mcp_registry_connections", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "instance_ai_mcp_registry_connections_serverSlug_not_null", + "type": "n", + "def": "NOT NULL \"serverSlug\"", + "table": "public.instance_ai_mcp_registry_connections", + "referenced_table": "", + "columns": [ + "serverSlug" + ] + }, + { + "name": "instance_ai_mcp_registry_connections_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.instance_ai_mcp_registry_connections", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "instance_ai_mcp_registry_connections_userId_not_null", + "type": "n", + "def": "NOT NULL \"userId\"", + "table": "public.instance_ai_mcp_registry_connections", + "referenced_table": "", + "columns": [ + "userId" + ] + }, + { + "name": "FK_8b42c08a531d76410980c639a5b", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE", + "table": "public.instance_ai_mcp_registry_connections", + "referenced_table": "public.user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_1e826120e7e53ebc4681f026de8", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"credentialId\") REFERENCES credentials_entity(id) ON DELETE CASCADE", + "table": "public.instance_ai_mcp_registry_connections", + "referenced_table": "public.credentials_entity", + "columns": [ + "credentialId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "FK_1d25707354d2012da256eb2ec0a", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (\"serverSlug\") REFERENCES mcp_registry_server(slug) ON DELETE CASCADE", + "table": "public.instance_ai_mcp_registry_connections", + "referenced_table": "public.mcp_registry_server", + "columns": [ + "serverSlug" + ], + "referenced_columns": [ + "slug" + ] + }, + { + "name": "PK_e34e4d15d78eabbe8217e33ef03", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.instance_ai_mcp_registry_connections", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + }, + { + "name": "public.workflow_publication_outbox", + "type": "BASE TABLE", + "columns": [ + { + "name": "id", + "type": "integer", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false, + "comment": "References workflow_entity.id." + }, + { + "name": "publishedVersionId", + "type": "varchar(36)", + "nullable": false, + "comment": "References workflow_history.versionId." + }, + { + "name": "status", + "type": "varchar(20)", + "nullable": false + }, + { + "name": "errorMessage", + "type": "text", + "nullable": true, + "comment": "Error details for surfacing failed publications to the user." + }, + { + "name": "createdAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + }, + { + "name": "updatedAt", + "type": "timestamp(3) with time zone", + "nullable": false, + "default": "CURRENT_TIMESTAMP(3)" + } + ], + "indexes": [ + { + "name": "PK_b3e2eeee36a4bd044d56468d311", + "def": "CREATE UNIQUE INDEX \"PK_b3e2eeee36a4bd044d56468d311\" ON public.workflow_publication_outbox USING btree (id)", + "table": "public.workflow_publication_outbox", + "columns": [ + "id" + ] + }, + { + "name": "IDX_workflow_publication_outbox_active_workflow_status", + "def": "CREATE UNIQUE INDEX \"IDX_workflow_publication_outbox_active_workflow_status\" ON public.workflow_publication_outbox USING btree (\"workflowId\", status) WHERE ((status)::text = ANY ((ARRAY['pending'::character varying, 'in_progress'::character varying])::text[]))", + "table": "public.workflow_publication_outbox", + "columns": [ + "workflowId", + "status" + ] + } + ], + "constraints": [ + { + "name": "CHK_workflow_publication_outbox_status", + "type": "CHECK", + "def": "CHECK (((status)::text = ANY ((ARRAY['pending'::character varying, 'in_progress'::character varying, 'completed'::character varying, 'partial_success'::character varying, 'failed'::character varying])::text[])))", + "table": "public.workflow_publication_outbox", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "workflow_publication_outbox_createdAt_not_null", + "type": "n", + "def": "NOT NULL \"createdAt\"", + "table": "public.workflow_publication_outbox", + "referenced_table": "", + "columns": [ + "createdAt" + ] + }, + { + "name": "workflow_publication_outbox_id_not_null", + "type": "n", + "def": "NOT NULL id", + "table": "public.workflow_publication_outbox", + "referenced_table": "", + "columns": [ + "id" + ] + }, + { + "name": "workflow_publication_outbox_publishedVersionId_not_null", + "type": "n", + "def": "NOT NULL \"publishedVersionId\"", + "table": "public.workflow_publication_outbox", + "referenced_table": "", + "columns": [ + "publishedVersionId" + ] + }, + { + "name": "workflow_publication_outbox_status_not_null", + "type": "n", + "def": "NOT NULL status", + "table": "public.workflow_publication_outbox", + "referenced_table": "", + "columns": [ + "status" + ] + }, + { + "name": "workflow_publication_outbox_updatedAt_not_null", + "type": "n", + "def": "NOT NULL \"updatedAt\"", + "table": "public.workflow_publication_outbox", + "referenced_table": "", + "columns": [ + "updatedAt" + ] + }, + { + "name": "workflow_publication_outbox_workflowId_not_null", + "type": "n", + "def": "NOT NULL \"workflowId\"", + "table": "public.workflow_publication_outbox", + "referenced_table": "", + "columns": [ + "workflowId" + ] + }, + { + "name": "PK_b3e2eeee36a4bd044d56468d311", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "public.workflow_publication_outbox", + "referenced_table": "", + "columns": [ + "id" + ] + } + ] + } + ], + "relations": [ + { + "table": "public.credentials_entity", + "columns": [ + "resolverId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.dynamic_credential_resolver", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"resolverId\") REFERENCES dynamic_credential_resolver(id) ON DELETE SET NULL" + }, + { + "table": "public.execution_entity", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.workflow_entity", + "columns": [ + "activeVersionId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_history", + "parent_columns": [ + "versionId" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"activeVersionId\") REFERENCES workflow_history(\"versionId\") ON DELETE RESTRICT" + }, + { + "table": "public.workflow_entity", + "columns": [ + "parentFolderId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.folder", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"parentFolderId\") REFERENCES folder(id) ON DELETE CASCADE" + }, + { + "table": "public.webhook_entity", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.workflows_tags", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.workflows_tags", + "columns": [ + "tagId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.tag_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"tagId\") REFERENCES tag_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.user", + "columns": [ + "roleSlug" + ], + "cardinality": "zero_or_more", + "parent_table": "public.role", + "parent_columns": [ + "slug" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"roleSlug\") REFERENCES role(slug)" + }, + { + "table": "public.installed_nodes", + "columns": [ + "package" + ], + "cardinality": "zero_or_more", + "parent_table": "public.installed_packages", + "parent_columns": [ + "packageName" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (package) REFERENCES installed_packages(\"packageName\") ON UPDATE CASCADE ON DELETE CASCADE" + }, + { + "table": "public.auth_identity", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id)" + }, + { + "table": "public.variables", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE" + }, + { + "table": "public.execution_data", + "columns": [ + "executionId" + ], + "cardinality": "zero_or_one", + "parent_table": "public.execution_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"executionId\") REFERENCES execution_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.workflow_history", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.project", + "columns": [ + "creatorId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"creatorId\") REFERENCES \"user\"(id) ON DELETE SET NULL" + }, + { + "table": "public.project_relation", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE" + }, + { + "table": "public.project_relation", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE" + }, + { + "table": "public.project_relation", + "columns": [ + "role" + ], + "cardinality": "zero_or_more", + "parent_table": "public.role", + "parent_columns": [ + "slug" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (role) REFERENCES role(slug)" + }, + { + "table": "public.shared_credentials", + "columns": [ + "credentialsId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.credentials_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"credentialsId\") REFERENCES credentials_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.shared_credentials", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE" + }, + { + "table": "public.shared_workflow", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.shared_workflow", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE" + }, + { + "table": "public.execution_metadata", + "columns": [ + "executionId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.execution_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"executionId\") REFERENCES execution_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.execution_annotations", + "columns": [ + "executionId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.execution_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"executionId\") REFERENCES execution_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.execution_annotation_tags", + "columns": [ + "annotationId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.execution_annotations", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"annotationId\") REFERENCES execution_annotations(id) ON DELETE CASCADE" + }, + { + "table": "public.execution_annotation_tags", + "columns": [ + "tagId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.annotation_tag_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"tagId\") REFERENCES annotation_tag_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.user_api_keys", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE" + }, + { + "table": "public.processed_data", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.folder", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE" + }, + { + "table": "public.folder", + "columns": [ + "parentFolderId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.folder", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"parentFolderId\") REFERENCES folder(id) ON DELETE CASCADE" + }, + { + "table": "public.folder_tag", + "columns": [ + "tagId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.tag_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"tagId\") REFERENCES tag_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.folder_tag", + "columns": [ + "folderId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.folder", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"folderId\") REFERENCES folder(id) ON DELETE CASCADE" + }, + { + "table": "public.insights_metadata", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE SET NULL" + }, + { + "table": "public.insights_metadata", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE SET NULL" + }, + { + "table": "public.insights_raw", + "columns": [ + "metaId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.insights_metadata", + "parent_columns": [ + "metaId" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"metaId\") REFERENCES insights_metadata(\"metaId\") ON DELETE CASCADE" + }, + { + "table": "public.insights_by_period", + "columns": [ + "metaId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.insights_metadata", + "parent_columns": [ + "metaId" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"metaId\") REFERENCES insights_metadata(\"metaId\") ON DELETE CASCADE" + }, + { + "table": "public.test_run", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.test_run", + "columns": [ + "evaluationConfigId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.evaluation_config", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"evaluationConfigId\") REFERENCES evaluation_config(id) ON DELETE SET NULL" + }, + { + "table": "public.test_run", + "columns": [ + "collectionId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.evaluation_collection", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"collectionId\") REFERENCES evaluation_collection(id) ON DELETE SET NULL" + }, + { + "table": "public.test_case_execution", + "columns": [ + "executionId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.execution_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"executionId\") REFERENCES execution_entity(id) ON DELETE SET NULL" + }, + { + "table": "public.test_case_execution", + "columns": [ + "testRunId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.test_run", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"testRunId\") REFERENCES test_run(id) ON DELETE CASCADE" + }, + { + "table": "public.role_scope", + "columns": [ + "scopeSlug" + ], + "cardinality": "zero_or_more", + "parent_table": "public.scope", + "parent_columns": [ + "slug" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"scopeSlug\") REFERENCES scope(slug) ON UPDATE CASCADE ON DELETE CASCADE" + }, + { + "table": "public.role_scope", + "columns": [ + "roleSlug" + ], + "cardinality": "zero_or_more", + "parent_table": "public.role", + "parent_columns": [ + "slug" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"roleSlug\") REFERENCES role(slug) ON UPDATE CASCADE ON DELETE CASCADE" + }, + { + "table": "public.data_table", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE" + }, + { + "table": "public.data_table_column", + "columns": [ + "dataTableId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.data_table", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"dataTableId\") REFERENCES data_table(id) ON DELETE CASCADE" + }, + { + "table": "public.chat_hub_sessions", + "columns": [ + "ownerId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"ownerId\") REFERENCES \"user\"(id) ON DELETE CASCADE" + }, + { + "table": "public.chat_hub_sessions", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE SET NULL" + }, + { + "table": "public.chat_hub_sessions", + "columns": [ + "credentialId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.credentials_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"credentialId\") REFERENCES credentials_entity(id) ON DELETE SET NULL" + }, + { + "table": "public.chat_hub_sessions", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.chat_hub_agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"agentId\") REFERENCES chat_hub_agents(id) ON DELETE SET NULL" + }, + { + "table": "public.chat_hub_messages", + "columns": [ + "executionId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.execution_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"executionId\") REFERENCES execution_entity(id) ON DELETE SET NULL" + }, + { + "table": "public.chat_hub_messages", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE SET NULL" + }, + { + "table": "public.chat_hub_messages", + "columns": [ + "sessionId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.chat_hub_sessions", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"sessionId\") REFERENCES chat_hub_sessions(id) ON DELETE CASCADE" + }, + { + "table": "public.chat_hub_messages", + "columns": [ + "revisionOfMessageId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.chat_hub_messages", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"revisionOfMessageId\") REFERENCES chat_hub_messages(id) ON DELETE CASCADE" + }, + { + "table": "public.chat_hub_messages", + "columns": [ + "retryOfMessageId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.chat_hub_messages", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"retryOfMessageId\") REFERENCES chat_hub_messages(id) ON DELETE CASCADE" + }, + { + "table": "public.chat_hub_messages", + "columns": [ + "previousMessageId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.chat_hub_messages", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"previousMessageId\") REFERENCES chat_hub_messages(id) ON DELETE CASCADE" + }, + { + "table": "public.chat_hub_messages", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.chat_hub_agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"agentId\") REFERENCES chat_hub_agents(id) ON DELETE SET NULL" + }, + { + "table": "public.chat_hub_agents", + "columns": [ + "ownerId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"ownerId\") REFERENCES \"user\"(id) ON DELETE CASCADE" + }, + { + "table": "public.chat_hub_agents", + "columns": [ + "credentialId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.credentials_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"credentialId\") REFERENCES credentials_entity(id) ON DELETE SET NULL" + }, + { + "table": "public.oauth_authorization_codes", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE" + }, + { + "table": "public.oauth_authorization_codes", + "columns": [ + "clientId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.oauth_clients", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"clientId\") REFERENCES oauth_clients(id) ON DELETE CASCADE" + }, + { + "table": "public.oauth_access_tokens", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE" + }, + { + "table": "public.oauth_access_tokens", + "columns": [ + "clientId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.oauth_clients", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"clientId\") REFERENCES oauth_clients(id) ON DELETE CASCADE" + }, + { + "table": "public.oauth_refresh_tokens", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE" + }, + { + "table": "public.oauth_refresh_tokens", + "columns": [ + "clientId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.oauth_clients", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"clientId\") REFERENCES oauth_clients(id) ON DELETE CASCADE" + }, + { + "table": "public.oauth_user_consents", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE" + }, + { + "table": "public.oauth_user_consents", + "columns": [ + "clientId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.oauth_clients", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"clientId\") REFERENCES oauth_clients(id) ON DELETE CASCADE" + }, + { + "table": "public.workflow_dependency", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.workflow_publish_history", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE SET NULL" + }, + { + "table": "public.workflow_publish_history", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.workflow_publish_history", + "columns": [ + "versionId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_history", + "parent_columns": [ + "versionId" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"versionId\") REFERENCES workflow_history(\"versionId\") ON DELETE SET NULL" + }, + { + "table": "public.dynamic_credential_user_entry", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE" + }, + { + "table": "public.dynamic_credential_user_entry", + "columns": [ + "credentialId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.credentials_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"credentialId\") REFERENCES credentials_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.dynamic_credential_user_entry", + "columns": [ + "resolverId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.dynamic_credential_resolver", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"resolverId\") REFERENCES dynamic_credential_resolver(id) ON DELETE CASCADE" + }, + { + "table": "public.project_secrets_provider_access", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE" + }, + { + "table": "public.project_secrets_provider_access", + "columns": [ + "secretsProviderConnectionId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.secrets_provider_connection", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"secretsProviderConnectionId\") REFERENCES secrets_provider_connection(id) ON DELETE CASCADE" + }, + { + "table": "public.workflow_published_version", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_one", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE RESTRICT" + }, + { + "table": "public.workflow_published_version", + "columns": [ + "publishedVersionId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_history", + "parent_columns": [ + "versionId" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"publishedVersionId\") REFERENCES workflow_history(\"versionId\") ON DELETE RESTRICT" + }, + { + "table": "public.dynamic_credential_entry", + "columns": [ + "credential_id" + ], + "cardinality": "zero_or_more", + "parent_table": "public.credentials_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (credential_id) REFERENCES credentials_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.dynamic_credential_entry", + "columns": [ + "resolver_id" + ], + "cardinality": "zero_or_more", + "parent_table": "public.dynamic_credential_resolver", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (resolver_id) REFERENCES dynamic_credential_resolver(id) ON DELETE CASCADE" + }, + { + "table": "public.chat_hub_tools", + "columns": [ + "ownerId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"ownerId\") REFERENCES \"user\"(id) ON DELETE CASCADE" + }, + { + "table": "public.chat_hub_session_tools", + "columns": [ + "sessionId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.chat_hub_sessions", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"sessionId\") REFERENCES chat_hub_sessions(id) ON DELETE CASCADE" + }, + { + "table": "public.chat_hub_session_tools", + "columns": [ + "toolId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.chat_hub_tools", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"toolId\") REFERENCES chat_hub_tools(id) ON DELETE CASCADE" + }, + { + "table": "public.chat_hub_agent_tools", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.chat_hub_agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"agentId\") REFERENCES chat_hub_agents(id) ON DELETE CASCADE" + }, + { + "table": "public.chat_hub_agent_tools", + "columns": [ + "toolId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.chat_hub_tools", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"toolId\") REFERENCES chat_hub_tools(id) ON DELETE CASCADE" + }, + { + "table": "public.workflow_builder_session", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE" + }, + { + "table": "public.workflow_builder_session", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.role_mapping_rule", + "columns": [ + "role" + ], + "cardinality": "zero_or_more", + "parent_table": "public.role", + "parent_columns": [ + "slug" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (role) REFERENCES role(slug) ON UPDATE CASCADE ON DELETE CASCADE" + }, + { + "table": "public.role_mapping_rule_project", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE" + }, + { + "table": "public.role_mapping_rule_project", + "columns": [ + "roleMappingRuleId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.role_mapping_rule", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"roleMappingRuleId\") REFERENCES role_mapping_rule(id) ON DELETE CASCADE" + }, + { + "table": "public.credential_dependency", + "columns": [ + "credentialId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.credentials_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"credentialId\") REFERENCES credentials_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.instance_ai_threads", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE" + }, + { + "table": "public.instance_ai_messages", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"threadId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + }, + { + "table": "public.instance_ai_observational_memory", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"threadId\") REFERENCES instance_ai_threads(id) ON DELETE SET NULL" + }, + { + "table": "public.instance_ai_run_snapshots", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"threadId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + }, + { + "table": "public.instance_ai_iteration_logs", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"threadId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + }, + { + "table": "public.trusted_key", + "columns": [ + "sourceId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.trusted_key_source", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"sourceId\") REFERENCES trusted_key_source(id) ON DELETE CASCADE" + }, + { + "table": "public.user_favorites", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE" + }, + { + "table": "public.ai_builder_temporary_workflow", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_one", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.ai_builder_temporary_workflow", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"threadId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + }, + { + "table": "public.evaluation_config", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.evaluation_collection", + "columns": [ + "createdById" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"createdById\") REFERENCES \"user\"(id) ON DELETE SET NULL" + }, + { + "table": "public.evaluation_collection", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"workflowId\") REFERENCES workflow_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.evaluation_collection", + "columns": [ + "evaluationConfigId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.evaluation_config", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"evaluationConfigId\") REFERENCES evaluation_config(id) ON DELETE CASCADE" + }, + { + "table": "public.agents", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE" + }, + { + "table": "public.agents", + "columns": [ + "activeVersionId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agent_history", + "parent_columns": [ + "versionId" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"activeVersionId\") REFERENCES agent_history(\"versionId\") ON DELETE SET NULL" + }, + { + "table": "public.agent_checkpoints", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_messages", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"threadId\") REFERENCES agents_threads(id) ON DELETE CASCADE" + }, + { + "table": "public.agent_execution_threads", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"projectId\") REFERENCES project(id) ON DELETE CASCADE" + }, + { + "table": "public.agent_execution_threads", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE" + }, + { + "table": "public.agent_execution_threads", + "columns": [ + "taskVersionId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agent_history", + "parent_columns": [ + "versionId" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"taskVersionId\") REFERENCES agent_history(\"versionId\") ON DELETE SET NULL" + }, + { + "table": "public.agent_execution", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agent_execution_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"threadId\") REFERENCES agent_execution_threads(id) ON DELETE CASCADE" + }, + { + "table": "public.instance_ai_checkpoints", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"threadId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_observations", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_observations", + "columns": [ + "supersededBy" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents_observations", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"supersededBy\") REFERENCES agents_observations(id)" + }, + { + "table": "public.agents_observations", + "columns": [ + "parentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents_observations", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"parentId\") REFERENCES agents_observations(id)" + }, + { + "table": "public.agents_observations", + "columns": [ + "observationScopeId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"observationScopeId\") REFERENCES agents_threads(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_observation_cursors", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_observation_cursors", + "columns": [ + "observationScopeId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"observationScopeId\") REFERENCES agents_threads(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_observation_locks", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_observation_locks", + "columns": [ + "observationScopeId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"observationScopeId\") REFERENCES agents_threads(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_memory_entries", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_memory_entries", + "columns": [ + "resourceId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents_resources", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"resourceId\") REFERENCES agents_resources(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_memory_entries", + "columns": [ + "supersededBy" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents_memory_entries", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"supersededBy\") REFERENCES agents_memory_entries(id)" + }, + { + "table": "public.agents_memory_entry_locks", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_memory_entry_locks", + "columns": [ + "resourceId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents_resources", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"resourceId\") REFERENCES agents_resources(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_memory_entry_sources", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_memory_entry_sources", + "columns": [ + "observationId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents_observations", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"observationId\") REFERENCES agents_observations(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_memory_entry_sources", + "columns": [ + "memoryEntryId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents_memory_entries", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"memoryEntryId\") REFERENCES agents_memory_entries(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_memory_entry_sources", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"threadId\") REFERENCES agents_threads(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_memory_entry_cursors", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE" + }, + { + "table": "public.agents_memory_entry_cursors", + "columns": [ + "observationScopeId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"observationScopeId\") REFERENCES agents_threads(id) ON DELETE CASCADE" + }, + { + "table": "public.agent_history", + "columns": [ + "publishedById" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"publishedById\") REFERENCES \"user\"(id) ON DELETE SET NULL" + }, + { + "table": "public.agent_history", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE" + }, + { + "table": "public.instance_ai_observations", + "columns": [ + "observationScopeId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"observationScopeId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + }, + { + "table": "public.instance_ai_observations", + "columns": [ + "supersededBy" + ], + "cardinality": "zero_or_more", + "parent_table": "public.instance_ai_observations", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"supersededBy\") REFERENCES instance_ai_observations(id)" + }, + { + "table": "public.instance_ai_observations", + "columns": [ + "parentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.instance_ai_observations", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"parentId\") REFERENCES instance_ai_observations(id)" + }, + { + "table": "public.instance_ai_observation_cursors", + "columns": [ + "observationScopeId" + ], + "cardinality": "zero_or_one", + "parent_table": "public.instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"observationScopeId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + }, + { + "table": "public.instance_ai_observation_locks", + "columns": [ + "observationScopeId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"observationScopeId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + }, + { + "table": "public.instance_ai_pending_confirmations", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE" + }, + { + "table": "public.instance_ai_pending_confirmations", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"threadId\") REFERENCES instance_ai_threads(id) ON DELETE CASCADE" + }, + { + "table": "public.instance_ai_pending_confirmations", + "columns": [ + "checkpointKey" + ], + "cardinality": "zero_or_more", + "parent_table": "public.instance_ai_checkpoints", + "parent_columns": [ + "key" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (\"checkpointKey\") REFERENCES instance_ai_checkpoints(key) ON DELETE CASCADE" + }, + { + "table": "public.agent_files", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE" + }, + { + "table": "public.agent_task_definition", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE" + }, + { + "table": "public.agent_task_snapshot", + "columns": [ + "versionId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agent_history", + "parent_columns": [ + "versionId" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"versionId\") REFERENCES agent_history(\"versionId\") ON DELETE CASCADE" + }, + { + "table": "public.agent_task_run_lock", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"agentId\") REFERENCES agents(id) ON DELETE CASCADE" + }, + { + "table": "public.instance_ai_mcp_registry_connections", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"userId\") REFERENCES \"user\"(id) ON DELETE CASCADE" + }, + { + "table": "public.instance_ai_mcp_registry_connections", + "columns": [ + "credentialId" + ], + "cardinality": "zero_or_more", + "parent_table": "public.credentials_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"credentialId\") REFERENCES credentials_entity(id) ON DELETE CASCADE" + }, + { + "table": "public.instance_ai_mcp_registry_connections", + "columns": [ + "serverSlug" + ], + "cardinality": "zero_or_more", + "parent_table": "public.mcp_registry_server", + "parent_columns": [ + "slug" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (\"serverSlug\") REFERENCES mcp_registry_server(slug) ON DELETE CASCADE" + } + ], + "functions": [ + { + "name": "public.uuid_nil", + "return_type": "uuid", + "arguments": "", + "type": "FUNCTION" + }, + { + "name": "public.uuid_ns_dns", + "return_type": "uuid", + "arguments": "", + "type": "FUNCTION" + }, + { + "name": "public.uuid_ns_url", + "return_type": "uuid", + "arguments": "", + "type": "FUNCTION" + }, + { + "name": "public.uuid_ns_oid", + "return_type": "uuid", + "arguments": "", + "type": "FUNCTION" + }, + { + "name": "public.uuid_ns_x500", + "return_type": "uuid", + "arguments": "", + "type": "FUNCTION" + }, + { + "name": "public.uuid_generate_v1", + "return_type": "uuid", + "arguments": "", + "type": "FUNCTION" + }, + { + "name": "public.uuid_generate_v1mc", + "return_type": "uuid", + "arguments": "", + "type": "FUNCTION" + }, + { + "name": "public.uuid_generate_v3", + "return_type": "uuid", + "arguments": "namespace uuid, name text", + "type": "FUNCTION" + }, + { + "name": "public.uuid_generate_v4", + "return_type": "uuid", + "arguments": "", + "type": "FUNCTION" + }, + { + "name": "public.uuid_generate_v5", + "return_type": "uuid", + "arguments": "namespace uuid, name text", + "type": "FUNCTION" + }, + { + "name": "public.increment_workflow_version", + "return_type": "trigger", + "arguments": "", + "type": "FUNCTION" + } + ], + "driver": { + "name": "postgres", + "database_version": "PostgreSQL 18.4 on aarch64-unknown-linux-musl, compiled by gcc (Alpine 15.2.0) 15.2.0, 64-bit", + "meta": { + "current_schema": "public", + "search_paths": [ + "public" + ], + "dict": { + "Functions": "Stored procedures and functions" + } + } + } +} diff --git a/docs/generated/sqlite-schema/README.md b/docs/generated/sqlite-schema/README.md new file mode 100644 index 00000000000..bc60ff5e15c --- /dev/null +++ b/docs/generated/sqlite-schema/README.md @@ -0,0 +1,1299 @@ +# n8n database schema (SQLite) + +## Description + +Auto-generated from the SQLite migrations in @n8n/db. Do not edit by hand. + +## Tables + +| Name | Columns | Comment | Type | +| ---- | ------- | ------- | ---- | +| [settings](settings.md) | 3 | | table | +| [installed_packages](installed_packages.md) | 6 | | table | +| [installed_nodes](installed_nodes.md) | 4 | | table | +| [event_destinations](event_destinations.md) | 4 | | table | +| [auth_identity](auth_identity.md) | 5 | | table | +| [auth_provider_sync_history](auth_provider_sync_history.md) | 11 | | table | +| [tag_entity](tag_entity.md) | 4 | | table | +| [workflows_tags](workflows_tags.md) | 2 | | table | +| [webhook_entity](webhook_entity.md) | 6 | | table | +| [execution_data](execution_data.md) | 4 | | table | +| [shared_credentials](shared_credentials.md) | 5 | | table | +| [shared_workflow](shared_workflow.md) | 5 | | table | +| [execution_metadata](execution_metadata.md) | 4 | | table | +| [invalid_auth_token](invalid_auth_token.md) | 2 | | table | +| [execution_annotations](execution_annotations.md) | 6 | | table | +| [annotation_tag_entity](annotation_tag_entity.md) | 4 | | table | +| [execution_annotation_tags](execution_annotation_tags.md) | 2 | | table | +| [processed_data](processed_data.md) | 5 | | table | +| [folder](folder.md) | 6 | | table | +| [folder_tag](folder_tag.md) | 2 | | table | +| [insights_metadata](insights_metadata.md) | 5 | | table | +| [scope](scope.md) | 3 | | table | +| [role_scope](role_scope.md) | 2 | | table | +| [user](user.md) | 15 | | table | +| [test_case_execution](test_case_execution.md) | 16 | | table | +| [project_relation](project_relation.md) | 5 | | table | +| [data_table](data_table.md) | 5 | | table | +| [data_table_column](data_table_column.md) | 7 | | table | +| [role](role.md) | 7 | | table | +| [variables](variables.md) | 5 | | table | +| [insights_raw](insights_raw.md) | 5 | | table | +| [insights_by_period](insights_by_period.md) | 6 | | table | +| [oauth_clients](oauth_clients.md) | 9 | | table | +| [oauth_access_tokens](oauth_access_tokens.md) | 3 | | table | +| [oauth_user_consents](oauth_user_consents.md) | 4 | | table | +| [dynamic_credential_resolver](dynamic_credential_resolver.md) | 6 | | table | +| [credentials_entity](credentials_entity.md) | 11 | | table | +| [chat_hub_messages](chat_hub_messages.md) | 17 | | table | +| [workflow_statistics](workflow_statistics.md) | 7 | | table | +| [dynamic_credential_user_entry](dynamic_credential_user_entry.md) | 6 | | table | +| [workflow_dependency](workflow_dependency.md) | 9 | | table | +| [secrets_provider_connection](secrets_provider_connection.md) | 7 | | table | +| [dynamic_credential_entry](dynamic_credential_entry.md) | 6 | | table | +| [chat_hub_tools](chat_hub_tools.md) | 9 | | table | +| [chat_hub_session_tools](chat_hub_session_tools.md) | 2 | | table | +| [chat_hub_agent_tools](chat_hub_agent_tools.md) | 2 | | table | +| [chat_hub_agents](chat_hub_agents.md) | 13 | | table | +| [project_secrets_provider_access](project_secrets_provider_access.md) | 5 | | table | +| [workflow_published_version](workflow_published_version.md) | 4 | | table | +| [chat_hub_sessions](chat_hub_sessions.md) | 13 | | table | +| [role_mapping_rule](role_mapping_rule.md) | 7 | | table | +| [role_mapping_rule_project](role_mapping_rule_project.md) | 2 | | table | +| [credential_dependency](credential_dependency.md) | 5 | | table | +| [workflow_builder_session](workflow_builder_session.md) | 9 | | table | +| [instance_version_history](instance_version_history.md) | 5 | | table | +| [instance_ai_messages](instance_ai_messages.md) | 8 | | table | +| [instance_ai_resources](instance_ai_resources.md) | 5 | | table | +| [instance_ai_observational_memory](instance_ai_observational_memory.md) | 32 | | table | +| [instance_ai_workflow_snapshots](instance_ai_workflow_snapshots.md) | 7 | | table | +| [instance_ai_iteration_logs](instance_ai_iteration_logs.md) | 6 | | table | +| [token_exchange_jti](token_exchange_jti.md) | 3 | | table | +| [workflow_publish_history](workflow_publish_history.md) | 6 | | table | +| [trusted_key_source](trusted_key_source.md) | 8 | | table | +| [trusted_key](trusted_key.md) | 4 | | table | +| [user_favorites](user_favorites.md) | 4 | | table | +| [deployment_key](deployment_key.md) | 7 | | table | +| [ai_builder_temporary_workflow](ai_builder_temporary_workflow.md) | 4 | | table | +| [execution_entity](execution_entity.md) | 15 | | table | +| [evaluation_config](evaluation_config.md) | 12 | | table | +| [evaluation_collection](evaluation_collection.md) | 9 | | table | +| [test_run](test_run.md) | 16 | | table | +| [agent_checkpoints](agent_checkpoints.md) | 6 | | table | +| [agents_resources](agents_resources.md) | 4 | | table | +| [agents_threads](agents_threads.md) | 6 | | table | +| [agents_messages](agents_messages.md) | 8 | | table | +| [agent_execution](agent_execution.md) | 20 | | table | +| [workflow_history](workflow_history.md) | 11 | | table | +| [instance_ai_run_snapshots](instance_ai_run_snapshots.md) | 11 | | table | +| [agents_observations](agents_observations.md) | 11 | | table | +| [agents_observation_cursors](agents_observation_cursors.md) | 6 | | table | +| [agents_observation_locks](agents_observation_locks.md) | 7 | | table | +| [agents_memory_entries](agents_memory_entries.md) | 13 | | table | +| [agents_memory_entry_locks](agents_memory_entry_locks.md) | 6 | | table | +| [agents_memory_entry_sources](agents_memory_entry_sources.md) | 9 | | table | +| [agents_memory_entry_cursors](agents_memory_entry_cursors.md) | 6 | | table | +| [agent_history](agent_history.md) | 9 | | table | +| [agents](agents.md) | 12 | | table | +| [instance_ai_observations](instance_ai_observations.md) | 10 | | table | +| [instance_ai_observation_cursors](instance_ai_observation_cursors.md) | 5 | | table | +| [instance_ai_observation_locks](instance_ai_observation_locks.md) | 6 | | table | +| [instance_ai_checkpoints](instance_ai_checkpoints.md) | 8 | | table | +| [instance_ai_pending_confirmations](instance_ai_pending_confirmations.md) | 12 | | table | +| [workflow_entity](workflow_entity.md) | 20 | | table | +| [mcp_registry_server](mcp_registry_server.md) | 7 | | table | +| [user_api_keys](user_api_keys.md) | 9 | | table | +| [agent_files](agent_files.md) | 8 | | table | +| [binary_data](binary_data.md) | 9 | | table | +| [project](project.md) | 9 | | table | +| [agent_task_definition](agent_task_definition.md) | 7 | | table | +| [agent_task_snapshot](agent_task_snapshot.md) | 8 | | table | +| [agent_task_run_lock](agent_task_run_lock.md) | 6 | | table | +| [agent_execution_threads](agent_execution_threads.md) | 17 | | table | +| [instance_ai_mcp_registry_connections](instance_ai_mcp_registry_connections.md) | 7 | | table | +| [oauth_authorization_codes](oauth_authorization_codes.md) | 13 | | table | +| [oauth_refresh_tokens](oauth_refresh_tokens.md) | 7 | | table | +| [workflow_publication_outbox](workflow_publication_outbox.md) | 7 | | table | +| [instance_ai_threads](instance_ai_threads.md) | 7 | | table | + +## Relations + +```mermaid +erDiagram + +"installed_nodes" }o--|| "installed_packages" : "FOREIGN KEY (package) REFERENCES installed_packages (packageName) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE" +"auth_identity" }o--o| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" +"workflows_tags" |o--|| "tag_entity" : "FOREIGN KEY (tagId) REFERENCES tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflows_tags" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"execution_data" |o--|| "execution_entity" : "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"shared_credentials" |o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"shared_credentials" |o--|| "credentials_entity" : "FOREIGN KEY (credentialsId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"shared_workflow" |o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"shared_workflow" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"execution_metadata" }o--|| "execution_entity" : "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"execution_annotations" }o--|| "execution_entity" : "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"execution_annotation_tags" |o--|| "annotation_tag_entity" : "FOREIGN KEY (tagId) REFERENCES annotation_tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"execution_annotation_tags" |o--|| "execution_annotations" : "FOREIGN KEY (annotationId) REFERENCES execution_annotations (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"processed_data" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"folder" }o--o| "folder" : "FOREIGN KEY (parentFolderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"folder" }o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"folder_tag" |o--|| "tag_entity" : "FOREIGN KEY (tagId) REFERENCES tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"folder_tag" |o--|| "folder" : "FOREIGN KEY (folderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"insights_metadata" }o--o| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"insights_metadata" }o--o| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"role_scope" |o--|| "scope" : "FOREIGN KEY (scopeSlug) REFERENCES scope (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE" +"role_scope" |o--|| "role" : "FOREIGN KEY (roleSlug) REFERENCES role (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE" +"user" }o--|| "role" : "FOREIGN KEY (roleSlug) REFERENCES role (slug) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" +"test_case_execution" }o--|| "test_run" : "FOREIGN KEY (testRunId) REFERENCES test_run (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"test_case_execution" }o--o| "execution_entity" : "FOREIGN KEY (pastExecutionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"test_case_execution" }o--o| "execution_entity" : "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"test_case_execution" }o--o| "execution_entity" : "FOREIGN KEY (evaluationExecutionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"project_relation" }o--|| "role" : "FOREIGN KEY (role) REFERENCES role (slug) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" +"project_relation" |o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"project_relation" |o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"data_table" }o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"data_table_column" }o--|| "data_table" : "FOREIGN KEY (dataTableId) REFERENCES data_table (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"variables" }o--o| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"insights_raw" }o--|| "insights_metadata" : "FOREIGN KEY (metaId) REFERENCES insights_metadata (metaId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"insights_by_period" }o--|| "insights_metadata" : "FOREIGN KEY (metaId) REFERENCES insights_metadata (metaId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_access_tokens" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_access_tokens" }o--|| "oauth_clients" : "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_user_consents" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_user_consents" }o--|| "oauth_clients" : "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"credentials_entity" }o--o| "dynamic_credential_resolver" : "FOREIGN KEY (resolverId) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"chat_hub_messages" }o--o| "chat_hub_agents" : "FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"chat_hub_messages" }o--o| "execution_entity" : "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"chat_hub_messages" }o--o| "chat_hub_messages" : "FOREIGN KEY (revisionOfMessageId) REFERENCES chat_hub_messages (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_messages" }o--o| "chat_hub_messages" : "FOREIGN KEY (retryOfMessageId) REFERENCES chat_hub_messages (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_messages" }o--o| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"chat_hub_messages" }o--o| "chat_hub_messages" : "FOREIGN KEY (previousMessageId) REFERENCES chat_hub_messages (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_messages" }o--|| "chat_hub_sessions" : "FOREIGN KEY (sessionId) REFERENCES chat_hub_sessions (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"dynamic_credential_user_entry" |o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"dynamic_credential_user_entry" |o--|| "dynamic_credential_resolver" : "FOREIGN KEY (resolverId) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"dynamic_credential_user_entry" |o--|| "credentials_entity" : "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_dependency" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"dynamic_credential_entry" |o--|| "dynamic_credential_resolver" : "FOREIGN KEY (resolver_id) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"dynamic_credential_entry" |o--|| "credentials_entity" : "FOREIGN KEY (credential_id) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_tools" }o--|| "user" : "FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_session_tools" |o--|| "chat_hub_tools" : "FOREIGN KEY (toolId) REFERENCES chat_hub_tools (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_session_tools" |o--|| "chat_hub_sessions" : "FOREIGN KEY (sessionId) REFERENCES chat_hub_sessions (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_agent_tools" |o--|| "chat_hub_tools" : "FOREIGN KEY (toolId) REFERENCES chat_hub_tools (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_agent_tools" |o--|| "chat_hub_agents" : "FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_agents" }o--|| "user" : "FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_agents" }o--o| "credentials_entity" : "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"project_secrets_provider_access" |o--|| "secrets_provider_connection" : "FOREIGN KEY (secretsProviderConnectionId) REFERENCES secrets_provider_connection (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"project_secrets_provider_access" |o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_published_version" }o--|| "workflow_history" : "FOREIGN KEY (publishedVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE" +"workflow_published_version" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE" +"workflow_published_version" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_published_version" }o--|| "workflow_history" : "FOREIGN KEY (publishedVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_sessions" }o--|| "user" : "FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_sessions" }o--o| "credentials_entity" : "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"chat_hub_sessions" }o--o| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"chat_hub_sessions" }o--o| "chat_hub_agents" : "FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"role_mapping_rule" }o--|| "role" : "FOREIGN KEY (role) REFERENCES role (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE" +"role_mapping_rule_project" |o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"role_mapping_rule_project" |o--|| "role_mapping_rule" : "FOREIGN KEY (roleMappingRuleId) REFERENCES role_mapping_rule (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"credential_dependency" }o--|| "credentials_entity" : "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_builder_session" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_builder_session" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_messages" }o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_observational_memory" }o--o| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"instance_ai_iteration_logs" }o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_publish_history" }o--o| "workflow_history" : "FOREIGN KEY (versionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"workflow_publish_history" }o--o| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"workflow_publish_history" }o--o| "workflow_history" : "FOREIGN KEY (versionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_publish_history" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"trusted_key" |o--|| "trusted_key_source" : "FOREIGN KEY (sourceId) REFERENCES trusted_key_source (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"user_favorites" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"ai_builder_temporary_workflow" }o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"ai_builder_temporary_workflow" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"execution_entity" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"evaluation_config" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"evaluation_collection" }o--o| "user" : "FOREIGN KEY (createdById) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"evaluation_collection" }o--|| "evaluation_config" : "FOREIGN KEY (evaluationConfigId) REFERENCES evaluation_config (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"evaluation_collection" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"test_run" }o--o| "evaluation_collection" : "FOREIGN KEY (collectionId) REFERENCES evaluation_collection (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"test_run" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"test_run" }o--o| "evaluation_config" : "FOREIGN KEY (evaluationConfigId) REFERENCES evaluation_config (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"agent_checkpoints" }o--o| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_messages" }o--|| "agents_threads" : "FOREIGN KEY (threadId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_execution" }o--|| "agent_execution_threads" : "FOREIGN KEY (threadId) REFERENCES agent_execution_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_history" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_run_snapshots" |o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_observations" }o--o| "agents_observations" : "FOREIGN KEY (supersededBy) REFERENCES agents_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" +"agents_observations" }o--o| "agents_observations" : "FOREIGN KEY (parentId) REFERENCES agents_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" +"agents_observations" }o--|| "agents_threads" : "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_observations" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_observation_cursors" |o--|| "agents_threads" : "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_observation_cursors" |o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_observation_locks" |o--|| "agents_threads" : "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_observation_locks" |o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entries" }o--o| "agents_memory_entries" : "FOREIGN KEY (supersededBy) REFERENCES agents_memory_entries (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" +"agents_memory_entries" }o--|| "agents_resources" : "FOREIGN KEY (resourceId) REFERENCES agents_resources (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entries" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_locks" |o--|| "agents_resources" : "FOREIGN KEY (resourceId) REFERENCES agents_resources (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_locks" |o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_sources" }o--|| "agents_threads" : "FOREIGN KEY (threadId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_sources" }o--|| "agents_observations" : "FOREIGN KEY (observationId) REFERENCES agents_observations (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_sources" }o--|| "agents_memory_entries" : "FOREIGN KEY (memoryEntryId) REFERENCES agents_memory_entries (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_sources" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_cursors" |o--|| "agents_threads" : "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_cursors" |o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_history" }o--o| "user" : "FOREIGN KEY (publishedById) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"agent_history" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents" }o--o| "agent_history" : "FOREIGN KEY (activeVersionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"agents" }o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_observations" }o--o| "instance_ai_observations" : "FOREIGN KEY (supersededBy) REFERENCES instance_ai_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" +"instance_ai_observations" }o--o| "instance_ai_observations" : "FOREIGN KEY (parentId) REFERENCES instance_ai_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" +"instance_ai_observations" }o--|| "instance_ai_threads" : "FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_observation_cursors" |o--|| "instance_ai_threads" : "FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_observation_locks" |o--|| "instance_ai_threads" : "FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_checkpoints" }o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_pending_confirmations" }o--o| "instance_ai_checkpoints" : "FOREIGN KEY (checkpointKey) REFERENCES instance_ai_checkpoints (key) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_pending_confirmations" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_pending_confirmations" }o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_entity" }o--o| "workflow_history" : "FOREIGN KEY (activeVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE" +"workflow_entity" }o--o| "folder" : "FOREIGN KEY (parentFolderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"user_api_keys" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_files" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"project" }o--o| "user" : "FOREIGN KEY (creatorId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"agent_task_definition" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_task_snapshot" |o--|| "agent_history" : "FOREIGN KEY (versionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_task_run_lock" |o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_execution_threads" }o--o| "agent_history" : "FOREIGN KEY (taskVersionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"agent_execution_threads" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_execution_threads" }o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_mcp_registry_connections" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_mcp_registry_connections" }o--|| "mcp_registry_server" : "FOREIGN KEY (serverSlug) REFERENCES mcp_registry_server (slug) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_mcp_registry_connections" }o--|| "credentials_entity" : "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_authorization_codes" }o--|| "oauth_clients" : "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_authorization_codes" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_refresh_tokens" }o--|| "oauth_clients" : "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_refresh_tokens" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_threads" }o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"settings" { + TEXT key PK + TEXT value + boolean loadOnStartup +} +"installed_packages" { + char_214_ packageName PK + char_50_ installedVersion + char_70_ authorName + char_70_ authorEmail + datetime_3_ createdAt + datetime_3_ updatedAt +} +"installed_nodes" { + char_200_ name PK + char_200_ type + INTEGER latestVersion + char_214_ package FK +} +"event_destinations" { + varchar_36_ id PK + TEXT destination + datetime_3_ createdAt + datetime_3_ updatedAt +} +"auth_identity" { + VARCHAR_36_ userId FK + VARCHAR_64_ providerId PK + VARCHAR_32_ providerType PK + timestamp createdAt + timestamp updatedAt +} +"auth_provider_sync_history" { + INTEGER id + VARCHAR_32_ providerType + TEXT runMode + TEXT status + DATETIME startedAt + DATETIME endedAt + INTEGER scanned + INTEGER created + INTEGER updated + INTEGER disabled + TEXT error +} +"tag_entity" { + varchar_36_ id PK + varchar_24_ name + datetime_3_ createdAt + datetime_3_ updatedAt +} +"workflows_tags" { + varchar_36_ workflowId PK + INTEGER tagId PK +} +"webhook_entity" { + varchar_36_ workflowId + varchar webhookPath PK + varchar method PK + varchar node + varchar webhookId + INTEGER pathLength +} +"execution_data" { + INT executionId PK + TEXT workflowData + TEXT data + VARCHAR_36_ workflowVersionId +} +"shared_credentials" { + varchar_36_ credentialsId PK + varchar_36_ projectId PK + TEXT role + datetime_3_ createdAt + datetime_3_ updatedAt +} +"shared_workflow" { + varchar_36_ workflowId PK + varchar_36_ projectId PK + TEXT role + datetime_3_ createdAt + datetime_3_ updatedAt +} +"execution_metadata" { + INTEGER id + INTEGER executionId FK + varchar_255_ key + TEXT value +} +"invalid_auth_token" { + varchar_512_ token PK + datetime_3_ expiresAt +} +"execution_annotations" { + INTEGER id + INTEGER executionId FK + varchar_6_ vote + TEXT note + datetime_3_ createdAt + datetime_3_ updatedAt +} +"annotation_tag_entity" { + varchar_16_ id PK + varchar_24_ name + datetime_3_ createdAt + datetime_3_ updatedAt +} +"execution_annotation_tags" { + INTEGER annotationId PK + varchar_24_ tagId PK +} +"processed_data" { + varchar_36_ workflowId PK + varchar_255_ context PK + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT value +} +"folder" { + varchar_36_ id PK + varchar_128_ name + varchar_36_ parentFolderId FK + varchar_36_ projectId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"folder_tag" { + varchar_36_ folderId PK + varchar_36_ tagId PK +} +"insights_metadata" { + INTEGER metaId + varchar_16_ workflowId FK + varchar_36_ projectId FK + varchar_128_ workflowName + varchar_255_ projectName +} +"scope" { + varchar_128_ slug PK + TEXT displayName + TEXT description +} +"role_scope" { + VARCHAR_128_ roleSlug PK + VARCHAR_128_ scopeSlug PK +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"test_case_execution" { + varchar_36_ id PK + varchar_36_ testRunId FK + INTEGER pastExecutionId FK + INTEGER executionId FK + INTEGER evaluationExecutionId FK + varchar status + datetime_3_ runAt + datetime_3_ completedAt + varchar errorCode + TEXT errorDetails + TEXT metrics + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT inputs + TEXT outputs + INTEGER runIndex +} +"project_relation" { + varchar_36_ projectId PK + varchar userId PK + varchar role FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"data_table" { + varchar_36_ id PK + varchar_128_ name + varchar_36_ projectId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"data_table_column" { + varchar_36_ id PK + varchar_128_ name + varchar_32_ type + INTEGER index + varchar_36_ dataTableId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"role" { + varchar_128_ slug PK + TEXT displayName + TEXT description + TEXT roleType + boolean systemRole + datetime_3_ createdAt + datetime_3_ updatedAt +} +"variables" { + varchar_36_ id PK + TEXT key + TEXT type + TEXT value + varchar_36_ projectId FK +} +"insights_raw" { + INTEGER id + INTEGER metaId FK + INTEGER type + bigint value + datetime_0_ timestamp +} +"insights_by_period" { + INTEGER id + INTEGER metaId FK + INTEGER type + bigint value + INTEGER periodUnit + datetime_0_ periodStart +} +"oauth_clients" { + varchar id PK + varchar_255_ name + TEXT redirectUris + TEXT grantTypes + varchar_255_ clientSecret + bigint clientSecretExpiresAt + varchar_255_ tokenEndpointAuthMethod + datetime_3_ createdAt + datetime_3_ updatedAt +} +"oauth_access_tokens" { + varchar token PK + varchar clientId FK + varchar userId FK +} +"oauth_user_consents" { + INTEGER id + varchar userId FK + varchar clientId FK + bigint grantedAt +} +"dynamic_credential_resolver" { + varchar_16_ id PK + varchar_128_ name + varchar_128_ type + TEXT config + datetime_3_ createdAt + datetime_3_ updatedAt +} +"credentials_entity" { + varchar_36_ id PK + varchar_128_ name + TEXT data + varchar_32_ type + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +"chat_hub_messages" { + varchar id PK + varchar sessionId FK + varchar previousMessageId FK + varchar revisionOfMessageId FK + varchar retryOfMessageId FK + varchar_16_ type + varchar_128_ name + TEXT content + varchar_16_ provider + varchar_36_ workflowId FK + INTEGER executionId FK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ agentId FK + varchar_16_ status + TEXT attachments + VARCHAR_256_ model +} +"workflow_statistics" { + INTEGER id + INTEGER count + DATETIME latestEvent + VARCHAR_128_ name + VARCHAR_36_ workflowId + VARCHAR_128_ workflowName + INTEGER rootCount +} +"dynamic_credential_user_entry" { + varchar_16_ credentialId PK + varchar userId PK + varchar_16_ resolverId PK + TEXT data + datetime_3_ createdAt + datetime_3_ updatedAt +} +"workflow_dependency" { + INTEGER id + varchar_36_ workflowId FK + INTEGER workflowVersionId + varchar_32_ dependencyType + varchar_255_ dependencyKey + smallint indexVersionId + datetime_3_ createdAt + TEXT dependencyInfo + varchar_36_ publishedVersionId +} +"secrets_provider_connection" { + INTEGER id + varchar_128_ providerKey + varchar_36_ type + TEXT encryptedSettings + boolean isEnabled + datetime_3_ createdAt + datetime_3_ updatedAt +} +"dynamic_credential_entry" { + varchar_16_ credential_id PK + varchar_2048_ subject_id PK + varchar_16_ resolver_id PK + TEXT data + datetime_3_ createdAt + datetime_3_ updatedAt +} +"chat_hub_tools" { + varchar id PK + varchar_255_ name + varchar_255_ type + REAL typeVersion + varchar ownerId FK + TEXT definition + boolean enabled + datetime_3_ createdAt + datetime_3_ updatedAt +} +"chat_hub_session_tools" { + varchar sessionId PK + varchar toolId PK +} +"chat_hub_agent_tools" { + varchar agentId PK + varchar toolId PK +} +"chat_hub_agents" { + varchar id PK + varchar_256_ name + varchar_512_ description + TEXT systemPrompt + varchar ownerId FK + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + TEXT files + TEXT suggestedPrompts +} +"project_secrets_provider_access" { + INTEGER secretsProviderConnectionId PK + varchar_36_ projectId PK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_128_ role +} +"workflow_published_version" { + varchar_36_ workflowId PK + varchar_36_ publishedVersionId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"chat_hub_sessions" { + varchar id PK + varchar_256_ title + varchar ownerId FK + datetime_3_ lastMessageAt + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + varchar_36_ workflowId FK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ agentId FK + varchar_128_ agentName + varchar_16_ type +} +"role_mapping_rule" { + varchar_16_ id PK + TEXT expression + varchar_128_ role FK + varchar_64_ type + INTEGER order + datetime_3_ createdAt + datetime_3_ updatedAt +} +"role_mapping_rule_project" { + varchar_16_ roleMappingRuleId PK + varchar_36_ projectId PK +} +"credential_dependency" { + INTEGER id + varchar_36_ credentialId FK + varchar_64_ dependencyType + varchar_255_ dependencyId + datetime_3_ createdAt +} +"workflow_builder_session" { + varchar id PK + varchar_36_ workflowId FK + varchar userId FK + TEXT messages + TEXT previousSummary + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_255_ activeVersionCardId + varchar_255_ resumeAfterRestoreMessageId +} +"instance_version_history" { + INTEGER id + INTEGER major + INTEGER minor + INTEGER patch + datetime_3_ createdAt +} +"instance_ai_messages" { + varchar_36_ id PK + varchar threadId FK + TEXT content + varchar_16_ role + varchar_32_ type + varchar_255_ resourceId + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_resources" { + varchar_255_ id PK + TEXT workingMemory + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_observational_memory" { + varchar_36_ id PK + varchar_255_ lookupKey + varchar_16_ scope + varchar threadId FK + varchar_255_ resourceId + TEXT activeObservations + varchar_32_ originType + TEXT config + INTEGER generationCount + datetime_3_ lastObservedAt + INTEGER pendingMessageTokens + INTEGER totalTokensObserved + INTEGER observationTokenCount + boolean isObserving + boolean isReflecting + TEXT observedMessageIds + varchar observedTimezone + TEXT bufferedObservations + INTEGER bufferedObservationTokens + TEXT bufferedMessageIds + TEXT bufferedReflection + INTEGER bufferedReflectionTokens + INTEGER bufferedReflectionInputTokens + INTEGER reflectedObservationLineCount + TEXT bufferedObservationChunks + boolean isBufferingObservation + boolean isBufferingReflection + INTEGER lastBufferedAtTokens + datetime_3_ lastBufferedAtTime + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_workflow_snapshots" { + varchar_36_ runId PK + varchar_255_ workflowName PK + varchar_255_ resourceId + varchar status + TEXT snapshot + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_iteration_logs" { + varchar_36_ id PK + varchar threadId FK + varchar taskKey + TEXT entry + datetime_3_ createdAt + datetime_3_ updatedAt +} +"token_exchange_jti" { + varchar_255_ jti PK + datetime_3_ expiresAt + datetime_3_ createdAt +} +"workflow_publish_history" { + INTEGER id + varchar_36_ workflowId FK + varchar_36_ versionId FK + varchar_36_ event + varchar userId FK + datetime_3_ createdAt +} +"trusted_key_source" { + varchar_36_ id PK + varchar_32_ type + TEXT config + varchar_32_ status + TEXT lastError + datetime_3_ lastRefreshedAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"trusted_key" { + varchar_36_ sourceId PK + varchar_255_ kid PK + TEXT data + datetime_3_ createdAt +} +"user_favorites" { + INTEGER id + varchar userId FK + varchar_255_ resourceId + varchar_64_ resourceType +} +"deployment_key" { + varchar_36_ id PK + varchar_64_ type + TEXT value + varchar_20_ algorithm + varchar_20_ status + datetime_3_ createdAt + datetime_3_ updatedAt +} +"ai_builder_temporary_workflow" { + varchar_36_ workflowId PK + varchar threadId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"execution_entity" { + INTEGER id + varchar_36_ workflowId FK + boolean finished + varchar mode + varchar retryOf + varchar retrySuccessId + datetime startedAt + datetime stoppedAt + datetime waitTill + varchar status + datetime_3_ deletedAt + datetime_3_ createdAt + varchar_2_ storedAt + TEXT tracingContext + varchar_255_ deduplicationKey +} +"evaluation_config" { + varchar_36_ id PK + varchar_36_ workflowId FK + varchar_128_ name + varchar_16_ status + varchar_64_ invalidReason + varchar_32_ datasetSource + TEXT datasetRef + varchar_255_ startNodeName + varchar_255_ endNodeName + TEXT metrics + datetime_3_ createdAt + datetime_3_ updatedAt +} +"evaluation_collection" { + varchar_36_ id PK + varchar_128_ name + TEXT description + varchar_36_ workflowId FK + varchar_36_ evaluationConfigId FK + varchar createdById FK + TEXT insightsCache + datetime_3_ createdAt + datetime_3_ updatedAt +} +"test_run" { + varchar_36_ id PK + varchar_36_ workflowId FK + varchar status + varchar errorCode + TEXT errorDetails + datetime_3_ runAt + datetime_3_ completedAt + TEXT metrics + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_255_ runningInstanceId + boolean cancelRequested + varchar_36_ workflowVersionId + varchar_36_ evaluationConfigId FK + TEXT evaluationConfigSnapshot + varchar_36_ collectionId FK +} +"agent_checkpoints" { + varchar_255_ runId PK + varchar_255_ agentId FK + TEXT state + boolean expired + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_resources" { + varchar_255_ id PK + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_threads" { + varchar_128_ id PK + varchar_255_ resourceId + varchar_255_ title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_messages" { + varchar_36_ id PK + varchar_255_ threadId FK + varchar_255_ resourceId + varchar_36_ role + varchar_36_ type + TEXT content + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agent_execution" { + varchar_36_ id PK + varchar_128_ threadId FK + varchar_16_ status + datetime_3_ startedAt + datetime_3_ stoppedAt + INTEGER duration + TEXT userMessage + TEXT assistantResponse + varchar_255_ model + INTEGER promptTokens + INTEGER completionTokens + INTEGER totalTokens + REAL cost + TEXT toolCalls + TEXT timeline + TEXT error + varchar_16_ hitlStatus + varchar_32_ source + datetime_3_ createdAt + datetime_3_ updatedAt +} +"workflow_history" { + varchar_36_ versionId PK + varchar_36_ workflowId FK + varchar_255_ authors + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT nodes + TEXT connections + varchar_128_ name + boolean autosaved + TEXT description + TEXT nodeGroups +} +"instance_ai_run_snapshots" { + varchar threadId PK + varchar_36_ runId PK + varchar_36_ messageGroupId + TEXT runIds + TEXT tree + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ langsmithRunId + varchar_36_ langsmithTraceId + varchar_64_ traceId + varchar_64_ spanId +} +"agents_observations" { + varchar_36_ id PK + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_16_ marker + TEXT text + varchar_36_ parentId FK + INTEGER tokenCount + varchar_16_ status + varchar_36_ supersededBy FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_observation_cursors" { + varchar_36_ agentId PK + varchar_255_ observationScopeId PK + varchar_36_ lastObservedMessageId + datetime_3_ lastObservedAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_observation_locks" { + varchar_36_ agentId PK + varchar_255_ observationScopeId PK + varchar_20_ taskKind PK + varchar_64_ holderId + datetime_3_ heldUntil + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_memory_entries" { + varchar_36_ id PK + varchar_36_ agentId FK + varchar_255_ resourceId FK + TEXT content + varchar_64_ contentHash + varchar_16_ status + varchar_36_ supersededBy FK + varchar_128_ embeddingModel + TEXT embedding + TEXT metadata + datetime_3_ lastSeenAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_memory_entry_locks" { + varchar_36_ agentId PK + varchar_255_ resourceId PK + varchar_64_ holderId + datetime_3_ heldUntil + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_memory_entry_sources" { + varchar_36_ id PK + varchar_36_ agentId FK + varchar_36_ memoryEntryId FK + varchar_36_ observationId FK + varchar_255_ threadId FK + varchar_64_ evidenceHash + TEXT evidenceText + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_memory_entry_cursors" { + varchar_36_ agentId PK + varchar_255_ observationScopeId PK + varchar_36_ lastIndexedObservationId + datetime_3_ lastIndexedObservationCreatedAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agent_history" { + varchar_36_ versionId PK + varchar_36_ agentId FK + TEXT schema + TEXT tools + TEXT skills + varchar publishedById FK + varchar_255_ author + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents" { + varchar_36_ id PK + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + TEXT integrations + TEXT schema + TEXT tools + TEXT skills + varchar_36_ versionId + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ activeVersionId FK +} +"instance_ai_observations" { + varchar_36_ id PK + varchar observationScopeId FK + varchar_16_ marker + TEXT text + varchar_36_ parentId FK + INTEGER tokenCount + varchar_16_ status + varchar_36_ supersededBy FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_observation_cursors" { + varchar observationScopeId PK + varchar_36_ lastObservedMessageId + datetime_3_ lastObservedAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_observation_locks" { + varchar observationScopeId PK + varchar_20_ taskKind PK + varchar_64_ holderId + datetime_3_ heldUntil + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_checkpoints" { + varchar_255_ key PK + varchar_255_ runId + varchar threadId FK + varchar_255_ resourceId + TEXT state + datetime_3_ createdAt + datetime_3_ updatedAt + datetime_3_ expiredAt +} +"instance_ai_pending_confirmations" { + varchar_36_ requestId PK + varchar threadId FK + varchar userId FK + varchar_16_ kind + varchar_36_ runId + varchar_64_ toolCallId + varchar_36_ messageGroupId + varchar_255_ checkpointKey FK + varchar_36_ checkpointTaskId + datetime_3_ expiresAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +"mcp_registry_server" { + varchar_255_ slug PK + varchar_50_ status + varchar_50_ version + datetime_3_ registryUpdatedAt + TEXT data + datetime_3_ createdAt + datetime_3_ updatedAt +} +"user_api_keys" { + varchar_36_ id PK + varchar userId FK + varchar_100_ label + varchar apiKey + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT scopes + varchar audience + datetime_3_ lastUsedAt +} +"agent_files" { + varchar_16_ id PK + varchar_36_ agentId FK + TEXT binaryDataId + varchar_255_ fileName + varchar_255_ mimeType + INTEGER fileSizeBytes + datetime_3_ createdAt + datetime_3_ updatedAt +} +"binary_data" { + varchar fileId PK + varchar_50_ sourceType + varchar_255_ sourceId + BLOB data + varchar_255_ mimeType + varchar_255_ fileName + INTEGER fileSize + datetime_3_ createdAt + datetime_3_ updatedAt +} +"project" { + varchar_36_ id PK + varchar_255_ name + varchar_36_ type + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + varchar_512_ description + varchar creatorId FK + TEXT customTelemetryTags +} +"agent_task_definition" { + varchar_32_ id PK + varchar_36_ agentId FK + varchar_128_ name + TEXT objective + varchar_128_ cronExpression + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agent_task_snapshot" { + varchar_36_ versionId PK + varchar_32_ taskId PK + boolean enabled + varchar_128_ name + TEXT objective + varchar_128_ cronExpression + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agent_task_run_lock" { + varchar_36_ agentId PK + varchar_32_ taskId PK + varchar holderId + datetime_3_ heldUntil + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agent_execution_threads" { + varchar_128_ id PK + varchar_36_ agentId FK + varchar_255_ agentName + varchar_255_ projectId FK + INTEGER sessionNumber + INTEGER totalPromptTokens + INTEGER totalCompletionTokens + REAL totalCost + INTEGER totalDuration + varchar_255_ title + varchar_8_ emoji + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_32_ taskId + varchar_36_ taskVersionId FK + varchar_128_ parentThreadId + varchar_36_ parentAgentId +} +"instance_ai_mcp_registry_connections" { + varchar id PK + varchar_36_ credentialId FK + varchar_255_ serverSlug FK + TEXT toolFilter + varchar userId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"oauth_authorization_codes" { + varchar_255_ code PK + varchar clientId FK + varchar userId FK + varchar redirectUri + varchar codeChallenge + varchar_255_ codeChallengeMethod + bigint expiresAt + varchar state + boolean used + datetime_3_ createdAt + datetime_3_ updatedAt + varchar resource + TEXT scope +} +"oauth_refresh_tokens" { + varchar_255_ token PK + varchar clientId FK + varchar userId FK + bigint expiresAt + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT scope +} +"workflow_publication_outbox" { + INTEGER id + varchar_36_ workflowId + varchar_36_ publishedVersionId + varchar_20_ status + TEXT errorMessage + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_threads" { + varchar id PK + varchar_255_ resourceId + varchar_36_ projectId FK + TEXT title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agent_checkpoints.md b/docs/generated/sqlite-schema/agent_checkpoints.md new file mode 100644 index 00000000000..34e24b8cc7b --- /dev/null +++ b/docs/generated/sqlite-schema/agent_checkpoints.md @@ -0,0 +1,73 @@ +# agent_checkpoints + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agent_checkpoints" ("runId" varchar(255) PRIMARY KEY NOT NULL, "agentId" varchar(255), "state" text, "expired" boolean NOT NULL DEFAULT (false), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_5e31c210f896d539964bf99fe32" FOREIGN KEY ("agentId") REFERENCES "agents" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| runId | varchar(255) | | false | | | | +| agentId | varchar(255) | | true | | [agents](agents.md) | | +| state | TEXT | | true | | | | +| expired | boolean | false | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| runId | PRIMARY KEY | PRIMARY KEY (runId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agent_checkpoints_1 | PRIMARY KEY | PRIMARY KEY (runId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_5e31c210f896d539964bf99fe3 | CREATE INDEX "IDX_5e31c210f896d539964bf99fe3" ON "agent_checkpoints" ("agentId") | +| sqlite_autoindex_agent_checkpoints_1 | PRIMARY KEY (runId) | + +## Relations + +```mermaid +erDiagram + +"agent_checkpoints" }o--o| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"agent_checkpoints" { + varchar_255_ runId PK + varchar_255_ agentId FK + TEXT state + boolean expired + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents" { + varchar_36_ id PK + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + TEXT integrations + TEXT schema + TEXT tools + TEXT skills + varchar_36_ versionId + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ activeVersionId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agent_execution.md b/docs/generated/sqlite-schema/agent_execution.md new file mode 100644 index 00000000000..519a0eee098 --- /dev/null +++ b/docs/generated/sqlite-schema/agent_execution.md @@ -0,0 +1,108 @@ +# agent_execution + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agent_execution" ("id" varchar(36) PRIMARY KEY NOT NULL, "threadId" varchar(128) NOT NULL, "status" varchar(16) NOT NULL, "startedAt" datetime(3), "stoppedAt" datetime(3), "duration" integer NOT NULL DEFAULT (0), "userMessage" text NOT NULL, "assistantResponse" text NOT NULL, "model" varchar(255), "promptTokens" integer, "completionTokens" integer, "totalTokens" integer, "cost" real, "toolCalls" text, "timeline" text, "error" text, "hitlStatus" varchar(16), "source" varchar(32), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "CHK_agent_execution_status" CHECK (("status" IN ('success', 'error'))), CONSTRAINT "CHK_agent_execution_hitlStatus" CHECK (("hitlStatus" IN ('suspended', 'resumed'))), CONSTRAINT "FK_add2432fb6034cc18b6af299dce" FOREIGN KEY ("threadId") REFERENCES "agent_execution_threads" ("id") ON DELETE CASCADE ON UPDATE NO ACTION) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| threadId | varchar(128) | | false | | [agent_execution_threads](agent_execution_threads.md) | | +| status | varchar(16) | | false | | | | +| startedAt | datetime(3) | | true | | | | +| stoppedAt | datetime(3) | | true | | | | +| duration | INTEGER | 0 | false | | | | +| userMessage | TEXT | | false | | | | +| assistantResponse | TEXT | | false | | | | +| model | varchar(255) | | true | | | | +| promptTokens | INTEGER | | true | | | | +| completionTokens | INTEGER | | true | | | | +| totalTokens | INTEGER | | true | | | | +| cost | REAL | | true | | | | +| toolCalls | TEXT | | true | | | | +| timeline | TEXT | | true | | | | +| error | TEXT | | true | | | | +| hitlStatus | varchar(16) | | true | | | | +| source | varchar(32) | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (threadId) REFERENCES agent_execution_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agent_execution_1 | PRIMARY KEY | PRIMARY KEY (id) | +| - | CHECK | CHECK (("status" IN ('success', 'error'))) | +| - | CHECK | CHECK (("hitlStatus" IN ('suspended', 'resumed'))) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_63d3c3a68b9cebf05f967f0b1c | CREATE INDEX "IDX_63d3c3a68b9cebf05f967f0b1c" ON "agent_execution" ("threadId", "createdAt") | +| sqlite_autoindex_agent_execution_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"agent_execution" }o--|| "agent_execution_threads" : "FOREIGN KEY (threadId) REFERENCES agent_execution_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"agent_execution" { + varchar_36_ id PK + varchar_128_ threadId FK + varchar_16_ status + datetime_3_ startedAt + datetime_3_ stoppedAt + INTEGER duration + TEXT userMessage + TEXT assistantResponse + varchar_255_ model + INTEGER promptTokens + INTEGER completionTokens + INTEGER totalTokens + REAL cost + TEXT toolCalls + TEXT timeline + TEXT error + varchar_16_ hitlStatus + varchar_32_ source + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agent_execution_threads" { + varchar_128_ id PK + varchar_36_ agentId FK + varchar_255_ agentName + varchar_255_ projectId FK + INTEGER sessionNumber + INTEGER totalPromptTokens + INTEGER totalCompletionTokens + REAL totalCost + INTEGER totalDuration + varchar_255_ title + varchar_8_ emoji + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_32_ taskId + varchar_36_ taskVersionId FK + varchar_128_ parentThreadId + varchar_36_ parentAgentId +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agent_execution_threads.md b/docs/generated/sqlite-schema/agent_execution_threads.md new file mode 100644 index 00000000000..be364d99822 --- /dev/null +++ b/docs/generated/sqlite-schema/agent_execution_threads.md @@ -0,0 +1,146 @@ +# agent_execution_threads + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agent_execution_threads" ("id" varchar(128) PRIMARY KEY NOT NULL, "agentId" varchar(36) NOT NULL, "agentName" varchar(255) NOT NULL, "projectId" varchar(255) NOT NULL, "sessionNumber" integer NOT NULL DEFAULT (0), "totalPromptTokens" integer NOT NULL DEFAULT (0), "totalCompletionTokens" integer NOT NULL DEFAULT (0), "totalCost" real NOT NULL DEFAULT (0), "totalDuration" integer NOT NULL DEFAULT (0), "title" varchar(255), "emoji" varchar(8), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "taskId" varchar(32), "taskVersionId" varchar(36), "parentThreadId" varchar(128), "parentAgentId" varchar(36), CONSTRAINT "FK_0e2f8bf92a7a9c88b89670f701c" FOREIGN KEY ("projectId") REFERENCES "project" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_0468a9dc35597314e641d4722aa" FOREIGN KEY ("agentId") REFERENCES "agents" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_f00b52d74fe11838e1fe086deea" FOREIGN KEY ("taskVersionId") REFERENCES "agent_history" ("versionId") ON DELETE SET NULL) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(128) | | false | [agent_execution](agent_execution.md) | | | +| agentId | varchar(36) | | false | | [agents](agents.md) | | +| agentName | varchar(255) | | false | | | | +| projectId | varchar(255) | | false | | [project](project.md) | | +| sessionNumber | INTEGER | 0 | false | | | | +| totalPromptTokens | INTEGER | 0 | false | | | | +| totalCompletionTokens | INTEGER | 0 | false | | | | +| totalCost | REAL | 0 | false | | | | +| totalDuration | INTEGER | 0 | false | | | | +| title | varchar(255) | | true | | | | +| emoji | varchar(8) | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| taskId | varchar(32) | | true | | | | +| taskVersionId | varchar(36) | | true | | [agent_history](agent_history.md) | | +| parentThreadId | varchar(128) | | true | | | | +| parentAgentId | varchar(36) | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (taskVersionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agent_execution_threads_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_agent_execution_threads_taskVersionId | CREATE INDEX "IDX_agent_execution_threads_taskVersionId" ON "agent_execution_threads" ("taskVersionId") | +| IDX_0468a9dc35597314e641d4722a | CREATE INDEX "IDX_0468a9dc35597314e641d4722a" ON "agent_execution_threads" ("agentId") | +| IDX_0e2f8bf92a7a9c88b89670f701 | CREATE INDEX "IDX_0e2f8bf92a7a9c88b89670f701" ON "agent_execution_threads" ("projectId") | +| sqlite_autoindex_agent_execution_threads_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"agent_execution" }o--|| "agent_execution_threads" : "FOREIGN KEY (threadId) REFERENCES agent_execution_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_execution_threads" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_execution_threads" }o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_execution_threads" }o--o| "agent_history" : "FOREIGN KEY (taskVersionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + +"agent_execution_threads" { + varchar_128_ id PK + varchar_36_ agentId FK + varchar_255_ agentName + varchar_255_ projectId FK + INTEGER sessionNumber + INTEGER totalPromptTokens + INTEGER totalCompletionTokens + REAL totalCost + INTEGER totalDuration + varchar_255_ title + varchar_8_ emoji + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_32_ taskId + varchar_36_ taskVersionId FK + varchar_128_ parentThreadId + varchar_36_ parentAgentId +} +"agent_execution" { + varchar_36_ id PK + varchar_128_ threadId FK + varchar_16_ status + datetime_3_ startedAt + datetime_3_ stoppedAt + INTEGER duration + TEXT userMessage + TEXT assistantResponse + varchar_255_ model + INTEGER promptTokens + INTEGER completionTokens + INTEGER totalTokens + REAL cost + TEXT toolCalls + TEXT timeline + TEXT error + varchar_16_ hitlStatus + varchar_32_ source + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents" { + varchar_36_ id PK + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + TEXT integrations + TEXT schema + TEXT tools + TEXT skills + varchar_36_ versionId + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ activeVersionId FK +} +"project" { + varchar_36_ id PK + varchar_255_ name + varchar_36_ type + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + varchar_512_ description + varchar creatorId FK + TEXT customTelemetryTags +} +"agent_history" { + varchar_36_ versionId PK + varchar_36_ agentId FK + TEXT schema + TEXT tools + TEXT skills + varchar publishedById FK + varchar_255_ author + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agent_files.md b/docs/generated/sqlite-schema/agent_files.md new file mode 100644 index 00000000000..c74026e5f2b --- /dev/null +++ b/docs/generated/sqlite-schema/agent_files.md @@ -0,0 +1,77 @@ +# agent_files + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agent_files" ("id" varchar(16) PRIMARY KEY NOT NULL, "agentId" varchar(36) NOT NULL, "binaryDataId" text NOT NULL, "fileName" varchar(255) NOT NULL, "mimeType" varchar(255) NOT NULL, "fileSizeBytes" integer NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_aca4514cb500494b64356c2e164" FOREIGN KEY ("agentId") REFERENCES "agents" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(16) | | false | | | | +| agentId | varchar(36) | | false | | [agents](agents.md) | | +| binaryDataId | TEXT | | false | | | | +| fileName | varchar(255) | | false | | | | +| mimeType | varchar(255) | | false | | | | +| fileSizeBytes | INTEGER | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agent_files_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_45dafc48fe2ce95eac30fc8ffd | CREATE INDEX "IDX_45dafc48fe2ce95eac30fc8ffd" ON "agent_files" ("agentId", "createdAt") | +| sqlite_autoindex_agent_files_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"agent_files" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"agent_files" { + varchar_16_ id PK + varchar_36_ agentId FK + TEXT binaryDataId + varchar_255_ fileName + varchar_255_ mimeType + INTEGER fileSizeBytes + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents" { + varchar_36_ id PK + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + TEXT integrations + TEXT schema + TEXT tools + TEXT skills + varchar_36_ versionId + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ activeVersionId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agent_history.md b/docs/generated/sqlite-schema/agent_history.md new file mode 100644 index 00000000000..758505f27c6 --- /dev/null +++ b/docs/generated/sqlite-schema/agent_history.md @@ -0,0 +1,130 @@ +# agent_history + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agent_history" ("versionId" varchar(36) PRIMARY KEY NOT NULL, "agentId" varchar(36) NOT NULL, "schema" text, "tools" text, "skills" text, "publishedById" varchar, "author" varchar(255) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_87cd5a8da20304b089ea2f83fec" FOREIGN KEY ("agentId") REFERENCES "agents" ("id") ON DELETE CASCADE, CONSTRAINT "FK_8771675f44c58fb40e0feb9ee35" FOREIGN KEY ("publishedById") REFERENCES "user" ("id") ON DELETE SET NULL) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| versionId | varchar(36) | | false | [agents](agents.md) [agent_task_snapshot](agent_task_snapshot.md) [agent_execution_threads](agent_execution_threads.md) | | | +| agentId | varchar(36) | | false | | [agents](agents.md) | | +| schema | TEXT | | true | | | | +| tools | TEXT | | true | | | | +| skills | TEXT | | true | | | | +| publishedById | varchar | | true | | [user](user.md) | | +| author | varchar(255) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| versionId | PRIMARY KEY | PRIMARY KEY (versionId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (publishedById) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agent_history_1 | PRIMARY KEY | PRIMARY KEY (versionId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_87cd5a8da20304b089ea2f83fe | CREATE INDEX "IDX_87cd5a8da20304b089ea2f83fe" ON "agent_history" ("agentId") | +| sqlite_autoindex_agent_history_1 | PRIMARY KEY (versionId) | + +## Relations + +```mermaid +erDiagram + +"agents" }o--o| "agent_history" : "FOREIGN KEY (activeVersionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"agent_task_snapshot" |o--|| "agent_history" : "FOREIGN KEY (versionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_execution_threads" }o--o| "agent_history" : "FOREIGN KEY (taskVersionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"agent_history" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_history" }o--o| "user" : "FOREIGN KEY (publishedById) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + +"agent_history" { + varchar_36_ versionId PK + varchar_36_ agentId FK + TEXT schema + TEXT tools + TEXT skills + varchar publishedById FK + varchar_255_ author + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents" { + varchar_36_ id PK + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + TEXT integrations + TEXT schema + TEXT tools + TEXT skills + varchar_36_ versionId + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ activeVersionId FK +} +"agent_task_snapshot" { + varchar_36_ versionId PK + varchar_32_ taskId PK + boolean enabled + varchar_128_ name + TEXT objective + varchar_128_ cronExpression + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agent_execution_threads" { + varchar_128_ id PK + varchar_36_ agentId FK + varchar_255_ agentName + varchar_255_ projectId FK + INTEGER sessionNumber + INTEGER totalPromptTokens + INTEGER totalCompletionTokens + REAL totalCost + INTEGER totalDuration + varchar_255_ title + varchar_8_ emoji + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_32_ taskId + varchar_36_ taskVersionId FK + varchar_128_ parentThreadId + varchar_36_ parentAgentId +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agent_task_definition.md b/docs/generated/sqlite-schema/agent_task_definition.md new file mode 100644 index 00000000000..224e847c7ec --- /dev/null +++ b/docs/generated/sqlite-schema/agent_task_definition.md @@ -0,0 +1,75 @@ +# agent_task_definition + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agent_task_definition" ("id" varchar(32) PRIMARY KEY NOT NULL, "agentId" varchar(36) NOT NULL, "name" varchar(128) NOT NULL, "objective" text NOT NULL, "cronExpression" varchar(128) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_f45d0535a2ed59b6c2dd6da98a0" FOREIGN KEY ("agentId") REFERENCES "agents" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(32) | | false | | | | +| agentId | varchar(36) | | false | | [agents](agents.md) | | +| name | varchar(128) | | false | | | | +| objective | TEXT | | false | | | | +| cronExpression | varchar(128) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agent_task_definition_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_f45d0535a2ed59b6c2dd6da98a | CREATE INDEX "IDX_f45d0535a2ed59b6c2dd6da98a" ON "agent_task_definition" ("agentId") | +| sqlite_autoindex_agent_task_definition_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"agent_task_definition" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"agent_task_definition" { + varchar_32_ id PK + varchar_36_ agentId FK + varchar_128_ name + TEXT objective + varchar_128_ cronExpression + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents" { + varchar_36_ id PK + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + TEXT integrations + TEXT schema + TEXT tools + TEXT skills + varchar_36_ versionId + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ activeVersionId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agent_task_run_lock.md b/docs/generated/sqlite-schema/agent_task_run_lock.md new file mode 100644 index 00000000000..c8b1e135e56 --- /dev/null +++ b/docs/generated/sqlite-schema/agent_task_run_lock.md @@ -0,0 +1,73 @@ +# agent_task_run_lock + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agent_task_run_lock" ("agentId" varchar(36) NOT NULL, "taskId" varchar(32) NOT NULL, "holderId" varchar NOT NULL, "heldUntil" datetime(3) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_b57a2862ae869aab24e54cefd48" FOREIGN KEY ("agentId") REFERENCES "agents" ("id") ON DELETE CASCADE, PRIMARY KEY ("agentId", "taskId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| agentId | varchar(36) | | false | | [agents](agents.md) | | +| taskId | varchar(32) | | false | | | | +| holderId | varchar | | false | | | | +| heldUntil | datetime(3) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agentId | PRIMARY KEY | PRIMARY KEY (agentId) | +| taskId | PRIMARY KEY | PRIMARY KEY (taskId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agent_task_run_lock_1 | PRIMARY KEY | PRIMARY KEY (agentId, taskId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_agent_task_run_lock_1 | PRIMARY KEY (agentId, taskId) | + +## Relations + +```mermaid +erDiagram + +"agent_task_run_lock" |o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"agent_task_run_lock" { + varchar_36_ agentId PK + varchar_32_ taskId PK + varchar holderId + datetime_3_ heldUntil + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents" { + varchar_36_ id PK + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + TEXT integrations + TEXT schema + TEXT tools + TEXT skills + varchar_36_ versionId + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ activeVersionId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agent_task_snapshot.md b/docs/generated/sqlite-schema/agent_task_snapshot.md new file mode 100644 index 00000000000..6cf1f0c14ac --- /dev/null +++ b/docs/generated/sqlite-schema/agent_task_snapshot.md @@ -0,0 +1,74 @@ +# agent_task_snapshot + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agent_task_snapshot" ("versionId" varchar(36) NOT NULL, "taskId" varchar(32) NOT NULL, "enabled" boolean NOT NULL, "name" varchar(128) NOT NULL, "objective" text NOT NULL, "cronExpression" varchar(128) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_1acedce6690392ef1611cca8b88" FOREIGN KEY ("versionId") REFERENCES "agent_history" ("versionId") ON DELETE CASCADE, PRIMARY KEY ("versionId", "taskId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| versionId | varchar(36) | | false | | [agent_history](agent_history.md) | | +| taskId | varchar(32) | | false | | | | +| enabled | boolean | | false | | | | +| name | varchar(128) | | false | | | | +| objective | TEXT | | false | | | | +| cronExpression | varchar(128) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| versionId | PRIMARY KEY | PRIMARY KEY (versionId) | +| taskId | PRIMARY KEY | PRIMARY KEY (taskId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (versionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agent_task_snapshot_1 | PRIMARY KEY | PRIMARY KEY (versionId, taskId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_agent_task_snapshot_1 | PRIMARY KEY (versionId, taskId) | + +## Relations + +```mermaid +erDiagram + +"agent_task_snapshot" |o--|| "agent_history" : "FOREIGN KEY (versionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"agent_task_snapshot" { + varchar_36_ versionId PK + varchar_32_ taskId PK + boolean enabled + varchar_128_ name + TEXT objective + varchar_128_ cronExpression + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agent_history" { + varchar_36_ versionId PK + varchar_36_ agentId FK + TEXT schema + TEXT tools + TEXT skills + varchar publishedById FK + varchar_255_ author + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agents.md b/docs/generated/sqlite-schema/agents.md new file mode 100644 index 00000000000..933fa56a22d --- /dev/null +++ b/docs/generated/sqlite-schema/agents.md @@ -0,0 +1,235 @@ +# agents + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agents" ("id" varchar(36) PRIMARY KEY NOT NULL, "name" varchar(128) NOT NULL, "description" varchar(512), "projectId" varchar(255) NOT NULL, "integrations" text NOT NULL DEFAULT ('[]'), "schema" text, "tools" text NOT NULL DEFAULT ('{}'), "skills" text NOT NULL DEFAULT ('{}'), "versionId" varchar(36), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "activeVersionId" varchar(36), CONSTRAINT "FK_a30d560207c4071d98aa03c179c" FOREIGN KEY ("projectId") REFERENCES "project" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_940597dfe9753375309ce6aeea0" FOREIGN KEY ("activeVersionId") REFERENCES "agent_history" ("versionId") ON DELETE SET NULL) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [agent_checkpoints](agent_checkpoints.md) [agents_observations](agents_observations.md) [agents_observation_cursors](agents_observation_cursors.md) [agents_observation_locks](agents_observation_locks.md) [agents_memory_entries](agents_memory_entries.md) [agents_memory_entry_locks](agents_memory_entry_locks.md) [agents_memory_entry_sources](agents_memory_entry_sources.md) [agents_memory_entry_cursors](agents_memory_entry_cursors.md) [agent_history](agent_history.md) [agent_files](agent_files.md) [agent_task_definition](agent_task_definition.md) [agent_task_run_lock](agent_task_run_lock.md) [agent_execution_threads](agent_execution_threads.md) | | | +| name | varchar(128) | | false | | | | +| description | varchar(512) | | true | | | | +| projectId | varchar(255) | | false | | [project](project.md) | | +| integrations | TEXT | '[]' | false | | | | +| schema | TEXT | | true | | | | +| tools | TEXT | '{}' | false | | | | +| skills | TEXT | '{}' | false | | | | +| versionId | varchar(36) | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| activeVersionId | varchar(36) | | true | | [agent_history](agent_history.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (activeVersionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agents_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_agents_projectId | CREATE INDEX "IDX_agents_projectId" ON "agents" ("projectId") | +| IDX_a30d560207c4071d98aa03c179 | CREATE INDEX "IDX_a30d560207c4071d98aa03c179" ON "agents" ("projectId") | +| sqlite_autoindex_agents_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"agent_checkpoints" }o--o| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_observations" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_observation_cursors" |o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_observation_locks" |o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entries" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_locks" |o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_sources" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_cursors" |o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_history" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_files" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_task_definition" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_task_run_lock" |o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_execution_threads" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents" }o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents" }o--o| "agent_history" : "FOREIGN KEY (activeVersionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + +"agents" { + varchar_36_ id PK + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + TEXT integrations + TEXT schema + TEXT tools + TEXT skills + varchar_36_ versionId + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ activeVersionId FK +} +"agent_checkpoints" { + varchar_255_ runId PK + varchar_255_ agentId FK + TEXT state + boolean expired + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_observations" { + varchar_36_ id PK + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_16_ marker + TEXT text + varchar_36_ parentId FK + INTEGER tokenCount + varchar_16_ status + varchar_36_ supersededBy FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_observation_cursors" { + varchar_36_ agentId PK + varchar_255_ observationScopeId PK + varchar_36_ lastObservedMessageId + datetime_3_ lastObservedAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_observation_locks" { + varchar_36_ agentId PK + varchar_255_ observationScopeId PK + varchar_20_ taskKind PK + varchar_64_ holderId + datetime_3_ heldUntil + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_memory_entries" { + varchar_36_ id PK + varchar_36_ agentId FK + varchar_255_ resourceId FK + TEXT content + varchar_64_ contentHash + varchar_16_ status + varchar_36_ supersededBy FK + varchar_128_ embeddingModel + TEXT embedding + TEXT metadata + datetime_3_ lastSeenAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_memory_entry_locks" { + varchar_36_ agentId PK + varchar_255_ resourceId PK + varchar_64_ holderId + datetime_3_ heldUntil + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_memory_entry_sources" { + varchar_36_ id PK + varchar_36_ agentId FK + varchar_36_ memoryEntryId FK + varchar_36_ observationId FK + varchar_255_ threadId FK + varchar_64_ evidenceHash + TEXT evidenceText + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_memory_entry_cursors" { + varchar_36_ agentId PK + varchar_255_ observationScopeId PK + varchar_36_ lastIndexedObservationId + datetime_3_ lastIndexedObservationCreatedAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agent_history" { + varchar_36_ versionId PK + varchar_36_ agentId FK + TEXT schema + TEXT tools + TEXT skills + varchar publishedById FK + varchar_255_ author + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agent_files" { + varchar_16_ id PK + varchar_36_ agentId FK + TEXT binaryDataId + varchar_255_ fileName + varchar_255_ mimeType + INTEGER fileSizeBytes + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agent_task_definition" { + varchar_32_ id PK + varchar_36_ agentId FK + varchar_128_ name + TEXT objective + varchar_128_ cronExpression + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agent_task_run_lock" { + varchar_36_ agentId PK + varchar_32_ taskId PK + varchar holderId + datetime_3_ heldUntil + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agent_execution_threads" { + varchar_128_ id PK + varchar_36_ agentId FK + varchar_255_ agentName + varchar_255_ projectId FK + INTEGER sessionNumber + INTEGER totalPromptTokens + INTEGER totalCompletionTokens + REAL totalCost + INTEGER totalDuration + varchar_255_ title + varchar_8_ emoji + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_32_ taskId + varchar_36_ taskVersionId FK + varchar_128_ parentThreadId + varchar_36_ parentAgentId +} +"project" { + varchar_36_ id PK + varchar_255_ name + varchar_36_ type + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + varchar_512_ description + varchar creatorId FK + TEXT customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agents_memory_entries.md b/docs/generated/sqlite-schema/agents_memory_entries.md new file mode 100644 index 00000000000..3401aeb30e0 --- /dev/null +++ b/docs/generated/sqlite-schema/agents_memory_entries.md @@ -0,0 +1,113 @@ +# agents_memory_entries + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agents_memory_entries" ("id" varchar(36) PRIMARY KEY NOT NULL, "agentId" varchar(36) NOT NULL, "resourceId" varchar(255) NOT NULL, "content" text NOT NULL, "contentHash" varchar(64) NOT NULL, "status" varchar(16) NOT NULL, "supersededBy" varchar(36), "embeddingModel" varchar(128), "embedding" text, "metadata" text, "lastSeenAt" datetime(3) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "CHK_agents_memory_entries_status" CHECK ("status" IN ('active', 'superseded', 'dropped')), CONSTRAINT "FK_28e981fb675e9b44ce02f0ec1dd" FOREIGN KEY ("agentId") REFERENCES "agents" ("id") ON DELETE CASCADE, CONSTRAINT "FK_1443a75e59adbfb796071d66393" FOREIGN KEY ("resourceId") REFERENCES "agents_resources" ("id") ON DELETE CASCADE, CONSTRAINT "FK_0edf1226b77ddc525eae4938079" FOREIGN KEY ("supersededBy") REFERENCES "agents_memory_entries" ("id")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [agents_memory_entries](agents_memory_entries.md) [agents_memory_entry_sources](agents_memory_entry_sources.md) | | | +| agentId | varchar(36) | | false | | [agents](agents.md) | | +| resourceId | varchar(255) | | false | | [agents_resources](agents_resources.md) | | +| content | TEXT | | false | | | | +| contentHash | varchar(64) | | false | | | | +| status | varchar(16) | | false | | | | +| supersededBy | varchar(36) | | true | | [agents_memory_entries](agents_memory_entries.md) | | +| embeddingModel | varchar(128) | | true | | | | +| embedding | TEXT | | true | | | | +| metadata | TEXT | | true | | | | +| lastSeenAt | datetime(3) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (supersededBy) REFERENCES agents_memory_entries (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (resourceId) REFERENCES agents_resources (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agents_memory_entries_1 | PRIMARY KEY | PRIMARY KEY (id) | +| - | CHECK | CHECK ("status" IN ('active', 'superseded', 'dropped')) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_0edf1226b77ddc525eae493807 | CREATE INDEX "IDX_0edf1226b77ddc525eae493807" ON "agents_memory_entries" ("supersededBy") | +| IDX_1443a75e59adbfb796071d6639 | CREATE INDEX "IDX_1443a75e59adbfb796071d6639" ON "agents_memory_entries" ("resourceId") | +| IDX_a03e04e94bea8439dd166d4b52 | CREATE UNIQUE INDEX "IDX_a03e04e94bea8439dd166d4b52" ON "agents_memory_entries" ("agentId", "resourceId", "contentHash") | +| IDX_aff2807b31eccbafe59d0474f0 | CREATE INDEX "IDX_aff2807b31eccbafe59d0474f0" ON "agents_memory_entries" ("agentId", "resourceId", "status", "createdAt", "id") | +| sqlite_autoindex_agents_memory_entries_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"agents_memory_entries" }o--o| "agents_memory_entries" : "FOREIGN KEY (supersededBy) REFERENCES agents_memory_entries (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" +"agents_memory_entry_sources" }o--|| "agents_memory_entries" : "FOREIGN KEY (memoryEntryId) REFERENCES agents_memory_entries (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entries" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entries" }o--|| "agents_resources" : "FOREIGN KEY (resourceId) REFERENCES agents_resources (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"agents_memory_entries" { + varchar_36_ id PK + varchar_36_ agentId FK + varchar_255_ resourceId FK + TEXT content + varchar_64_ contentHash + varchar_16_ status + varchar_36_ supersededBy FK + varchar_128_ embeddingModel + TEXT embedding + TEXT metadata + datetime_3_ lastSeenAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_memory_entry_sources" { + varchar_36_ id PK + varchar_36_ agentId FK + varchar_36_ memoryEntryId FK + varchar_36_ observationId FK + varchar_255_ threadId FK + varchar_64_ evidenceHash + TEXT evidenceText + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents" { + varchar_36_ id PK + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + TEXT integrations + TEXT schema + TEXT tools + TEXT skills + varchar_36_ versionId + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ activeVersionId FK +} +"agents_resources" { + varchar_255_ id PK + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agents_memory_entry_cursors.md b/docs/generated/sqlite-schema/agents_memory_entry_cursors.md new file mode 100644 index 00000000000..a59ae35f6e2 --- /dev/null +++ b/docs/generated/sqlite-schema/agents_memory_entry_cursors.md @@ -0,0 +1,84 @@ +# agents_memory_entry_cursors + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agents_memory_entry_cursors" ("agentId" varchar(36) NOT NULL, "observationScopeId" varchar(255) NOT NULL, "lastIndexedObservationId" varchar(36) NOT NULL, "lastIndexedObservationCreatedAt" datetime(3) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_746780fd115e5e4352457a3c617" FOREIGN KEY ("agentId") REFERENCES "agents" ("id") ON DELETE CASCADE, CONSTRAINT "FK_069e791e428391a5569e7a96b20" FOREIGN KEY ("observationScopeId") REFERENCES "agents_threads" ("id") ON DELETE CASCADE, PRIMARY KEY ("agentId", "observationScopeId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| agentId | varchar(36) | | false | | [agents](agents.md) | | +| observationScopeId | varchar(255) | | false | | [agents_threads](agents_threads.md) | | +| lastIndexedObservationId | varchar(36) | | false | | | | +| lastIndexedObservationCreatedAt | datetime(3) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agentId | PRIMARY KEY | PRIMARY KEY (agentId) | +| observationScopeId | PRIMARY KEY | PRIMARY KEY (observationScopeId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agents_memory_entry_cursors_1 | PRIMARY KEY | PRIMARY KEY (agentId, observationScopeId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_069e791e428391a5569e7a96b2 | CREATE INDEX "IDX_069e791e428391a5569e7a96b2" ON "agents_memory_entry_cursors" ("observationScopeId") | +| sqlite_autoindex_agents_memory_entry_cursors_1 | PRIMARY KEY (agentId, observationScopeId) | + +## Relations + +```mermaid +erDiagram + +"agents_memory_entry_cursors" |o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_cursors" |o--|| "agents_threads" : "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"agents_memory_entry_cursors" { + varchar_36_ agentId PK + varchar_255_ observationScopeId PK + varchar_36_ lastIndexedObservationId + datetime_3_ lastIndexedObservationCreatedAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents" { + varchar_36_ id PK + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + TEXT integrations + TEXT schema + TEXT tools + TEXT skills + varchar_36_ versionId + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ activeVersionId FK +} +"agents_threads" { + varchar_128_ id PK + varchar_255_ resourceId + varchar_255_ title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agents_memory_entry_locks.md b/docs/generated/sqlite-schema/agents_memory_entry_locks.md new file mode 100644 index 00000000000..d26db73bfed --- /dev/null +++ b/docs/generated/sqlite-schema/agents_memory_entry_locks.md @@ -0,0 +1,82 @@ +# agents_memory_entry_locks + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agents_memory_entry_locks" ("agentId" varchar(36) NOT NULL, "resourceId" varchar(255) NOT NULL, "holderId" varchar(64) NOT NULL, "heldUntil" datetime(3) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_0ccf6d9ea6f44fa1c264fc2f795" FOREIGN KEY ("agentId") REFERENCES "agents" ("id") ON DELETE CASCADE, CONSTRAINT "FK_9594c0983cfee1c8ff49b05848b" FOREIGN KEY ("resourceId") REFERENCES "agents_resources" ("id") ON DELETE CASCADE, PRIMARY KEY ("agentId", "resourceId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| agentId | varchar(36) | | false | | [agents](agents.md) | | +| resourceId | varchar(255) | | false | | [agents_resources](agents_resources.md) | | +| holderId | varchar(64) | | false | | | | +| heldUntil | datetime(3) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agentId | PRIMARY KEY | PRIMARY KEY (agentId) | +| resourceId | PRIMARY KEY | PRIMARY KEY (resourceId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (resourceId) REFERENCES agents_resources (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agents_memory_entry_locks_1 | PRIMARY KEY | PRIMARY KEY (agentId, resourceId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_9594c0983cfee1c8ff49b05848 | CREATE INDEX "IDX_9594c0983cfee1c8ff49b05848" ON "agents_memory_entry_locks" ("resourceId") | +| sqlite_autoindex_agents_memory_entry_locks_1 | PRIMARY KEY (agentId, resourceId) | + +## Relations + +```mermaid +erDiagram + +"agents_memory_entry_locks" |o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_locks" |o--|| "agents_resources" : "FOREIGN KEY (resourceId) REFERENCES agents_resources (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"agents_memory_entry_locks" { + varchar_36_ agentId PK + varchar_255_ resourceId PK + varchar_64_ holderId + datetime_3_ heldUntil + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents" { + varchar_36_ id PK + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + TEXT integrations + TEXT schema + TEXT tools + TEXT skills + varchar_36_ versionId + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ activeVersionId FK +} +"agents_resources" { + varchar_255_ id PK + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agents_memory_entry_sources.md b/docs/generated/sqlite-schema/agents_memory_entry_sources.md new file mode 100644 index 00000000000..ae007dc0c67 --- /dev/null +++ b/docs/generated/sqlite-schema/agents_memory_entry_sources.md @@ -0,0 +1,124 @@ +# agents_memory_entry_sources + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agents_memory_entry_sources" ("id" varchar(36) PRIMARY KEY NOT NULL, "agentId" varchar(36) NOT NULL, "memoryEntryId" varchar(36) NOT NULL, "observationId" varchar(36) NOT NULL, "threadId" varchar(255) NOT NULL, "evidenceHash" varchar(64) NOT NULL, "evidenceText" text NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_c38e8a57a36b880e39a52ada2e8" FOREIGN KEY ("agentId") REFERENCES "agents" ("id") ON DELETE CASCADE, CONSTRAINT "FK_4706f6223313959b7437a2b48df" FOREIGN KEY ("memoryEntryId") REFERENCES "agents_memory_entries" ("id") ON DELETE CASCADE, CONSTRAINT "FK_cb7c15d22fd068a0806aa57fc03" FOREIGN KEY ("observationId") REFERENCES "agents_observations" ("id") ON DELETE CASCADE, CONSTRAINT "FK_451d387a182fa8dd8002dfc3a77" FOREIGN KEY ("threadId") REFERENCES "agents_threads" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| agentId | varchar(36) | | false | | [agents](agents.md) | | +| memoryEntryId | varchar(36) | | false | | [agents_memory_entries](agents_memory_entries.md) | | +| observationId | varchar(36) | | false | | [agents_observations](agents_observations.md) | | +| threadId | varchar(255) | | false | | [agents_threads](agents_threads.md) | | +| evidenceHash | varchar(64) | | false | | | | +| evidenceText | TEXT | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (threadId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (observationId) REFERENCES agents_observations (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (memoryEntryId) REFERENCES agents_memory_entries (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 3) | FOREIGN KEY | FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agents_memory_entry_sources_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_451d387a182fa8dd8002dfc3a7 | CREATE INDEX "IDX_451d387a182fa8dd8002dfc3a7" ON "agents_memory_entry_sources" ("threadId") | +| IDX_f9573af4ed653f13b0ba1f7b12 | CREATE INDEX "IDX_f9573af4ed653f13b0ba1f7b12" ON "agents_memory_entry_sources" ("agentId", "threadId") | +| IDX_cb7c15d22fd068a0806aa57fc0 | CREATE INDEX "IDX_cb7c15d22fd068a0806aa57fc0" ON "agents_memory_entry_sources" ("observationId") | +| IDX_a353ac251315ef0af6ad3c9f0a | CREATE UNIQUE INDEX "IDX_a353ac251315ef0af6ad3c9f0a" ON "agents_memory_entry_sources" ("memoryEntryId", "observationId", "evidenceHash") | +| sqlite_autoindex_agents_memory_entry_sources_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"agents_memory_entry_sources" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_sources" }o--|| "agents_memory_entries" : "FOREIGN KEY (memoryEntryId) REFERENCES agents_memory_entries (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_sources" }o--|| "agents_observations" : "FOREIGN KEY (observationId) REFERENCES agents_observations (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_sources" }o--|| "agents_threads" : "FOREIGN KEY (threadId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"agents_memory_entry_sources" { + varchar_36_ id PK + varchar_36_ agentId FK + varchar_36_ memoryEntryId FK + varchar_36_ observationId FK + varchar_255_ threadId FK + varchar_64_ evidenceHash + TEXT evidenceText + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents" { + varchar_36_ id PK + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + TEXT integrations + TEXT schema + TEXT tools + TEXT skills + varchar_36_ versionId + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ activeVersionId FK +} +"agents_memory_entries" { + varchar_36_ id PK + varchar_36_ agentId FK + varchar_255_ resourceId FK + TEXT content + varchar_64_ contentHash + varchar_16_ status + varchar_36_ supersededBy FK + varchar_128_ embeddingModel + TEXT embedding + TEXT metadata + datetime_3_ lastSeenAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_observations" { + varchar_36_ id PK + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_16_ marker + TEXT text + varchar_36_ parentId FK + INTEGER tokenCount + varchar_16_ status + varchar_36_ supersededBy FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_threads" { + varchar_128_ id PK + varchar_255_ resourceId + varchar_255_ title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agents_messages.md b/docs/generated/sqlite-schema/agents_messages.md new file mode 100644 index 00000000000..32bfa47f145 --- /dev/null +++ b/docs/generated/sqlite-schema/agents_messages.md @@ -0,0 +1,72 @@ +# agents_messages + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agents_messages" ("id" varchar(36) PRIMARY KEY NOT NULL, "threadId" varchar(255) NOT NULL, "resourceId" varchar(255) NOT NULL, "role" varchar(36) NOT NULL, "type" varchar(36), "content" text NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_0a8057a61afabd2999608ffd0d9" FOREIGN KEY ("threadId") REFERENCES "agents_threads" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| threadId | varchar(255) | | false | | [agents_threads](agents_threads.md) | | +| resourceId | varchar(255) | | false | | | | +| role | varchar(36) | | false | | | | +| type | varchar(36) | | true | | | | +| content | TEXT | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (threadId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agents_messages_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_agents_messages_threadId_createdAt | CREATE INDEX "IDX_agents_messages_threadId_createdAt" ON "agents_messages" ("threadId", "createdAt") | +| IDX_fc7bf858660bfafd19181e8e35 | CREATE INDEX "IDX_fc7bf858660bfafd19181e8e35" ON "agents_messages" ("threadId", "createdAt") | +| sqlite_autoindex_agents_messages_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"agents_messages" }o--|| "agents_threads" : "FOREIGN KEY (threadId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"agents_messages" { + varchar_36_ id PK + varchar_255_ threadId FK + varchar_255_ resourceId + varchar_36_ role + varchar_36_ type + TEXT content + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_threads" { + varchar_128_ id PK + varchar_255_ resourceId + varchar_255_ title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agents_observation_cursors.md b/docs/generated/sqlite-schema/agents_observation_cursors.md new file mode 100644 index 00000000000..8109c55ae9e --- /dev/null +++ b/docs/generated/sqlite-schema/agents_observation_cursors.md @@ -0,0 +1,84 @@ +# agents_observation_cursors + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agents_observation_cursors" ("agentId" varchar(36) NOT NULL, "observationScopeId" varchar(255) NOT NULL, "lastObservedMessageId" varchar(36) NOT NULL, "lastObservedAt" datetime(3) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_64e92819f4b413661ed6e2c3c3d" FOREIGN KEY ("agentId") REFERENCES "agents" ("id") ON DELETE CASCADE, CONSTRAINT "FK_87aa187d27ea67eafd164905154" FOREIGN KEY ("observationScopeId") REFERENCES "agents_threads" ("id") ON DELETE CASCADE, PRIMARY KEY ("agentId", "observationScopeId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| agentId | varchar(36) | | false | | [agents](agents.md) | | +| observationScopeId | varchar(255) | | false | | [agents_threads](agents_threads.md) | | +| lastObservedMessageId | varchar(36) | | false | | | | +| lastObservedAt | datetime(3) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agentId | PRIMARY KEY | PRIMARY KEY (agentId) | +| observationScopeId | PRIMARY KEY | PRIMARY KEY (observationScopeId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agents_observation_cursors_1 | PRIMARY KEY | PRIMARY KEY (agentId, observationScopeId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_87aa187d27ea67eafd16490515 | CREATE INDEX "IDX_87aa187d27ea67eafd16490515" ON "agents_observation_cursors" ("observationScopeId") | +| sqlite_autoindex_agents_observation_cursors_1 | PRIMARY KEY (agentId, observationScopeId) | + +## Relations + +```mermaid +erDiagram + +"agents_observation_cursors" |o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_observation_cursors" |o--|| "agents_threads" : "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"agents_observation_cursors" { + varchar_36_ agentId PK + varchar_255_ observationScopeId PK + varchar_36_ lastObservedMessageId + datetime_3_ lastObservedAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents" { + varchar_36_ id PK + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + TEXT integrations + TEXT schema + TEXT tools + TEXT skills + varchar_36_ versionId + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ activeVersionId FK +} +"agents_threads" { + varchar_128_ id PK + varchar_255_ resourceId + varchar_255_ title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agents_observation_locks.md b/docs/generated/sqlite-schema/agents_observation_locks.md new file mode 100644 index 00000000000..ed3ae19700e --- /dev/null +++ b/docs/generated/sqlite-schema/agents_observation_locks.md @@ -0,0 +1,88 @@ +# agents_observation_locks + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agents_observation_locks" ("agentId" varchar(36) NOT NULL, "observationScopeId" varchar(255) NOT NULL, "taskKind" varchar(20) NOT NULL, "holderId" varchar(64) NOT NULL, "heldUntil" datetime(3) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "CHK_agents_observation_locks_taskKind" CHECK ("taskKind" IN ('observer', 'reflector')), CONSTRAINT "FK_093e44ae20f2518e97d83a95433" FOREIGN KEY ("agentId") REFERENCES "agents" ("id") ON DELETE CASCADE, CONSTRAINT "FK_6b55089892e447c2f82e5ec60ed" FOREIGN KEY ("observationScopeId") REFERENCES "agents_threads" ("id") ON DELETE CASCADE, PRIMARY KEY ("agentId", "observationScopeId", "taskKind")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| agentId | varchar(36) | | false | | [agents](agents.md) | | +| observationScopeId | varchar(255) | | false | | [agents_threads](agents_threads.md) | | +| taskKind | varchar(20) | | false | | | | +| holderId | varchar(64) | | false | | | | +| heldUntil | datetime(3) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agentId | PRIMARY KEY | PRIMARY KEY (agentId) | +| observationScopeId | PRIMARY KEY | PRIMARY KEY (observationScopeId) | +| taskKind | PRIMARY KEY | PRIMARY KEY (taskKind) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agents_observation_locks_1 | PRIMARY KEY | PRIMARY KEY (agentId, observationScopeId, taskKind) | +| - | CHECK | CHECK ("taskKind" IN ('observer', 'reflector')) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_6b55089892e447c2f82e5ec60e | CREATE INDEX "IDX_6b55089892e447c2f82e5ec60e" ON "agents_observation_locks" ("observationScopeId") | +| sqlite_autoindex_agents_observation_locks_1 | PRIMARY KEY (agentId, observationScopeId, taskKind) | + +## Relations + +```mermaid +erDiagram + +"agents_observation_locks" |o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_observation_locks" |o--|| "agents_threads" : "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"agents_observation_locks" { + varchar_36_ agentId PK + varchar_255_ observationScopeId PK + varchar_20_ taskKind PK + varchar_64_ holderId + datetime_3_ heldUntil + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents" { + varchar_36_ id PK + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + TEXT integrations + TEXT schema + TEXT tools + TEXT skills + varchar_36_ versionId + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ activeVersionId FK +} +"agents_threads" { + varchar_128_ id PK + varchar_255_ resourceId + varchar_255_ title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agents_observations.md b/docs/generated/sqlite-schema/agents_observations.md new file mode 100644 index 00000000000..0633e2bab21 --- /dev/null +++ b/docs/generated/sqlite-schema/agents_observations.md @@ -0,0 +1,114 @@ +# agents_observations + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agents_observations" ("id" varchar(36) PRIMARY KEY NOT NULL, "agentId" varchar(36) NOT NULL, "observationScopeId" varchar(255) NOT NULL, "marker" varchar(16) NOT NULL, "text" text NOT NULL, "parentId" varchar(36), "tokenCount" integer NOT NULL DEFAULT (0), "status" varchar(16) NOT NULL, "supersededBy" varchar(36), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "CHK_agents_observations_marker" CHECK ("marker" IN ('critical', 'important', 'info', 'completion')), CONSTRAINT "CHK_agents_observations_status" CHECK ("status" IN ('active', 'superseded', 'dropped')), CONSTRAINT "FK_d206432be97b7ed88d187479b1b" FOREIGN KEY ("agentId") REFERENCES "agents" ("id") ON DELETE CASCADE, CONSTRAINT "FK_4cfd8a70ebb0a5b0cf047dca3cf" FOREIGN KEY ("observationScopeId") REFERENCES "agents_threads" ("id") ON DELETE CASCADE, CONSTRAINT "FK_501e2d1701a10e24fb69ab5fc5f" FOREIGN KEY ("parentId") REFERENCES "agents_observations" ("id"), CONSTRAINT "FK_127ee1078ffa952bb37b511efad" FOREIGN KEY ("supersededBy") REFERENCES "agents_observations" ("id")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [agents_observations](agents_observations.md) [agents_memory_entry_sources](agents_memory_entry_sources.md) | | | +| agentId | varchar(36) | | false | | [agents](agents.md) | | +| observationScopeId | varchar(255) | | false | | [agents_threads](agents_threads.md) | | +| marker | varchar(16) | | false | | | | +| text | TEXT | | false | | | | +| parentId | varchar(36) | | true | | [agents_observations](agents_observations.md) | | +| tokenCount | INTEGER | 0 | false | | | | +| status | varchar(16) | | false | | | | +| supersededBy | varchar(36) | | true | | [agents_observations](agents_observations.md) | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (supersededBy) REFERENCES agents_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (parentId) REFERENCES agents_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE | +| - (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 3) | FOREIGN KEY | FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_agents_observations_1 | PRIMARY KEY | PRIMARY KEY (id) | +| - | CHECK | CHECK ("marker" IN ('critical', 'important', 'info', 'completion')) | +| - | CHECK | CHECK ("status" IN ('active', 'superseded', 'dropped')) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_127ee1078ffa952bb37b511efa | CREATE INDEX "IDX_127ee1078ffa952bb37b511efa" ON "agents_observations" ("supersededBy") | +| IDX_501e2d1701a10e24fb69ab5fc5 | CREATE INDEX "IDX_501e2d1701a10e24fb69ab5fc5" ON "agents_observations" ("parentId") | +| IDX_4cfd8a70ebb0a5b0cf047dca3c | CREATE INDEX "IDX_4cfd8a70ebb0a5b0cf047dca3c" ON "agents_observations" ("observationScopeId") | +| IDX_07cb1e4a302629c5fa5d74d2bb | CREATE INDEX "IDX_07cb1e4a302629c5fa5d74d2bb" ON "agents_observations" ("agentId", "observationScopeId", "status") | +| sqlite_autoindex_agents_observations_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"agents_observations" }o--o| "agents_observations" : "FOREIGN KEY (supersededBy) REFERENCES agents_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" +"agents_observations" }o--o| "agents_observations" : "FOREIGN KEY (parentId) REFERENCES agents_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" +"agents_memory_entry_sources" }o--|| "agents_observations" : "FOREIGN KEY (observationId) REFERENCES agents_observations (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_observations" }o--|| "agents" : "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_observations" }o--|| "agents_threads" : "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"agents_observations" { + varchar_36_ id PK + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_16_ marker + TEXT text + varchar_36_ parentId FK + INTEGER tokenCount + varchar_16_ status + varchar_36_ supersededBy FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_memory_entry_sources" { + varchar_36_ id PK + varchar_36_ agentId FK + varchar_36_ memoryEntryId FK + varchar_36_ observationId FK + varchar_255_ threadId FK + varchar_64_ evidenceHash + TEXT evidenceText + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents" { + varchar_36_ id PK + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + TEXT integrations + TEXT schema + TEXT tools + TEXT skills + varchar_36_ versionId + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ activeVersionId FK +} +"agents_threads" { + varchar_128_ id PK + varchar_255_ resourceId + varchar_255_ title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agents_resources.md b/docs/generated/sqlite-schema/agents_resources.md new file mode 100644 index 00000000000..23e82de539d --- /dev/null +++ b/docs/generated/sqlite-schema/agents_resources.md @@ -0,0 +1,77 @@ +# agents_resources + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agents_resources" ("id" varchar(255) PRIMARY KEY NOT NULL, "metadata" text, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW'))) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(255) | | false | [agents_memory_entries](agents_memory_entries.md) [agents_memory_entry_locks](agents_memory_entry_locks.md) | | | +| metadata | TEXT | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| sqlite_autoindex_agents_resources_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_agents_resources_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"agents_memory_entries" }o--|| "agents_resources" : "FOREIGN KEY (resourceId) REFERENCES agents_resources (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_locks" |o--|| "agents_resources" : "FOREIGN KEY (resourceId) REFERENCES agents_resources (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"agents_resources" { + varchar_255_ id PK + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_memory_entries" { + varchar_36_ id PK + varchar_36_ agentId FK + varchar_255_ resourceId FK + TEXT content + varchar_64_ contentHash + varchar_16_ status + varchar_36_ supersededBy FK + varchar_128_ embeddingModel + TEXT embedding + TEXT metadata + datetime_3_ lastSeenAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_memory_entry_locks" { + varchar_36_ agentId PK + varchar_255_ resourceId PK + varchar_64_ holderId + datetime_3_ heldUntil + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/agents_threads.md b/docs/generated/sqlite-schema/agents_threads.md new file mode 100644 index 00000000000..e5e75d64161 --- /dev/null +++ b/docs/generated/sqlite-schema/agents_threads.md @@ -0,0 +1,122 @@ +# agents_threads + +## Description + +
+Table Definition + +```sql +CREATE TABLE "agents_threads" ("id" varchar(128) PRIMARY KEY NOT NULL, "resourceId" varchar(255) NOT NULL, "title" varchar(255), "metadata" text, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW'))) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(128) | | false | [agents_messages](agents_messages.md) [agents_observations](agents_observations.md) [agents_observation_cursors](agents_observation_cursors.md) [agents_observation_locks](agents_observation_locks.md) [agents_memory_entry_sources](agents_memory_entry_sources.md) [agents_memory_entry_cursors](agents_memory_entry_cursors.md) | | | +| resourceId | varchar(255) | | false | | | | +| title | varchar(255) | | true | | | | +| metadata | TEXT | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| sqlite_autoindex_agents_threads_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_54fa1b94f34a409beafae567a4 | CREATE INDEX "IDX_54fa1b94f34a409beafae567a4" ON "agents_threads" ("resourceId") | +| sqlite_autoindex_agents_threads_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"agents_messages" }o--|| "agents_threads" : "FOREIGN KEY (threadId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_observations" }o--|| "agents_threads" : "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_observation_cursors" |o--|| "agents_threads" : "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_observation_locks" |o--|| "agents_threads" : "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_sources" }o--|| "agents_threads" : "FOREIGN KEY (threadId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents_memory_entry_cursors" |o--|| "agents_threads" : "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"agents_threads" { + varchar_128_ id PK + varchar_255_ resourceId + varchar_255_ title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_messages" { + varchar_36_ id PK + varchar_255_ threadId FK + varchar_255_ resourceId + varchar_36_ role + varchar_36_ type + TEXT content + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_observations" { + varchar_36_ id PK + varchar_36_ agentId FK + varchar_255_ observationScopeId FK + varchar_16_ marker + TEXT text + varchar_36_ parentId FK + INTEGER tokenCount + varchar_16_ status + varchar_36_ supersededBy FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_observation_cursors" { + varchar_36_ agentId PK + varchar_255_ observationScopeId PK + varchar_36_ lastObservedMessageId + datetime_3_ lastObservedAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_observation_locks" { + varchar_36_ agentId PK + varchar_255_ observationScopeId PK + varchar_20_ taskKind PK + varchar_64_ holderId + datetime_3_ heldUntil + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_memory_entry_sources" { + varchar_36_ id PK + varchar_36_ agentId FK + varchar_36_ memoryEntryId FK + varchar_36_ observationId FK + varchar_255_ threadId FK + varchar_64_ evidenceHash + TEXT evidenceText + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agents_memory_entry_cursors" { + varchar_36_ agentId PK + varchar_255_ observationScopeId PK + varchar_36_ lastIndexedObservationId + datetime_3_ lastIndexedObservationCreatedAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/ai_builder_temporary_workflow.md b/docs/generated/sqlite-schema/ai_builder_temporary_workflow.md new file mode 100644 index 00000000000..6e83abff770 --- /dev/null +++ b/docs/generated/sqlite-schema/ai_builder_temporary_workflow.md @@ -0,0 +1,88 @@ +# ai_builder_temporary_workflow + +## Description + +
+Table Definition + +```sql +CREATE TABLE "ai_builder_temporary_workflow" ("workflowId" varchar(36) PRIMARY KEY NOT NULL, "threadId" varchar NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_85a87a1ba0f61999fe11dc56325" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE CASCADE, CONSTRAINT "FK_39b07732e819fb561d74c38763f" FOREIGN KEY ("threadId") REFERENCES "instance_ai_threads" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| workflowId | varchar(36) | | false | | [workflow_entity](workflow_entity.md) | | +| threadId | varchar | | false | | [instance_ai_threads](instance_ai_threads.md) | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| workflowId | PRIMARY KEY | PRIMARY KEY (workflowId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_ai_builder_temporary_workflow_1 | PRIMARY KEY | PRIMARY KEY (workflowId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_39b07732e819fb561d74c38763 | CREATE INDEX "IDX_39b07732e819fb561d74c38763" ON "ai_builder_temporary_workflow" ("threadId") | +| sqlite_autoindex_ai_builder_temporary_workflow_1 | PRIMARY KEY (workflowId) | + +## Relations + +```mermaid +erDiagram + +"ai_builder_temporary_workflow" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"ai_builder_temporary_workflow" }o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"ai_builder_temporary_workflow" { + varchar_36_ workflowId PK + varchar threadId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +"instance_ai_threads" { + varchar id PK + varchar_255_ resourceId + varchar_36_ projectId FK + TEXT title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/annotation_tag_entity.md b/docs/generated/sqlite-schema/annotation_tag_entity.md new file mode 100644 index 00000000000..86f4b1a83f6 --- /dev/null +++ b/docs/generated/sqlite-schema/annotation_tag_entity.md @@ -0,0 +1,58 @@ +# annotation_tag_entity + +## Description + +
+Table Definition + +```sql +CREATE TABLE "annotation_tag_entity" ("id" varchar(16) PRIMARY KEY NOT NULL, "name" varchar(24) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW'))) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(16) | | false | [execution_annotation_tags](execution_annotation_tags.md) | | | +| name | varchar(24) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| sqlite_autoindex_annotation_tag_entity_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_ae51b54c4bb430cf92f48b623f | CREATE UNIQUE INDEX "IDX_ae51b54c4bb430cf92f48b623f" ON "annotation_tag_entity" ("name") | +| sqlite_autoindex_annotation_tag_entity_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"execution_annotation_tags" |o--|| "annotation_tag_entity" : "FOREIGN KEY (tagId) REFERENCES annotation_tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"annotation_tag_entity" { + varchar_16_ id PK + varchar_24_ name + datetime_3_ createdAt + datetime_3_ updatedAt +} +"execution_annotation_tags" { + INTEGER annotationId PK + varchar_24_ tagId PK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/auth_identity.md b/docs/generated/sqlite-schema/auth_identity.md new file mode 100644 index 00000000000..1fb40334b5b --- /dev/null +++ b/docs/generated/sqlite-schema/auth_identity.md @@ -0,0 +1,81 @@ +# auth_identity + +## Description + +
+Table Definition + +```sql +CREATE TABLE "auth_identity" ( + "userId" VARCHAR(36) REFERENCES "user" (id), + "providerId" VARCHAR(64) NOT NULL, + "providerType" VARCHAR(32) NOT NULL, + "createdAt" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY("providerId", "providerType") + ) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| userId | VARCHAR(36) | | true | | [user](user.md) | | +| providerId | VARCHAR(64) | | false | | | | +| providerType | VARCHAR(32) | | false | | | | +| createdAt | timestamp | CURRENT_TIMESTAMP | false | | | | +| updatedAt | timestamp | CURRENT_TIMESTAMP | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| providerId | PRIMARY KEY | PRIMARY KEY (providerId) | +| providerType | PRIMARY KEY | PRIMARY KEY (providerType) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE | +| sqlite_autoindex_auth_identity_1 | PRIMARY KEY | PRIMARY KEY (providerId, providerType) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_auth_identity_1 | PRIMARY KEY (providerId, providerType) | + +## Relations + +```mermaid +erDiagram + +"auth_identity" }o--o| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" + +"auth_identity" { + VARCHAR_36_ userId FK + VARCHAR_64_ providerId PK + VARCHAR_32_ providerType PK + timestamp createdAt + timestamp updatedAt +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/auth_provider_sync_history.md b/docs/generated/sqlite-schema/auth_provider_sync_history.md new file mode 100644 index 00000000000..9546439304b --- /dev/null +++ b/docs/generated/sqlite-schema/auth_provider_sync_history.md @@ -0,0 +1,71 @@ +# auth_provider_sync_history + +## Description + +
+Table Definition + +```sql +CREATE TABLE "auth_provider_sync_history" ( + "id" INTEGER PRIMARY KEY AUTOINCREMENT, + "providerType" VARCHAR(32) NOT NULL, + "runMode" TEXT NOT NULL, + "status" TEXT NOT NULL, + "startedAt" DATETIME NOT NULL, + "endedAt" DATETIME NOT NULL, + "scanned" INTEGER NOT NULL, + "created" INTEGER NOT NULL, + "updated" INTEGER NOT NULL, + "disabled" INTEGER NOT NULL, + "error" TEXT + ) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | INTEGER | | true | | | | +| providerType | VARCHAR(32) | | false | | | | +| runMode | TEXT | | false | | | | +| status | TEXT | | false | | | | +| startedAt | DATETIME | | false | | | | +| endedAt | DATETIME | | false | | | | +| scanned | INTEGER | | false | | | | +| created | INTEGER | | false | | | | +| updated | INTEGER | | false | | | | +| disabled | INTEGER | | false | | | | +| error | TEXT | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + + +"auth_provider_sync_history" { + INTEGER id + VARCHAR_32_ providerType + TEXT runMode + TEXT status + DATETIME startedAt + DATETIME endedAt + INTEGER scanned + INTEGER created + INTEGER updated + INTEGER disabled + TEXT error +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/binary_data.md b/docs/generated/sqlite-schema/binary_data.md new file mode 100644 index 00000000000..5e1d097c78b --- /dev/null +++ b/docs/generated/sqlite-schema/binary_data.md @@ -0,0 +1,64 @@ +# binary_data + +## Description + +
+Table Definition + +```sql +CREATE TABLE "binary_data" ("fileId" varchar PRIMARY KEY NOT NULL, "sourceType" varchar(50) NOT NULL, "sourceId" varchar(255) NOT NULL, "data" blob NOT NULL, "mimeType" varchar(255), "fileName" varchar(255), "fileSize" integer NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "CHK_binary_data_sourceType" CHECK ("sourceType" IN ('execution', 'chat_message_attachment', 'agent_file'))) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| fileId | varchar | | false | | | | +| sourceType | varchar(50) | | false | | | | +| sourceId | varchar(255) | | false | | | | +| data | BLOB | | false | | | | +| mimeType | varchar(255) | | true | | | | +| fileName | varchar(255) | | true | | | | +| fileSize | INTEGER | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| fileId | PRIMARY KEY | PRIMARY KEY (fileId) | +| sqlite_autoindex_binary_data_1 | PRIMARY KEY | PRIMARY KEY (fileId) | +| - | CHECK | CHECK ("sourceType" IN ('execution', 'chat_message_attachment', 'agent_file')) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_56900edc3cfd16612e2ef2c6a8 | CREATE INDEX "IDX_56900edc3cfd16612e2ef2c6a8" ON "binary_data" ("sourceType", "sourceId") | +| sqlite_autoindex_binary_data_1 | PRIMARY KEY (fileId) | + +## Relations + +```mermaid +erDiagram + + +"binary_data" { + varchar fileId PK + varchar_50_ sourceType + varchar_255_ sourceId + BLOB data + varchar_255_ mimeType + varchar_255_ fileName + INTEGER fileSize + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/chat_hub_agent_tools.md b/docs/generated/sqlite-schema/chat_hub_agent_tools.md new file mode 100644 index 00000000000..6929e80b592 --- /dev/null +++ b/docs/generated/sqlite-schema/chat_hub_agent_tools.md @@ -0,0 +1,79 @@ +# chat_hub_agent_tools + +## Description + +
+Table Definition + +```sql +CREATE TABLE "chat_hub_agent_tools" ("agentId" varchar NOT NULL, "toolId" varchar NOT NULL, CONSTRAINT "FK_2b53d796b3dbae91b1a9553c048" FOREIGN KEY ("agentId") REFERENCES "chat_hub_agents" ("id") ON DELETE CASCADE, CONSTRAINT "FK_43e70f04c53344f82483d0570f6" FOREIGN KEY ("toolId") REFERENCES "chat_hub_tools" ("id") ON DELETE CASCADE, PRIMARY KEY ("agentId", "toolId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| agentId | varchar | | false | | [chat_hub_agents](chat_hub_agents.md) | | +| toolId | varchar | | false | | [chat_hub_tools](chat_hub_tools.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| agentId | PRIMARY KEY | PRIMARY KEY (agentId) | +| toolId | PRIMARY KEY | PRIMARY KEY (toolId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (toolId) REFERENCES chat_hub_tools (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_chat_hub_agent_tools_1 | PRIMARY KEY | PRIMARY KEY (agentId, toolId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_chat_hub_agent_tools_1 | PRIMARY KEY (agentId, toolId) | + +## Relations + +```mermaid +erDiagram + +"chat_hub_agent_tools" |o--|| "chat_hub_agents" : "FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_agent_tools" |o--|| "chat_hub_tools" : "FOREIGN KEY (toolId) REFERENCES chat_hub_tools (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"chat_hub_agent_tools" { + varchar agentId PK + varchar toolId PK +} +"chat_hub_agents" { + varchar id PK + varchar_256_ name + varchar_512_ description + TEXT systemPrompt + varchar ownerId FK + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + TEXT files + TEXT suggestedPrompts +} +"chat_hub_tools" { + varchar id PK + varchar_255_ name + varchar_255_ type + REAL typeVersion + varchar ownerId FK + TEXT definition + boolean enabled + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/chat_hub_agents.md b/docs/generated/sqlite-schema/chat_hub_agents.md new file mode 100644 index 00000000000..7725ef4433e --- /dev/null +++ b/docs/generated/sqlite-schema/chat_hub_agents.md @@ -0,0 +1,145 @@ +# chat_hub_agents + +## Description + +
+Table Definition + +```sql +CREATE TABLE "chat_hub_agents" ("id" varchar PRIMARY KEY NOT NULL, "name" varchar(256) NOT NULL, "description" varchar(512), "systemPrompt" text NOT NULL, "ownerId" varchar NOT NULL, "credentialId" varchar(36), "provider" varchar(16) NOT NULL, "model" varchar(64) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "icon" text, "files" text NOT NULL DEFAULT ('[]'), "suggestedPrompts" text NOT NULL DEFAULT ('[]'), CONSTRAINT "FK_9c61ad497dcbae499c96a6a78ba" FOREIGN KEY ("credentialId") REFERENCES "credentials_entity" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_441ba2caba11e077ce3fbfa2cd8" FOREIGN KEY ("ownerId") REFERENCES "user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar | | false | [chat_hub_messages](chat_hub_messages.md) [chat_hub_agent_tools](chat_hub_agent_tools.md) [chat_hub_sessions](chat_hub_sessions.md) | | | +| name | varchar(256) | | false | | | | +| description | varchar(512) | | true | | | | +| systemPrompt | TEXT | | false | | | | +| ownerId | varchar | | false | | [user](user.md) | | +| credentialId | varchar(36) | | true | | [credentials_entity](credentials_entity.md) | | +| provider | varchar(16) | | false | | | | +| model | varchar(64) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| icon | TEXT | | true | | | | +| files | TEXT | '[]' | false | | | | +| suggestedPrompts | TEXT | '[]' | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| sqlite_autoindex_chat_hub_agents_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_chat_hub_agents_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"chat_hub_messages" }o--o| "chat_hub_agents" : "FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"chat_hub_agent_tools" |o--|| "chat_hub_agents" : "FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_sessions" }o--o| "chat_hub_agents" : "FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"chat_hub_agents" }o--|| "user" : "FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_agents" }o--o| "credentials_entity" : "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + +"chat_hub_agents" { + varchar id PK + varchar_256_ name + varchar_512_ description + TEXT systemPrompt + varchar ownerId FK + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + TEXT files + TEXT suggestedPrompts +} +"chat_hub_messages" { + varchar id PK + varchar sessionId FK + varchar previousMessageId FK + varchar revisionOfMessageId FK + varchar retryOfMessageId FK + varchar_16_ type + varchar_128_ name + TEXT content + varchar_16_ provider + varchar_36_ workflowId FK + INTEGER executionId FK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ agentId FK + varchar_16_ status + TEXT attachments + VARCHAR_256_ model +} +"chat_hub_agent_tools" { + varchar agentId PK + varchar toolId PK +} +"chat_hub_sessions" { + varchar id PK + varchar_256_ title + varchar ownerId FK + datetime_3_ lastMessageAt + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + varchar_36_ workflowId FK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ agentId FK + varchar_128_ agentName + varchar_16_ type +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"credentials_entity" { + varchar_36_ id PK + varchar_128_ name + TEXT data + varchar_32_ type + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/chat_hub_messages.md b/docs/generated/sqlite-schema/chat_hub_messages.md new file mode 100644 index 00000000000..5bd5132504e --- /dev/null +++ b/docs/generated/sqlite-schema/chat_hub_messages.md @@ -0,0 +1,162 @@ +# chat_hub_messages + +## Description + +
+Table Definition + +```sql +CREATE TABLE "chat_hub_messages" ("id" varchar PRIMARY KEY NOT NULL, "sessionId" varchar NOT NULL, "previousMessageId" varchar, "revisionOfMessageId" varchar, "retryOfMessageId" varchar, "type" varchar(16) NOT NULL, "name" varchar(128) NOT NULL, "content" text NOT NULL, "provider" varchar(16), "workflowId" varchar(36), "executionId" integer, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "agentId" varchar(36), "status" varchar(16) NOT NULL DEFAULT ('success'), "attachments" text, "model" VARCHAR(256), CONSTRAINT "FK_e22538eb50a71a17954cd7e076c" FOREIGN KEY ("sessionId") REFERENCES "chat_hub_sessions" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_e5d1fa722c5a8d38ac204746662" FOREIGN KEY ("previousMessageId") REFERENCES "chat_hub_messages" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_acf8926098f063cdbbad8497fd1" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_25c9736e7f769f3a005eef4b372" FOREIGN KEY ("retryOfMessageId") REFERENCES "chat_hub_messages" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_1f4998c8a7dec9e00a9ab15550e" FOREIGN KEY ("revisionOfMessageId") REFERENCES "chat_hub_messages" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_6afb260449dd7a9b85355d4e0c9" FOREIGN KEY ("executionId") REFERENCES "execution_entity" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_chat_hub_messages_agentId" FOREIGN KEY ("agentId") REFERENCES "chat_hub_agents" ("id") ON DELETE SET NULL) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar | | false | [chat_hub_messages](chat_hub_messages.md) | | | +| sessionId | varchar | | false | | [chat_hub_sessions](chat_hub_sessions.md) | | +| previousMessageId | varchar | | true | | [chat_hub_messages](chat_hub_messages.md) | | +| revisionOfMessageId | varchar | | true | | [chat_hub_messages](chat_hub_messages.md) | | +| retryOfMessageId | varchar | | true | | [chat_hub_messages](chat_hub_messages.md) | | +| type | varchar(16) | | false | | | | +| name | varchar(128) | | false | | | | +| content | TEXT | | false | | | | +| provider | varchar(16) | | true | | | | +| workflowId | varchar(36) | | true | | [workflow_entity](workflow_entity.md) | | +| executionId | INTEGER | | true | | [execution_entity](execution_entity.md) | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| agentId | varchar(36) | | true | | [chat_hub_agents](chat_hub_agents.md) | | +| status | varchar(16) | 'success' | false | | | | +| attachments | TEXT | | true | | | | +| model | VARCHAR(256) | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| - (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (revisionOfMessageId) REFERENCES chat_hub_messages (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 3) | FOREIGN KEY | FOREIGN KEY (retryOfMessageId) REFERENCES chat_hub_messages (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 4) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| - (Foreign key ID: 5) | FOREIGN KEY | FOREIGN KEY (previousMessageId) REFERENCES chat_hub_messages (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 6) | FOREIGN KEY | FOREIGN KEY (sessionId) REFERENCES chat_hub_sessions (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_chat_hub_messages_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_chat_hub_messages_sessionId | CREATE INDEX "IDX_chat_hub_messages_sessionId"
ON "chat_hub_messages"("sessionId") | +| sqlite_autoindex_chat_hub_messages_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"chat_hub_messages" }o--o| "chat_hub_messages" : "FOREIGN KEY (revisionOfMessageId) REFERENCES chat_hub_messages (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_messages" }o--o| "chat_hub_messages" : "FOREIGN KEY (retryOfMessageId) REFERENCES chat_hub_messages (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_messages" }o--o| "chat_hub_messages" : "FOREIGN KEY (previousMessageId) REFERENCES chat_hub_messages (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_messages" }o--|| "chat_hub_sessions" : "FOREIGN KEY (sessionId) REFERENCES chat_hub_sessions (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_messages" }o--o| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"chat_hub_messages" }o--o| "execution_entity" : "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"chat_hub_messages" }o--o| "chat_hub_agents" : "FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + +"chat_hub_messages" { + varchar id PK + varchar sessionId FK + varchar previousMessageId FK + varchar revisionOfMessageId FK + varchar retryOfMessageId FK + varchar_16_ type + varchar_128_ name + TEXT content + varchar_16_ provider + varchar_36_ workflowId FK + INTEGER executionId FK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ agentId FK + varchar_16_ status + TEXT attachments + VARCHAR_256_ model +} +"chat_hub_sessions" { + varchar id PK + varchar_256_ title + varchar ownerId FK + datetime_3_ lastMessageAt + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + varchar_36_ workflowId FK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ agentId FK + varchar_128_ agentName + varchar_16_ type +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +"execution_entity" { + INTEGER id + varchar_36_ workflowId FK + boolean finished + varchar mode + varchar retryOf + varchar retrySuccessId + datetime startedAt + datetime stoppedAt + datetime waitTill + varchar status + datetime_3_ deletedAt + datetime_3_ createdAt + varchar_2_ storedAt + TEXT tracingContext + varchar_255_ deduplicationKey +} +"chat_hub_agents" { + varchar id PK + varchar_256_ name + varchar_512_ description + TEXT systemPrompt + varchar ownerId FK + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + TEXT files + TEXT suggestedPrompts +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/chat_hub_session_tools.md b/docs/generated/sqlite-schema/chat_hub_session_tools.md new file mode 100644 index 00000000000..98d9f38b81c --- /dev/null +++ b/docs/generated/sqlite-schema/chat_hub_session_tools.md @@ -0,0 +1,79 @@ +# chat_hub_session_tools + +## Description + +
+Table Definition + +```sql +CREATE TABLE "chat_hub_session_tools" ("sessionId" varchar NOT NULL, "toolId" varchar NOT NULL, CONSTRAINT "FK_e649bf1295f4ed8d4299ed290f9" FOREIGN KEY ("sessionId") REFERENCES "chat_hub_sessions" ("id") ON DELETE CASCADE, CONSTRAINT "FK_6596a328affd8d4967ffb303eee" FOREIGN KEY ("toolId") REFERENCES "chat_hub_tools" ("id") ON DELETE CASCADE, PRIMARY KEY ("sessionId", "toolId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| sessionId | varchar | | false | | [chat_hub_sessions](chat_hub_sessions.md) | | +| toolId | varchar | | false | | [chat_hub_tools](chat_hub_tools.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| sessionId | PRIMARY KEY | PRIMARY KEY (sessionId) | +| toolId | PRIMARY KEY | PRIMARY KEY (toolId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (toolId) REFERENCES chat_hub_tools (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (sessionId) REFERENCES chat_hub_sessions (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_chat_hub_session_tools_1 | PRIMARY KEY | PRIMARY KEY (sessionId, toolId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_chat_hub_session_tools_1 | PRIMARY KEY (sessionId, toolId) | + +## Relations + +```mermaid +erDiagram + +"chat_hub_session_tools" |o--|| "chat_hub_sessions" : "FOREIGN KEY (sessionId) REFERENCES chat_hub_sessions (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_session_tools" |o--|| "chat_hub_tools" : "FOREIGN KEY (toolId) REFERENCES chat_hub_tools (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"chat_hub_session_tools" { + varchar sessionId PK + varchar toolId PK +} +"chat_hub_sessions" { + varchar id PK + varchar_256_ title + varchar ownerId FK + datetime_3_ lastMessageAt + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + varchar_36_ workflowId FK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ agentId FK + varchar_128_ agentName + varchar_16_ type +} +"chat_hub_tools" { + varchar id PK + varchar_255_ name + varchar_255_ type + REAL typeVersion + varchar ownerId FK + TEXT definition + boolean enabled + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/chat_hub_sessions.md b/docs/generated/sqlite-schema/chat_hub_sessions.md new file mode 100644 index 00000000000..a706ebb46d5 --- /dev/null +++ b/docs/generated/sqlite-schema/chat_hub_sessions.md @@ -0,0 +1,171 @@ +# chat_hub_sessions + +## Description + +
+Table Definition + +```sql +CREATE TABLE "chat_hub_sessions" ("id" varchar PRIMARY KEY NOT NULL, "title" varchar(256) NOT NULL, "ownerId" varchar NOT NULL, "lastMessageAt" datetime(3) NOT NULL, "credentialId" varchar(36), "provider" varchar(16), "model" varchar(64), "workflowId" varchar(36), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "agentId" varchar(36), "agentName" varchar(128), "type" varchar(16) NOT NULL DEFAULT ('production'), CONSTRAINT "CHK_chat_hub_sessions_type" CHECK ("type" IN ('production', 'manual')), CONSTRAINT "FK_chat_hub_sessions_agentId" FOREIGN KEY ("agentId") REFERENCES "chat_hub_agents" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_9f9293d9f552496c40e0d1a8f80" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_7bc13b4c7e6afbfaf9be326c189" FOREIGN KEY ("credentialId") REFERENCES "credentials_entity" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_e9ecf8ede7d989fcd18790fe36a" FOREIGN KEY ("ownerId") REFERENCES "user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar | | false | [chat_hub_messages](chat_hub_messages.md) [chat_hub_session_tools](chat_hub_session_tools.md) | | | +| title | varchar(256) | | false | | | | +| ownerId | varchar | | false | | [user](user.md) | | +| lastMessageAt | datetime(3) | | false | | | | +| credentialId | varchar(36) | | true | | [credentials_entity](credentials_entity.md) | | +| provider | varchar(16) | | true | | | | +| model | varchar(64) | | true | | | | +| workflowId | varchar(36) | | true | | [workflow_entity](workflow_entity.md) | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| agentId | varchar(36) | | true | | [chat_hub_agents](chat_hub_agents.md) | | +| agentName | varchar(128) | | true | | | | +| type | varchar(16) | 'production' | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| - (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| - (Foreign key ID: 3) | FOREIGN KEY | FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| sqlite_autoindex_chat_hub_sessions_1 | PRIMARY KEY | PRIMARY KEY (id) | +| - | CHECK | CHECK ("type" IN ('production', 'manual')) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_chat_hub_sessions_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"chat_hub_messages" }o--|| "chat_hub_sessions" : "FOREIGN KEY (sessionId) REFERENCES chat_hub_sessions (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_session_tools" |o--|| "chat_hub_sessions" : "FOREIGN KEY (sessionId) REFERENCES chat_hub_sessions (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_sessions" }o--|| "user" : "FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_sessions" }o--o| "credentials_entity" : "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"chat_hub_sessions" }o--o| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"chat_hub_sessions" }o--o| "chat_hub_agents" : "FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + +"chat_hub_sessions" { + varchar id PK + varchar_256_ title + varchar ownerId FK + datetime_3_ lastMessageAt + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + varchar_36_ workflowId FK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ agentId FK + varchar_128_ agentName + varchar_16_ type +} +"chat_hub_messages" { + varchar id PK + varchar sessionId FK + varchar previousMessageId FK + varchar revisionOfMessageId FK + varchar retryOfMessageId FK + varchar_16_ type + varchar_128_ name + TEXT content + varchar_16_ provider + varchar_36_ workflowId FK + INTEGER executionId FK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ agentId FK + varchar_16_ status + TEXT attachments + VARCHAR_256_ model +} +"chat_hub_session_tools" { + varchar sessionId PK + varchar toolId PK +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"credentials_entity" { + varchar_36_ id PK + varchar_128_ name + TEXT data + varchar_32_ type + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +"chat_hub_agents" { + varchar id PK + varchar_256_ name + varchar_512_ description + TEXT systemPrompt + varchar ownerId FK + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + TEXT files + TEXT suggestedPrompts +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/chat_hub_tools.md b/docs/generated/sqlite-schema/chat_hub_tools.md new file mode 100644 index 00000000000..a9597397228 --- /dev/null +++ b/docs/generated/sqlite-schema/chat_hub_tools.md @@ -0,0 +1,92 @@ +# chat_hub_tools + +## Description + +
+Table Definition + +```sql +CREATE TABLE "chat_hub_tools" ("id" varchar PRIMARY KEY NOT NULL, "name" varchar(255) NOT NULL, "type" varchar(255) NOT NULL, "typeVersion" real NOT NULL, "ownerId" varchar NOT NULL, "definition" text NOT NULL, "enabled" boolean NOT NULL DEFAULT (true), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_b8030b47af9213f1fd15450fb7f" FOREIGN KEY ("ownerId") REFERENCES "user" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar | | false | [chat_hub_session_tools](chat_hub_session_tools.md) [chat_hub_agent_tools](chat_hub_agent_tools.md) | | | +| name | varchar(255) | | false | | | | +| type | varchar(255) | | false | | | | +| typeVersion | REAL | | false | | | | +| ownerId | varchar | | false | | [user](user.md) | | +| definition | TEXT | | false | | | | +| enabled | boolean | true | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_chat_hub_tools_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_4c72ebdb265d1775bf61147af0 | CREATE UNIQUE INDEX "IDX_4c72ebdb265d1775bf61147af0" ON "chat_hub_tools" ("ownerId", "name") | +| sqlite_autoindex_chat_hub_tools_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"chat_hub_session_tools" |o--|| "chat_hub_tools" : "FOREIGN KEY (toolId) REFERENCES chat_hub_tools (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_agent_tools" |o--|| "chat_hub_tools" : "FOREIGN KEY (toolId) REFERENCES chat_hub_tools (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_tools" }o--|| "user" : "FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"chat_hub_tools" { + varchar id PK + varchar_255_ name + varchar_255_ type + REAL typeVersion + varchar ownerId FK + TEXT definition + boolean enabled + datetime_3_ createdAt + datetime_3_ updatedAt +} +"chat_hub_session_tools" { + varchar sessionId PK + varchar toolId PK +} +"chat_hub_agent_tools" { + varchar agentId PK + varchar toolId PK +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/credential_dependency.md b/docs/generated/sqlite-schema/credential_dependency.md new file mode 100644 index 00000000000..5c64bbf4e01 --- /dev/null +++ b/docs/generated/sqlite-schema/credential_dependency.md @@ -0,0 +1,70 @@ +# credential_dependency + +## Description + +
+Table Definition + +```sql +CREATE TABLE "credential_dependency" ("id" integer PRIMARY KEY NOT NULL, "credentialId" varchar(36) NOT NULL, "dependencyType" varchar(64) NOT NULL, "dependencyId" varchar(255) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_5ec8e8c8d3539f3696cf73b43bf" FOREIGN KEY ("credentialId") REFERENCES "credentials_entity" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | INTEGER | | false | | | | +| credentialId | varchar(36) | | false | | [credentials_entity](credentials_entity.md) | | +| dependencyType | varchar(64) | | false | | | | +| dependencyId | varchar(255) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_credential_dependency_credentialId_dependencyType_dependencyId | CREATE UNIQUE INDEX "IDX_credential_dependency_credentialId_dependencyType_dependencyId" ON "credential_dependency" ("credentialId", "dependencyType", "dependencyId") | +| IDX_91ee85fa9619dd6776725e117b | CREATE INDEX "IDX_91ee85fa9619dd6776725e117b" ON "credential_dependency" ("dependencyType", "dependencyId") | +| IDX_5ec8e8c8d3539f3696cf73b43b | CREATE INDEX "IDX_5ec8e8c8d3539f3696cf73b43b" ON "credential_dependency" ("credentialId") | + +## Relations + +```mermaid +erDiagram + +"credential_dependency" }o--|| "credentials_entity" : "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"credential_dependency" { + INTEGER id + varchar_36_ credentialId FK + varchar_64_ dependencyType + varchar_255_ dependencyId + datetime_3_ createdAt +} +"credentials_entity" { + varchar_36_ id PK + varchar_128_ name + TEXT data + varchar_32_ type + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/credentials_entity.md b/docs/generated/sqlite-schema/credentials_entity.md new file mode 100644 index 00000000000..94767c3a57a --- /dev/null +++ b/docs/generated/sqlite-schema/credentials_entity.md @@ -0,0 +1,153 @@ +# credentials_entity + +## Description + +
+Table Definition + +```sql +CREATE TABLE "credentials_entity" ("id" varchar(36) PRIMARY KEY NOT NULL, "name" varchar(128) NOT NULL, "data" text NOT NULL, "type" varchar(32) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "isManaged" boolean NOT NULL DEFAULT (0), "isGlobal" boolean NOT NULL DEFAULT (0), "isResolvable" boolean NOT NULL DEFAULT (false), "resolvableAllowFallback" boolean NOT NULL DEFAULT (false), "resolverId" varchar(16), CONSTRAINT "credentials_entity_resolverId_foreign" FOREIGN KEY ("resolverId") REFERENCES "dynamic_credential_resolver" ("id") ON DELETE SET NULL) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [shared_credentials](shared_credentials.md) [dynamic_credential_user_entry](dynamic_credential_user_entry.md) [dynamic_credential_entry](dynamic_credential_entry.md) [chat_hub_agents](chat_hub_agents.md) [chat_hub_sessions](chat_hub_sessions.md) [credential_dependency](credential_dependency.md) [instance_ai_mcp_registry_connections](instance_ai_mcp_registry_connections.md) | | | +| name | varchar(128) | | false | | | | +| data | TEXT | | false | | | | +| type | varchar(32) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| isManaged | boolean | 0 | false | | | | +| isGlobal | boolean | 0 | false | | | | +| isResolvable | boolean | false | false | | | | +| resolvableAllowFallback | boolean | false | false | | | | +| resolverId | varchar(16) | | true | | [dynamic_credential_resolver](dynamic_credential_resolver.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (resolverId) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| sqlite_autoindex_credentials_entity_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| idx_credentials_entity_type | CREATE INDEX "idx_credentials_entity_type" ON "credentials_entity" ("type") | +| sqlite_autoindex_credentials_entity_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"shared_credentials" |o--|| "credentials_entity" : "FOREIGN KEY (credentialsId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"dynamic_credential_user_entry" |o--|| "credentials_entity" : "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"dynamic_credential_entry" |o--|| "credentials_entity" : "FOREIGN KEY (credential_id) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_agents" }o--o| "credentials_entity" : "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"chat_hub_sessions" }o--o| "credentials_entity" : "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"credential_dependency" }o--|| "credentials_entity" : "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_mcp_registry_connections" }o--|| "credentials_entity" : "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"credentials_entity" }o--o| "dynamic_credential_resolver" : "FOREIGN KEY (resolverId) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + +"credentials_entity" { + varchar_36_ id PK + varchar_128_ name + TEXT data + varchar_32_ type + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +"shared_credentials" { + varchar_36_ credentialsId PK + varchar_36_ projectId PK + TEXT role + datetime_3_ createdAt + datetime_3_ updatedAt +} +"dynamic_credential_user_entry" { + varchar_16_ credentialId PK + varchar userId PK + varchar_16_ resolverId PK + TEXT data + datetime_3_ createdAt + datetime_3_ updatedAt +} +"dynamic_credential_entry" { + varchar_16_ credential_id PK + varchar_2048_ subject_id PK + varchar_16_ resolver_id PK + TEXT data + datetime_3_ createdAt + datetime_3_ updatedAt +} +"chat_hub_agents" { + varchar id PK + varchar_256_ name + varchar_512_ description + TEXT systemPrompt + varchar ownerId FK + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + TEXT files + TEXT suggestedPrompts +} +"chat_hub_sessions" { + varchar id PK + varchar_256_ title + varchar ownerId FK + datetime_3_ lastMessageAt + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + varchar_36_ workflowId FK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ agentId FK + varchar_128_ agentName + varchar_16_ type +} +"credential_dependency" { + INTEGER id + varchar_36_ credentialId FK + varchar_64_ dependencyType + varchar_255_ dependencyId + datetime_3_ createdAt +} +"instance_ai_mcp_registry_connections" { + varchar id PK + varchar_36_ credentialId FK + varchar_255_ serverSlug FK + TEXT toolFilter + varchar userId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"dynamic_credential_resolver" { + varchar_16_ id PK + varchar_128_ name + varchar_128_ type + TEXT config + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/data_table.md b/docs/generated/sqlite-schema/data_table.md new file mode 100644 index 00000000000..2748e598747 --- /dev/null +++ b/docs/generated/sqlite-schema/data_table.md @@ -0,0 +1,79 @@ +# data_table + +## Description + +
+Table Definition + +```sql +CREATE TABLE "data_table" ("id" varchar(36) PRIMARY KEY NOT NULL, "name" varchar(128) NOT NULL, "projectId" varchar(36) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "UQ_b23096ef747281ac944d28e8b0d" UNIQUE ("projectId", "name"), CONSTRAINT "FK_c2a794257dee48af7c9abf681de" FOREIGN KEY ("projectId") REFERENCES "project" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [data_table_column](data_table_column.md) | | | +| name | varchar(128) | | false | | | | +| projectId | varchar(36) | | false | | [project](project.md) | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_data_table_2 | UNIQUE | UNIQUE (projectId, name) | +| sqlite_autoindex_data_table_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_data_table_2 | UNIQUE (projectId, name) | +| sqlite_autoindex_data_table_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"data_table_column" }o--|| "data_table" : "FOREIGN KEY (dataTableId) REFERENCES data_table (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"data_table" }o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"data_table" { + varchar_36_ id PK + varchar_128_ name + varchar_36_ projectId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"data_table_column" { + varchar_36_ id PK + varchar_128_ name + varchar_32_ type + INTEGER index + varchar_36_ dataTableId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"project" { + varchar_36_ id PK + varchar_255_ name + varchar_36_ type + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + varchar_512_ description + varchar creatorId FK + TEXT customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/data_table_column.md b/docs/generated/sqlite-schema/data_table_column.md new file mode 100644 index 00000000000..b0da969f5ce --- /dev/null +++ b/docs/generated/sqlite-schema/data_table_column.md @@ -0,0 +1,69 @@ +# data_table_column + +## Description + +
+Table Definition + +```sql +CREATE TABLE "data_table_column" ("id" varchar(36) PRIMARY KEY NOT NULL, "name" varchar(128) NOT NULL, "type" varchar(32) NOT NULL, "index" integer NOT NULL, "dataTableId" varchar(36) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "UQ_8082ec4890f892f0bc77473a123" UNIQUE ("dataTableId", "name"), CONSTRAINT "FK_930b6e8faaf88294cef23484160" FOREIGN KEY ("dataTableId") REFERENCES "data_table" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| name | varchar(128) | | false | | | | +| type | varchar(32) | | false | | | | +| index | INTEGER | | false | | | | +| dataTableId | varchar(36) | | false | | [data_table](data_table.md) | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (dataTableId) REFERENCES data_table (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_data_table_column_2 | UNIQUE | UNIQUE (dataTableId, name) | +| sqlite_autoindex_data_table_column_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_data_table_column_2 | UNIQUE (dataTableId, name) | +| sqlite_autoindex_data_table_column_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"data_table_column" }o--|| "data_table" : "FOREIGN KEY (dataTableId) REFERENCES data_table (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"data_table_column" { + varchar_36_ id PK + varchar_128_ name + varchar_32_ type + INTEGER index + varchar_36_ dataTableId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"data_table" { + varchar_36_ id PK + varchar_128_ name + varchar_36_ projectId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/deployment_key.md b/docs/generated/sqlite-schema/deployment_key.md new file mode 100644 index 00000000000..723d460b184 --- /dev/null +++ b/docs/generated/sqlite-schema/deployment_key.md @@ -0,0 +1,64 @@ +# deployment_key + +## Description + +
+Table Definition + +```sql +CREATE TABLE "deployment_key" ("id" varchar(36) PRIMARY KEY NOT NULL, "type" varchar(64) NOT NULL, "value" text NOT NULL, "algorithm" varchar(20), "status" varchar(20) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW'))) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| type | varchar(64) | | false | | | | +| value | TEXT | | false | | | | +| algorithm | varchar(20) | | true | | | | +| status | varchar(20) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| sqlite_autoindex_deployment_key_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_deployment_key_jwe_private_key_active | CREATE UNIQUE INDEX "IDX_deployment_key_jwe_private_key_active" ON "deployment_key" ("type", "algorithm") WHERE status = 'active' AND type = 'jwe.private-key' | +| IDX_deployment_key_signing_binary_data_active | CREATE UNIQUE INDEX "IDX_deployment_key_signing_binary_data_active" ON "deployment_key" ("type") WHERE status = 'active' AND type = 'signing.binary_data' | +| IDX_deployment_key_signing_hmac_active | CREATE UNIQUE INDEX "IDX_deployment_key_signing_hmac_active" ON "deployment_key" ("type") WHERE status = 'active' AND type = 'signing.hmac' | +| IDX_deployment_key_signing_jwt_active | CREATE UNIQUE INDEX "IDX_deployment_key_signing_jwt_active" ON "deployment_key" ("type") WHERE status = 'active' AND type = 'signing.jwt' | +| IDX_deployment_key_instance_id_active | CREATE UNIQUE INDEX "IDX_deployment_key_instance_id_active" ON "deployment_key" ("type") WHERE status = 'active' AND type = 'instance.id' | +| IDX_deployment_key_data_encryption_active | CREATE UNIQUE INDEX "IDX_deployment_key_data_encryption_active" ON "deployment_key" ("type") WHERE status = 'active' AND type = 'data_encryption' | +| sqlite_autoindex_deployment_key_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + + +"deployment_key" { + varchar_36_ id PK + varchar_64_ type + TEXT value + varchar_20_ algorithm + varchar_20_ status + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/dynamic_credential_entry.md b/docs/generated/sqlite-schema/dynamic_credential_entry.md new file mode 100644 index 00000000000..10e589dd727 --- /dev/null +++ b/docs/generated/sqlite-schema/dynamic_credential_entry.md @@ -0,0 +1,85 @@ +# dynamic_credential_entry + +## Description + +
+Table Definition + +```sql +CREATE TABLE "dynamic_credential_entry" ("credential_id" varchar(16) NOT NULL, "subject_id" varchar(2048) NOT NULL, "resolver_id" varchar(16) NOT NULL, "data" text NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_a6d1dd080958304a47a02952aab" FOREIGN KEY ("credential_id") REFERENCES "credentials_entity" ("id") ON DELETE CASCADE, CONSTRAINT "FK_d61a12235d268a49af6a3c09c13" FOREIGN KEY ("resolver_id") REFERENCES "dynamic_credential_resolver" ("id") ON DELETE CASCADE, PRIMARY KEY ("credential_id", "subject_id", "resolver_id")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| credential_id | varchar(16) | | false | | [credentials_entity](credentials_entity.md) | | +| subject_id | varchar(2048) | | false | | | | +| resolver_id | varchar(16) | | false | | [dynamic_credential_resolver](dynamic_credential_resolver.md) | | +| data | TEXT | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| credential_id | PRIMARY KEY | PRIMARY KEY (credential_id) | +| subject_id | PRIMARY KEY | PRIMARY KEY (subject_id) | +| resolver_id | PRIMARY KEY | PRIMARY KEY (resolver_id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (resolver_id) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (credential_id) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_dynamic_credential_entry_1 | PRIMARY KEY | PRIMARY KEY (credential_id, subject_id, resolver_id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_d61a12235d268a49af6a3c09c1 | CREATE INDEX "IDX_d61a12235d268a49af6a3c09c1" ON "dynamic_credential_entry" ("resolver_id") | +| IDX_62476b94b56d9dc7ed9ed75d3d | CREATE INDEX "IDX_62476b94b56d9dc7ed9ed75d3d" ON "dynamic_credential_entry" ("subject_id") | +| sqlite_autoindex_dynamic_credential_entry_1 | PRIMARY KEY (credential_id, subject_id, resolver_id) | + +## Relations + +```mermaid +erDiagram + +"dynamic_credential_entry" |o--|| "credentials_entity" : "FOREIGN KEY (credential_id) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"dynamic_credential_entry" |o--|| "dynamic_credential_resolver" : "FOREIGN KEY (resolver_id) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"dynamic_credential_entry" { + varchar_16_ credential_id PK + varchar_2048_ subject_id PK + varchar_16_ resolver_id PK + TEXT data + datetime_3_ createdAt + datetime_3_ updatedAt +} +"credentials_entity" { + varchar_36_ id PK + varchar_128_ name + TEXT data + varchar_32_ type + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +"dynamic_credential_resolver" { + varchar_16_ id PK + varchar_128_ name + varchar_128_ type + TEXT config + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/dynamic_credential_resolver.md b/docs/generated/sqlite-schema/dynamic_credential_resolver.md new file mode 100644 index 00000000000..1d125aa251e --- /dev/null +++ b/docs/generated/sqlite-schema/dynamic_credential_resolver.md @@ -0,0 +1,89 @@ +# dynamic_credential_resolver + +## Description + +
+Table Definition + +```sql +CREATE TABLE "dynamic_credential_resolver" ("id" varchar(16) PRIMARY KEY NOT NULL, "name" varchar(128) NOT NULL, "type" varchar(128) NOT NULL, "config" text NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW'))) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(16) | | false | [credentials_entity](credentials_entity.md) [dynamic_credential_user_entry](dynamic_credential_user_entry.md) [dynamic_credential_entry](dynamic_credential_entry.md) | | | +| name | varchar(128) | | false | | | | +| type | varchar(128) | | false | | | | +| config | TEXT | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| sqlite_autoindex_dynamic_credential_resolver_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_9c9ee9df586e60bb723234e499 | CREATE INDEX "IDX_9c9ee9df586e60bb723234e499" ON "dynamic_credential_resolver" ("type") | +| sqlite_autoindex_dynamic_credential_resolver_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"credentials_entity" }o--o| "dynamic_credential_resolver" : "FOREIGN KEY (resolverId) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"dynamic_credential_user_entry" |o--|| "dynamic_credential_resolver" : "FOREIGN KEY (resolverId) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"dynamic_credential_entry" |o--|| "dynamic_credential_resolver" : "FOREIGN KEY (resolver_id) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"dynamic_credential_resolver" { + varchar_16_ id PK + varchar_128_ name + varchar_128_ type + TEXT config + datetime_3_ createdAt + datetime_3_ updatedAt +} +"credentials_entity" { + varchar_36_ id PK + varchar_128_ name + TEXT data + varchar_32_ type + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +"dynamic_credential_user_entry" { + varchar_16_ credentialId PK + varchar userId PK + varchar_16_ resolverId PK + TEXT data + datetime_3_ createdAt + datetime_3_ updatedAt +} +"dynamic_credential_entry" { + varchar_16_ credential_id PK + varchar_2048_ subject_id PK + varchar_16_ resolver_id PK + TEXT data + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/dynamic_credential_user_entry.md b/docs/generated/sqlite-schema/dynamic_credential_user_entry.md new file mode 100644 index 00000000000..d5335d03af2 --- /dev/null +++ b/docs/generated/sqlite-schema/dynamic_credential_user_entry.md @@ -0,0 +1,104 @@ +# dynamic_credential_user_entry + +## Description + +
+Table Definition + +```sql +CREATE TABLE "dynamic_credential_user_entry" ("credentialId" varchar(16) NOT NULL, "userId" varchar NOT NULL, "resolverId" varchar(16) NOT NULL, "data" text NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_945ba70b342a066d1306b12ccd2" FOREIGN KEY ("credentialId") REFERENCES "credentials_entity" ("id") ON DELETE CASCADE, CONSTRAINT "FK_6edec973a6450990977bb854c38" FOREIGN KEY ("resolverId") REFERENCES "dynamic_credential_resolver" ("id") ON DELETE CASCADE, CONSTRAINT "FK_a36dc616fabc3f736bb82410a22" FOREIGN KEY ("userId") REFERENCES "user" ("id") ON DELETE CASCADE, PRIMARY KEY ("credentialId", "userId", "resolverId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| credentialId | varchar(16) | | false | | [credentials_entity](credentials_entity.md) | | +| userId | varchar | | false | | [user](user.md) | | +| resolverId | varchar(16) | | false | | [dynamic_credential_resolver](dynamic_credential_resolver.md) | | +| data | TEXT | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| credentialId | PRIMARY KEY | PRIMARY KEY (credentialId) | +| userId | PRIMARY KEY | PRIMARY KEY (userId) | +| resolverId | PRIMARY KEY | PRIMARY KEY (resolverId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (resolverId) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_dynamic_credential_user_entry_1 | PRIMARY KEY | PRIMARY KEY (credentialId, userId, resolverId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_6edec973a6450990977bb854c3 | CREATE INDEX "IDX_6edec973a6450990977bb854c3" ON "dynamic_credential_user_entry" ("resolverId") | +| IDX_a36dc616fabc3f736bb82410a2 | CREATE INDEX "IDX_a36dc616fabc3f736bb82410a2" ON "dynamic_credential_user_entry" ("userId") | +| sqlite_autoindex_dynamic_credential_user_entry_1 | PRIMARY KEY (credentialId, userId, resolverId) | + +## Relations + +```mermaid +erDiagram + +"dynamic_credential_user_entry" |o--|| "credentials_entity" : "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"dynamic_credential_user_entry" |o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"dynamic_credential_user_entry" |o--|| "dynamic_credential_resolver" : "FOREIGN KEY (resolverId) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"dynamic_credential_user_entry" { + varchar_16_ credentialId PK + varchar userId PK + varchar_16_ resolverId PK + TEXT data + datetime_3_ createdAt + datetime_3_ updatedAt +} +"credentials_entity" { + varchar_36_ id PK + varchar_128_ name + TEXT data + varchar_32_ type + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"dynamic_credential_resolver" { + varchar_16_ id PK + varchar_128_ name + varchar_128_ type + TEXT config + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/evaluation_collection.md b/docs/generated/sqlite-schema/evaluation_collection.md new file mode 100644 index 00000000000..aaaf6d2a696 --- /dev/null +++ b/docs/generated/sqlite-schema/evaluation_collection.md @@ -0,0 +1,142 @@ +# evaluation_collection + +## Description + +
+Table Definition + +```sql +CREATE TABLE "evaluation_collection" ("id" varchar(36) PRIMARY KEY NOT NULL, "name" varchar(128) NOT NULL, "description" text, "workflowId" varchar(36) NOT NULL, "evaluationConfigId" varchar(36) NOT NULL, "createdById" varchar, "insightsCache" text, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_a48ce930c3bc7604894b8f0eaad" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE CASCADE, CONSTRAINT "FK_d634a0c93fd7de68a87eab951b2" FOREIGN KEY ("evaluationConfigId") REFERENCES "evaluation_config" ("id") ON DELETE CASCADE, CONSTRAINT "FK_f4561f38b5a22a4f090d5cd3eae" FOREIGN KEY ("createdById") REFERENCES "user" ("id") ON DELETE SET NULL) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [test_run](test_run.md) | | | +| name | varchar(128) | | false | | | | +| description | TEXT | | true | | | | +| workflowId | varchar(36) | | false | | [workflow_entity](workflow_entity.md) | | +| evaluationConfigId | varchar(36) | | false | | [evaluation_config](evaluation_config.md) | | +| createdById | varchar | | true | | [user](user.md) | | +| insightsCache | TEXT | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (createdById) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (evaluationConfigId) REFERENCES evaluation_config (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_evaluation_collection_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_d634a0c93fd7de68a87eab951b | CREATE INDEX "IDX_d634a0c93fd7de68a87eab951b" ON "evaluation_collection" ("evaluationConfigId") | +| IDX_a48ce930c3bc7604894b8f0eaa | CREATE INDEX "IDX_a48ce930c3bc7604894b8f0eaa" ON "evaluation_collection" ("workflowId") | +| sqlite_autoindex_evaluation_collection_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"test_run" }o--o| "evaluation_collection" : "FOREIGN KEY (collectionId) REFERENCES evaluation_collection (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"evaluation_collection" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"evaluation_collection" }o--|| "evaluation_config" : "FOREIGN KEY (evaluationConfigId) REFERENCES evaluation_config (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"evaluation_collection" }o--o| "user" : "FOREIGN KEY (createdById) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + +"evaluation_collection" { + varchar_36_ id PK + varchar_128_ name + TEXT description + varchar_36_ workflowId FK + varchar_36_ evaluationConfigId FK + varchar createdById FK + TEXT insightsCache + datetime_3_ createdAt + datetime_3_ updatedAt +} +"test_run" { + varchar_36_ id PK + varchar_36_ workflowId FK + varchar status + varchar errorCode + TEXT errorDetails + datetime_3_ runAt + datetime_3_ completedAt + TEXT metrics + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_255_ runningInstanceId + boolean cancelRequested + varchar_36_ workflowVersionId + varchar_36_ evaluationConfigId FK + TEXT evaluationConfigSnapshot + varchar_36_ collectionId FK +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +"evaluation_config" { + varchar_36_ id PK + varchar_36_ workflowId FK + varchar_128_ name + varchar_16_ status + varchar_64_ invalidReason + varchar_32_ datasetSource + TEXT datasetRef + varchar_255_ startNodeName + varchar_255_ endNodeName + TEXT metrics + datetime_3_ createdAt + datetime_3_ updatedAt +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/evaluation_config.md b/docs/generated/sqlite-schema/evaluation_config.md new file mode 100644 index 00000000000..9cfbda4ee58 --- /dev/null +++ b/docs/generated/sqlite-schema/evaluation_config.md @@ -0,0 +1,126 @@ +# evaluation_config + +## Description + +
+Table Definition + +```sql +CREATE TABLE "evaluation_config" ("id" varchar(36) PRIMARY KEY NOT NULL, "workflowId" varchar(36) NOT NULL, "name" varchar(128) NOT NULL, "status" varchar(16) NOT NULL DEFAULT ('valid'), "invalidReason" varchar(64), "datasetSource" varchar(32) NOT NULL, "datasetRef" text NOT NULL, "startNodeName" varchar(255) NOT NULL, "endNodeName" varchar(255) NOT NULL, "metrics" text NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "UQ_3c3c99a712e971835c52292e44c" UNIQUE ("workflowId", "name"), CONSTRAINT "FK_fd7542bb123074760285dc1bbf3" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [evaluation_collection](evaluation_collection.md) [test_run](test_run.md) | | | +| workflowId | varchar(36) | | false | | [workflow_entity](workflow_entity.md) | | +| name | varchar(128) | | false | | | | +| status | varchar(16) | 'valid' | false | | | | +| invalidReason | varchar(64) | | true | | | | +| datasetSource | varchar(32) | | false | | | | +| datasetRef | TEXT | | false | | | | +| startNodeName | varchar(255) | | false | | | | +| endNodeName | varchar(255) | | false | | | | +| metrics | TEXT | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_evaluation_config_2 | UNIQUE | UNIQUE (workflowId, name) | +| sqlite_autoindex_evaluation_config_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_fd7542bb123074760285dc1bbf | CREATE INDEX "IDX_fd7542bb123074760285dc1bbf" ON "evaluation_config" ("workflowId") | +| sqlite_autoindex_evaluation_config_2 | UNIQUE (workflowId, name) | +| sqlite_autoindex_evaluation_config_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"evaluation_collection" }o--|| "evaluation_config" : "FOREIGN KEY (evaluationConfigId) REFERENCES evaluation_config (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"test_run" }o--o| "evaluation_config" : "FOREIGN KEY (evaluationConfigId) REFERENCES evaluation_config (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"evaluation_config" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"evaluation_config" { + varchar_36_ id PK + varchar_36_ workflowId FK + varchar_128_ name + varchar_16_ status + varchar_64_ invalidReason + varchar_32_ datasetSource + TEXT datasetRef + varchar_255_ startNodeName + varchar_255_ endNodeName + TEXT metrics + datetime_3_ createdAt + datetime_3_ updatedAt +} +"evaluation_collection" { + varchar_36_ id PK + varchar_128_ name + TEXT description + varchar_36_ workflowId FK + varchar_36_ evaluationConfigId FK + varchar createdById FK + TEXT insightsCache + datetime_3_ createdAt + datetime_3_ updatedAt +} +"test_run" { + varchar_36_ id PK + varchar_36_ workflowId FK + varchar status + varchar errorCode + TEXT errorDetails + datetime_3_ runAt + datetime_3_ completedAt + TEXT metrics + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_255_ runningInstanceId + boolean cancelRequested + varchar_36_ workflowVersionId + varchar_36_ evaluationConfigId FK + TEXT evaluationConfigSnapshot + varchar_36_ collectionId FK +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/event_destinations.md b/docs/generated/sqlite-schema/event_destinations.md new file mode 100644 index 00000000000..6b6534c9a12 --- /dev/null +++ b/docs/generated/sqlite-schema/event_destinations.md @@ -0,0 +1,52 @@ +# event_destinations + +## Description + +
+Table Definition + +```sql +CREATE TABLE "event_destinations" ("id" varchar(36) PRIMARY KEY NOT NULL,"destination" text NOT NULL,"createdAt" datetime(3) NOT NULL DEFAULT 'STRFTIME(''%Y-%m-%d %H:%M:%f'', ''NOW'')',"updatedAt" datetime(3) NOT NULL DEFAULT 'STRFTIME(''%Y-%m-%d %H:%M:%f'', ''NOW'')') +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| destination | TEXT | | false | | | | +| createdAt | datetime(3) | 'STRFTIME(''%Y-%m-%d %H:%M:%f'', ''NOW'')' | false | | | | +| updatedAt | datetime(3) | 'STRFTIME(''%Y-%m-%d %H:%M:%f'', ''NOW'')' | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| sqlite_autoindex_event_destinations_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_event_destinations_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + + +"event_destinations" { + varchar_36_ id PK + TEXT destination + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/execution_annotation_tags.md b/docs/generated/sqlite-schema/execution_annotation_tags.md new file mode 100644 index 00000000000..7bc6524806d --- /dev/null +++ b/docs/generated/sqlite-schema/execution_annotation_tags.md @@ -0,0 +1,69 @@ +# execution_annotation_tags + +## Description + +
+Table Definition + +```sql +CREATE TABLE "execution_annotation_tags" ("annotationId" integer NOT NULL, "tagId" varchar(24) NOT NULL, CONSTRAINT "FK_c1519757391996eb06064f0e7c8" FOREIGN KEY ("annotationId") REFERENCES "execution_annotations" ("id") ON DELETE CASCADE, CONSTRAINT "FK_a3697779b366e131b2bbdae2976" FOREIGN KEY ("tagId") REFERENCES "annotation_tag_entity" ("id") ON DELETE CASCADE, PRIMARY KEY ("annotationId", "tagId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| annotationId | INTEGER | | false | | [execution_annotations](execution_annotations.md) | | +| tagId | varchar(24) | | false | | [annotation_tag_entity](annotation_tag_entity.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| annotationId | PRIMARY KEY | PRIMARY KEY (annotationId) | +| tagId | PRIMARY KEY | PRIMARY KEY (tagId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (tagId) REFERENCES annotation_tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (annotationId) REFERENCES execution_annotations (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_execution_annotation_tags_1 | PRIMARY KEY | PRIMARY KEY (annotationId, tagId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_c1519757391996eb06064f0e7c | CREATE INDEX "IDX_c1519757391996eb06064f0e7c" ON "execution_annotation_tags" ("annotationId") | +| IDX_a3697779b366e131b2bbdae297 | CREATE INDEX "IDX_a3697779b366e131b2bbdae297" ON "execution_annotation_tags" ("tagId") | +| sqlite_autoindex_execution_annotation_tags_1 | PRIMARY KEY (annotationId, tagId) | + +## Relations + +```mermaid +erDiagram + +"execution_annotation_tags" |o--|| "execution_annotations" : "FOREIGN KEY (annotationId) REFERENCES execution_annotations (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"execution_annotation_tags" |o--|| "annotation_tag_entity" : "FOREIGN KEY (tagId) REFERENCES annotation_tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"execution_annotation_tags" { + INTEGER annotationId PK + varchar_24_ tagId PK +} +"execution_annotations" { + INTEGER id + INTEGER executionId FK + varchar_6_ vote + TEXT note + datetime_3_ createdAt + datetime_3_ updatedAt +} +"annotation_tag_entity" { + varchar_16_ id PK + varchar_24_ name + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/execution_annotations.md b/docs/generated/sqlite-schema/execution_annotations.md new file mode 100644 index 00000000000..b8b00961f67 --- /dev/null +++ b/docs/generated/sqlite-schema/execution_annotations.md @@ -0,0 +1,79 @@ +# execution_annotations + +## Description + +
+Table Definition + +```sql +CREATE TABLE "execution_annotations" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "executionId" integer NOT NULL, "vote" varchar(6), "note" text, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_97f863fa83c4786f19565084960" FOREIGN KEY ("executionId") REFERENCES "execution_entity" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | INTEGER | | false | [execution_annotation_tags](execution_annotation_tags.md) | | | +| executionId | INTEGER | | false | | [execution_entity](execution_entity.md) | | +| vote | varchar(6) | | true | | | | +| note | TEXT | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_97f863fa83c4786f1956508496 | CREATE UNIQUE INDEX "IDX_97f863fa83c4786f1956508496" ON "execution_annotations" ("executionId") | + +## Relations + +```mermaid +erDiagram + +"execution_annotation_tags" |o--|| "execution_annotations" : "FOREIGN KEY (annotationId) REFERENCES execution_annotations (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"execution_annotations" }o--|| "execution_entity" : "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"execution_annotations" { + INTEGER id + INTEGER executionId FK + varchar_6_ vote + TEXT note + datetime_3_ createdAt + datetime_3_ updatedAt +} +"execution_annotation_tags" { + INTEGER annotationId PK + varchar_24_ tagId PK +} +"execution_entity" { + INTEGER id + varchar_36_ workflowId FK + boolean finished + varchar mode + varchar retryOf + varchar retrySuccessId + datetime startedAt + datetime stoppedAt + datetime waitTill + varchar status + datetime_3_ deletedAt + datetime_3_ createdAt + varchar_2_ storedAt + TEXT tracingContext + varchar_255_ deduplicationKey +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/execution_data.md b/docs/generated/sqlite-schema/execution_data.md new file mode 100644 index 00000000000..dfb8aaa0c05 --- /dev/null +++ b/docs/generated/sqlite-schema/execution_data.md @@ -0,0 +1,76 @@ +# execution_data + +## Description + +
+Table Definition + +```sql +CREATE TABLE "execution_data" ( + "executionId" int PRIMARY KEY NOT NULL, + "workflowData" text NOT NULL, + "data" text NOT NULL, "workflowVersionId" VARCHAR(36), + FOREIGN KEY("executionId") REFERENCES "execution_entity" ("id") ON DELETE CASCADE + ) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| executionId | INT | | false | | [execution_entity](execution_entity.md) | | +| workflowData | TEXT | | false | | | | +| data | TEXT | | false | | | | +| workflowVersionId | VARCHAR(36) | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| executionId | PRIMARY KEY | PRIMARY KEY (executionId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_execution_data_1 | PRIMARY KEY | PRIMARY KEY (executionId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_execution_data_1 | PRIMARY KEY (executionId) | + +## Relations + +```mermaid +erDiagram + +"execution_data" |o--|| "execution_entity" : "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"execution_data" { + INT executionId PK + TEXT workflowData + TEXT data + VARCHAR_36_ workflowVersionId +} +"execution_entity" { + INTEGER id + varchar_36_ workflowId FK + boolean finished + varchar mode + varchar retryOf + varchar retrySuccessId + datetime startedAt + datetime stoppedAt + datetime waitTill + varchar status + datetime_3_ deletedAt + datetime_3_ createdAt + varchar_2_ storedAt + TEXT tracingContext + varchar_255_ deduplicationKey +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/execution_entity.md b/docs/generated/sqlite-schema/execution_entity.md new file mode 100644 index 00000000000..f9e2aa904d5 --- /dev/null +++ b/docs/generated/sqlite-schema/execution_entity.md @@ -0,0 +1,163 @@ +# execution_entity + +## Description + +
+Table Definition + +```sql +CREATE TABLE "execution_entity" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "workflowId" varchar(36) NOT NULL, "finished" boolean NOT NULL, "mode" varchar NOT NULL, "retryOf" varchar, "retrySuccessId" varchar, "startedAt" datetime, "stoppedAt" datetime, "waitTill" datetime, "status" varchar NOT NULL, "deletedAt" datetime(3), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "storedAt" varchar(2) NOT NULL DEFAULT ('db'), "tracingContext" text, "deduplicationKey" varchar(255), CONSTRAINT "FK_c4d999a5e90784e8caccf5589de" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | INTEGER | | false | [execution_data](execution_data.md) [execution_metadata](execution_metadata.md) [execution_annotations](execution_annotations.md) [test_case_execution](test_case_execution.md) [chat_hub_messages](chat_hub_messages.md) | | | +| workflowId | varchar(36) | | false | | [workflow_entity](workflow_entity.md) | | +| finished | boolean | | false | | | | +| mode | varchar | | false | | | | +| retryOf | varchar | | true | | | | +| retrySuccessId | varchar | | true | | | | +| startedAt | datetime | | true | | | | +| stoppedAt | datetime | | true | | | | +| waitTill | datetime | | true | | | | +| status | varchar | | false | | | | +| deletedAt | datetime(3) | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| storedAt | varchar(2) | 'db' | false | | | | +| tracingContext | TEXT | | true | | | | +| deduplicationKey | varchar(255) | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_execution_entity_deduplicationKey | CREATE UNIQUE INDEX "IDX_execution_entity_deduplicationKey" ON "execution_entity" ("deduplicationKey") WHERE "deduplicationKey" IS NOT NULL | +| IDX_execution_entity_stoppedAt | CREATE INDEX "IDX_execution_entity_stoppedAt" ON "execution_entity" ("stoppedAt") | +| IDX_execution_entity_deletedAt | CREATE INDEX "IDX_execution_entity_deletedAt" ON "execution_entity" ("deletedAt") | + +## Relations + +```mermaid +erDiagram + +"execution_data" |o--|| "execution_entity" : "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"execution_metadata" }o--|| "execution_entity" : "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"execution_annotations" }o--|| "execution_entity" : "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"test_case_execution" }o--o| "execution_entity" : "FOREIGN KEY (pastExecutionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"test_case_execution" }o--o| "execution_entity" : "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"test_case_execution" }o--o| "execution_entity" : "FOREIGN KEY (evaluationExecutionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"chat_hub_messages" }o--o| "execution_entity" : "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"execution_entity" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"execution_entity" { + INTEGER id + varchar_36_ workflowId FK + boolean finished + varchar mode + varchar retryOf + varchar retrySuccessId + datetime startedAt + datetime stoppedAt + datetime waitTill + varchar status + datetime_3_ deletedAt + datetime_3_ createdAt + varchar_2_ storedAt + TEXT tracingContext + varchar_255_ deduplicationKey +} +"execution_data" { + INT executionId PK + TEXT workflowData + TEXT data + VARCHAR_36_ workflowVersionId +} +"execution_metadata" { + INTEGER id + INTEGER executionId FK + varchar_255_ key + TEXT value +} +"execution_annotations" { + INTEGER id + INTEGER executionId FK + varchar_6_ vote + TEXT note + datetime_3_ createdAt + datetime_3_ updatedAt +} +"test_case_execution" { + varchar_36_ id PK + varchar_36_ testRunId FK + INTEGER pastExecutionId FK + INTEGER executionId FK + INTEGER evaluationExecutionId FK + varchar status + datetime_3_ runAt + datetime_3_ completedAt + varchar errorCode + TEXT errorDetails + TEXT metrics + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT inputs + TEXT outputs + INTEGER runIndex +} +"chat_hub_messages" { + varchar id PK + varchar sessionId FK + varchar previousMessageId FK + varchar revisionOfMessageId FK + varchar retryOfMessageId FK + varchar_16_ type + varchar_128_ name + TEXT content + varchar_16_ provider + varchar_36_ workflowId FK + INTEGER executionId FK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ agentId FK + varchar_16_ status + TEXT attachments + VARCHAR_256_ model +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/execution_metadata.md b/docs/generated/sqlite-schema/execution_metadata.md new file mode 100644 index 00000000000..4423cab651e --- /dev/null +++ b/docs/generated/sqlite-schema/execution_metadata.md @@ -0,0 +1,70 @@ +# execution_metadata + +## Description + +
+Table Definition + +```sql +CREATE TABLE "execution_metadata" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "executionId" integer NOT NULL, "key" varchar(255) NOT NULL, "value" text NOT NULL, CONSTRAINT "FK_31d0b4c93fb85ced26f6005cda3" FOREIGN KEY ("executionId") REFERENCES "execution_entity" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | INTEGER | | false | | | | +| executionId | INTEGER | | false | | [execution_entity](execution_entity.md) | | +| key | varchar(255) | | false | | | | +| value | TEXT | | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_cec8eea3bf49551482ccb4933e | CREATE UNIQUE INDEX "IDX_cec8eea3bf49551482ccb4933e" ON "execution_metadata" ("executionId", "key") | + +## Relations + +```mermaid +erDiagram + +"execution_metadata" }o--|| "execution_entity" : "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"execution_metadata" { + INTEGER id + INTEGER executionId FK + varchar_255_ key + TEXT value +} +"execution_entity" { + INTEGER id + varchar_36_ workflowId FK + boolean finished + varchar mode + varchar retryOf + varchar retrySuccessId + datetime startedAt + datetime stoppedAt + datetime waitTill + varchar status + datetime_3_ deletedAt + datetime_3_ createdAt + varchar_2_ storedAt + TEXT tracingContext + varchar_255_ deduplicationKey +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/folder.md b/docs/generated/sqlite-schema/folder.md new file mode 100644 index 00000000000..9bb7ce0335d --- /dev/null +++ b/docs/generated/sqlite-schema/folder.md @@ -0,0 +1,100 @@ +# folder + +## Description + +
+Table Definition + +```sql +CREATE TABLE "folder" ("id" varchar(36) PRIMARY KEY NOT NULL, "name" varchar(128) NOT NULL, "parentFolderId" varchar(36), "projectId" varchar(36) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_a8260b0b36939c6247f385b8221" FOREIGN KEY ("projectId") REFERENCES "project" ("id") ON DELETE CASCADE, CONSTRAINT "FK_804ea52f6729e3940498bd54d78" FOREIGN KEY ("parentFolderId") REFERENCES "folder" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [folder](folder.md) [folder_tag](folder_tag.md) [workflow_entity](workflow_entity.md) | | | +| name | varchar(128) | | false | | | | +| parentFolderId | varchar(36) | | true | | [folder](folder.md) | | +| projectId | varchar(36) | | false | | [project](project.md) | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (parentFolderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_folder_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_14f68deffaf858465715995508 | CREATE UNIQUE INDEX "IDX_14f68deffaf858465715995508" ON "folder" ("projectId", "id") | +| sqlite_autoindex_folder_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"folder" }o--o| "folder" : "FOREIGN KEY (parentFolderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"folder_tag" |o--|| "folder" : "FOREIGN KEY (folderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_entity" }o--o| "folder" : "FOREIGN KEY (parentFolderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"folder" }o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"folder" { + varchar_36_ id PK + varchar_128_ name + varchar_36_ parentFolderId FK + varchar_36_ projectId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"folder_tag" { + varchar_36_ folderId PK + varchar_36_ tagId PK +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +"project" { + varchar_36_ id PK + varchar_255_ name + varchar_36_ type + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + varchar_512_ description + varchar creatorId FK + TEXT customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/folder_tag.md b/docs/generated/sqlite-schema/folder_tag.md new file mode 100644 index 00000000000..4fe8bea43a7 --- /dev/null +++ b/docs/generated/sqlite-schema/folder_tag.md @@ -0,0 +1,67 @@ +# folder_tag + +## Description + +
+Table Definition + +```sql +CREATE TABLE "folder_tag" ("folderId" varchar(36) NOT NULL, "tagId" varchar(36) NOT NULL, CONSTRAINT "FK_94a60854e06f2897b2e0d39edba" FOREIGN KEY ("folderId") REFERENCES "folder" ("id") ON DELETE CASCADE, CONSTRAINT "FK_dc88164176283de80af47621746" FOREIGN KEY ("tagId") REFERENCES "tag_entity" ("id") ON DELETE CASCADE, PRIMARY KEY ("folderId", "tagId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| folderId | varchar(36) | | false | | [folder](folder.md) | | +| tagId | varchar(36) | | false | | [tag_entity](tag_entity.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| folderId | PRIMARY KEY | PRIMARY KEY (folderId) | +| tagId | PRIMARY KEY | PRIMARY KEY (tagId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (tagId) REFERENCES tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (folderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_folder_tag_1 | PRIMARY KEY | PRIMARY KEY (folderId, tagId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_folder_tag_1 | PRIMARY KEY (folderId, tagId) | + +## Relations + +```mermaid +erDiagram + +"folder_tag" |o--|| "folder" : "FOREIGN KEY (folderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"folder_tag" |o--|| "tag_entity" : "FOREIGN KEY (tagId) REFERENCES tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"folder_tag" { + varchar_36_ folderId PK + varchar_36_ tagId PK +} +"folder" { + varchar_36_ id PK + varchar_128_ name + varchar_36_ parentFolderId FK + varchar_36_ projectId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"tag_entity" { + varchar_36_ id PK + varchar_24_ name + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/insights_by_period.md b/docs/generated/sqlite-schema/insights_by_period.md new file mode 100644 index 00000000000..f41b70697c9 --- /dev/null +++ b/docs/generated/sqlite-schema/insights_by_period.md @@ -0,0 +1,64 @@ +# insights_by_period + +## Description + +
+Table Definition + +```sql +CREATE TABLE "insights_by_period" ("id" integer PRIMARY KEY NOT NULL, "metaId" integer NOT NULL, "type" integer NOT NULL, "value" bigint NOT NULL, "periodUnit" integer NOT NULL, "periodStart" datetime(0) DEFAULT (CURRENT_TIMESTAMP), CONSTRAINT "FK_e8881f2214df046dc2740260fe8" FOREIGN KEY ("metaId") REFERENCES "insights_metadata" ("metaId") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | INTEGER | | false | | | | +| metaId | INTEGER | | false | | [insights_metadata](insights_metadata.md) | | +| type | INTEGER | | false | | | | +| value | bigint | | false | | | | +| periodUnit | INTEGER | | false | | | | +| periodStart | datetime(0) | CURRENT_TIMESTAMP | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (metaId) REFERENCES insights_metadata (metaId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_a4da41795da1422f680c723e80 | CREATE UNIQUE INDEX "IDX_a4da41795da1422f680c723e80" ON "insights_by_period" ("periodStart", "type", "periodUnit", "metaId") | + +## Relations + +```mermaid +erDiagram + +"insights_by_period" }o--|| "insights_metadata" : "FOREIGN KEY (metaId) REFERENCES insights_metadata (metaId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"insights_by_period" { + INTEGER id + INTEGER metaId FK + INTEGER type + bigint value + INTEGER periodUnit + datetime_0_ periodStart +} +"insights_metadata" { + INTEGER metaId + varchar_16_ workflowId FK + varchar_36_ projectId FK + varchar_128_ workflowName + varchar_255_ projectName +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/insights_metadata.md b/docs/generated/sqlite-schema/insights_metadata.md new file mode 100644 index 00000000000..2d94340d222 --- /dev/null +++ b/docs/generated/sqlite-schema/insights_metadata.md @@ -0,0 +1,107 @@ +# insights_metadata + +## Description + +
+Table Definition + +```sql +CREATE TABLE "insights_metadata" ("metaId" integer PRIMARY KEY NOT NULL, "workflowId" varchar(16), "projectId" varchar(36), "workflowName" varchar(128) NOT NULL, "projectName" varchar(255) NOT NULL, CONSTRAINT "FK_1d8ab99d5861c9388d2dc1cf733" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE SET NULL, CONSTRAINT "FK_2375a1eda085adb16b24615b69c" FOREIGN KEY ("projectId") REFERENCES "project" ("id") ON DELETE SET NULL) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| metaId | INTEGER | | false | [insights_raw](insights_raw.md) [insights_by_period](insights_by_period.md) | | | +| workflowId | varchar(16) | | true | | [workflow_entity](workflow_entity.md) | | +| projectId | varchar(36) | | true | | [project](project.md) | | +| workflowName | varchar(128) | | false | | | | +| projectName | varchar(255) | | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| metaId | PRIMARY KEY | PRIMARY KEY (metaId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_1d8ab99d5861c9388d2dc1cf73 | CREATE UNIQUE INDEX "IDX_1d8ab99d5861c9388d2dc1cf73" ON "insights_metadata" ("workflowId") | + +## Relations + +```mermaid +erDiagram + +"insights_raw" }o--|| "insights_metadata" : "FOREIGN KEY (metaId) REFERENCES insights_metadata (metaId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"insights_by_period" }o--|| "insights_metadata" : "FOREIGN KEY (metaId) REFERENCES insights_metadata (metaId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"insights_metadata" }o--o| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"insights_metadata" }o--o| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + +"insights_metadata" { + INTEGER metaId + varchar_16_ workflowId FK + varchar_36_ projectId FK + varchar_128_ workflowName + varchar_255_ projectName +} +"insights_raw" { + INTEGER id + INTEGER metaId FK + INTEGER type + bigint value + datetime_0_ timestamp +} +"insights_by_period" { + INTEGER id + INTEGER metaId FK + INTEGER type + bigint value + INTEGER periodUnit + datetime_0_ periodStart +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +"project" { + varchar_36_ id PK + varchar_255_ name + varchar_36_ type + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + varchar_512_ description + varchar creatorId FK + TEXT customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/insights_raw.md b/docs/generated/sqlite-schema/insights_raw.md new file mode 100644 index 00000000000..5e7d4e5b746 --- /dev/null +++ b/docs/generated/sqlite-schema/insights_raw.md @@ -0,0 +1,62 @@ +# insights_raw + +## Description + +
+Table Definition + +```sql +CREATE TABLE "insights_raw" ("id" integer PRIMARY KEY NOT NULL, "metaId" integer NOT NULL, "type" integer NOT NULL, "value" bigint NOT NULL, "timestamp" datetime(0) NOT NULL DEFAULT (CURRENT_TIMESTAMP), CONSTRAINT "FK_d66d942bc9907488832eb0eed81" FOREIGN KEY ("metaId") REFERENCES "insights_metadata" ("metaId") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | INTEGER | | false | | | | +| metaId | INTEGER | | false | | [insights_metadata](insights_metadata.md) | | +| type | INTEGER | | false | | | | +| value | bigint | | false | | | | +| timestamp | datetime(0) | CURRENT_TIMESTAMP | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (metaId) REFERENCES insights_metadata (metaId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_insights_raw_timestamp_id | CREATE INDEX "IDX_insights_raw_timestamp_id" ON "insights_raw" ("timestamp", "id") | + +## Relations + +```mermaid +erDiagram + +"insights_raw" }o--|| "insights_metadata" : "FOREIGN KEY (metaId) REFERENCES insights_metadata (metaId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"insights_raw" { + INTEGER id + INTEGER metaId FK + INTEGER type + bigint value + datetime_0_ timestamp +} +"insights_metadata" { + INTEGER metaId + varchar_16_ workflowId FK + varchar_36_ projectId FK + varchar_128_ workflowName + varchar_255_ projectName +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/installed_nodes.md b/docs/generated/sqlite-schema/installed_nodes.md new file mode 100644 index 00000000000..a96f01520b8 --- /dev/null +++ b/docs/generated/sqlite-schema/installed_nodes.md @@ -0,0 +1,62 @@ +# installed_nodes + +## Description + +
+Table Definition + +```sql +CREATE TABLE "installed_nodes" ("name" char(200) NOT NULL,"type" char(200) NOT NULL,"latestVersion" INTEGER DEFAULT 1,"package" char(214) NOT NULL,PRIMARY KEY("name"),FOREIGN KEY("package") REFERENCES "installed_packages"("packageName") ON DELETE CASCADE ON UPDATE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| name | char(200) | | false | | | | +| type | char(200) | | false | | | | +| latestVersion | INTEGER | 1 | true | | | | +| package | char(214) | | false | | [installed_packages](installed_packages.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| name | PRIMARY KEY | PRIMARY KEY (name) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (package) REFERENCES installed_packages (packageName) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_installed_nodes_1 | PRIMARY KEY | PRIMARY KEY (name) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_installed_nodes_1 | PRIMARY KEY (name) | + +## Relations + +```mermaid +erDiagram + +"installed_nodes" }o--|| "installed_packages" : "FOREIGN KEY (package) REFERENCES installed_packages (packageName) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE" + +"installed_nodes" { + char_200_ name PK + char_200_ type + INTEGER latestVersion + char_214_ package FK +} +"installed_packages" { + char_214_ packageName PK + char_50_ installedVersion + char_70_ authorName + char_70_ authorEmail + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/installed_packages.md b/docs/generated/sqlite-schema/installed_packages.md new file mode 100644 index 00000000000..dacfacf4e52 --- /dev/null +++ b/docs/generated/sqlite-schema/installed_packages.md @@ -0,0 +1,63 @@ +# installed_packages + +## Description + +
+Table Definition + +```sql +CREATE TABLE "installed_packages" ("packageName" char(214) NOT NULL,"installedVersion" char(50) NOT NULL,"authorName" char(70) NULL,"authorEmail" char(70) NULL,"createdAt" datetime(3) NOT NULL DEFAULT 'STRFTIME(''%Y-%m-%d %H:%M:%f'', ''NOW'')',"updatedAt" datetime(3) NOT NULL DEFAULT 'STRFTIME(''%Y-%m-%d %H:%M:%f'', ''NOW'')',PRIMARY KEY("packageName")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| packageName | char(214) | | false | [installed_nodes](installed_nodes.md) | | | +| installedVersion | char(50) | | false | | | | +| authorName | char(70) | | true | | | | +| authorEmail | char(70) | | true | | | | +| createdAt | datetime(3) | 'STRFTIME(''%Y-%m-%d %H:%M:%f'', ''NOW'')' | false | | | | +| updatedAt | datetime(3) | 'STRFTIME(''%Y-%m-%d %H:%M:%f'', ''NOW'')' | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| packageName | PRIMARY KEY | PRIMARY KEY (packageName) | +| sqlite_autoindex_installed_packages_1 | PRIMARY KEY | PRIMARY KEY (packageName) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_installed_packages_1 | PRIMARY KEY (packageName) | + +## Relations + +```mermaid +erDiagram + +"installed_nodes" }o--|| "installed_packages" : "FOREIGN KEY (package) REFERENCES installed_packages (packageName) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE" + +"installed_packages" { + char_214_ packageName PK + char_50_ installedVersion + char_70_ authorName + char_70_ authorEmail + datetime_3_ createdAt + datetime_3_ updatedAt +} +"installed_nodes" { + char_200_ name PK + char_200_ type + INTEGER latestVersion + char_214_ package FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/instance_ai_checkpoints.md b/docs/generated/sqlite-schema/instance_ai_checkpoints.md new file mode 100644 index 00000000000..e3bf39b7a6f --- /dev/null +++ b/docs/generated/sqlite-schema/instance_ai_checkpoints.md @@ -0,0 +1,90 @@ +# instance_ai_checkpoints + +## Description + +
+Table Definition + +```sql +CREATE TABLE "instance_ai_checkpoints" ("key" varchar(255) PRIMARY KEY NOT NULL, "runId" varchar(255), "threadId" varchar NOT NULL, "resourceId" varchar(255), "state" text, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "expiredAt" datetime(3), CONSTRAINT "instance_ai_checkpoints_state_tombstone_check" CHECK (("expiredAt" IS NOT NULL AND "state" IS NULL) OR "expiredAt" IS NULL), CONSTRAINT "FK_2b23f3f24a70bebb990203b011e" FOREIGN KEY ("threadId") REFERENCES "instance_ai_threads" ("id") ON DELETE CASCADE ON UPDATE NO ACTION) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| key | varchar(255) | | false | [instance_ai_pending_confirmations](instance_ai_pending_confirmations.md) | | | +| runId | varchar(255) | | true | | | | +| threadId | varchar | | false | | [instance_ai_threads](instance_ai_threads.md) | | +| resourceId | varchar(255) | | true | | | | +| state | TEXT | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| expiredAt | datetime(3) | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| key | PRIMARY KEY | PRIMARY KEY (key) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_instance_ai_checkpoints_1 | PRIMARY KEY | PRIMARY KEY (key) | +| - | CHECK | CHECK (("expiredAt" IS NOT NULL AND "state" IS NULL) OR "expiredAt" IS NULL) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_be9d0eca0b19fb93d4eb74b327 | CREATE INDEX "IDX_be9d0eca0b19fb93d4eb74b327" ON "instance_ai_checkpoints" ("resourceId") | +| IDX_2b23f3f24a70bebb990203b011 | CREATE INDEX "IDX_2b23f3f24a70bebb990203b011" ON "instance_ai_checkpoints" ("threadId") | +| IDX_768189b506cc26c4fe878b87cb | CREATE INDEX "IDX_768189b506cc26c4fe878b87cb" ON "instance_ai_checkpoints" ("runId") | +| sqlite_autoindex_instance_ai_checkpoints_1 | PRIMARY KEY (key) | + +## Relations + +```mermaid +erDiagram + +"instance_ai_pending_confirmations" }o--o| "instance_ai_checkpoints" : "FOREIGN KEY (checkpointKey) REFERENCES instance_ai_checkpoints (key) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_checkpoints" }o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"instance_ai_checkpoints" { + varchar_255_ key PK + varchar_255_ runId + varchar threadId FK + varchar_255_ resourceId + TEXT state + datetime_3_ createdAt + datetime_3_ updatedAt + datetime_3_ expiredAt +} +"instance_ai_pending_confirmations" { + varchar_36_ requestId PK + varchar threadId FK + varchar userId FK + varchar_16_ kind + varchar_36_ runId + varchar_64_ toolCallId + varchar_36_ messageGroupId + varchar_255_ checkpointKey FK + varchar_36_ checkpointTaskId + datetime_3_ expiresAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_threads" { + varchar id PK + varchar_255_ resourceId + varchar_36_ projectId FK + TEXT title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/instance_ai_iteration_logs.md b/docs/generated/sqlite-schema/instance_ai_iteration_logs.md new file mode 100644 index 00000000000..7145b496bdd --- /dev/null +++ b/docs/generated/sqlite-schema/instance_ai_iteration_logs.md @@ -0,0 +1,68 @@ +# instance_ai_iteration_logs + +## Description + +
+Table Definition + +```sql +CREATE TABLE "instance_ai_iteration_logs" ("id" varchar(36) PRIMARY KEY NOT NULL, "threadId" varchar NOT NULL, "taskKey" varchar NOT NULL, "entry" text NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_8bfcc6c51fd3d69b1eae8aebd49" FOREIGN KEY ("threadId") REFERENCES "instance_ai_threads" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| threadId | varchar | | false | | [instance_ai_threads](instance_ai_threads.md) | | +| taskKey | varchar | | false | | | | +| entry | TEXT | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_instance_ai_iteration_logs_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_02751202c9a2ad75f2d8e14f5e | CREATE INDEX "IDX_02751202c9a2ad75f2d8e14f5e" ON "instance_ai_iteration_logs" ("threadId", "taskKey", "createdAt") | +| sqlite_autoindex_instance_ai_iteration_logs_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"instance_ai_iteration_logs" }o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"instance_ai_iteration_logs" { + varchar_36_ id PK + varchar threadId FK + varchar taskKey + TEXT entry + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_threads" { + varchar id PK + varchar_255_ resourceId + varchar_36_ projectId FK + TEXT title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/instance_ai_mcp_registry_connections.md b/docs/generated/sqlite-schema/instance_ai_mcp_registry_connections.md new file mode 100644 index 00000000000..7baa46ec5bf --- /dev/null +++ b/docs/generated/sqlite-schema/instance_ai_mcp_registry_connections.md @@ -0,0 +1,104 @@ +# instance_ai_mcp_registry_connections + +## Description + +
+Table Definition + +```sql +CREATE TABLE "instance_ai_mcp_registry_connections" ("id" varchar PRIMARY KEY NOT NULL, "credentialId" varchar(36) NOT NULL, "serverSlug" varchar(255) NOT NULL, "toolFilter" text, "userId" varchar NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_1e826120e7e53ebc4681f026de8" FOREIGN KEY ("credentialId") REFERENCES "credentials_entity" ("id") ON DELETE CASCADE, CONSTRAINT "FK_1d25707354d2012da256eb2ec0a" FOREIGN KEY ("serverSlug") REFERENCES "mcp_registry_server" ("slug") ON DELETE CASCADE, CONSTRAINT "FK_8b42c08a531d76410980c639a5b" FOREIGN KEY ("userId") REFERENCES "user" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar | | false | | | | +| credentialId | varchar(36) | | false | | [credentials_entity](credentials_entity.md) | | +| serverSlug | varchar(255) | | false | | [mcp_registry_server](mcp_registry_server.md) | | +| toolFilter | TEXT | | true | | | | +| userId | varchar | | false | | [user](user.md) | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (serverSlug) REFERENCES mcp_registry_server (slug) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_instance_ai_mcp_registry_connections_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_16db3adb7b19df1ee55ff06b27 | CREATE UNIQUE INDEX "IDX_16db3adb7b19df1ee55ff06b27" ON "instance_ai_mcp_registry_connections" ("userId", "serverSlug", "credentialId") | +| sqlite_autoindex_instance_ai_mcp_registry_connections_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"instance_ai_mcp_registry_connections" }o--|| "credentials_entity" : "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_mcp_registry_connections" }o--|| "mcp_registry_server" : "FOREIGN KEY (serverSlug) REFERENCES mcp_registry_server (slug) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_mcp_registry_connections" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"instance_ai_mcp_registry_connections" { + varchar id PK + varchar_36_ credentialId FK + varchar_255_ serverSlug FK + TEXT toolFilter + varchar userId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"credentials_entity" { + varchar_36_ id PK + varchar_128_ name + TEXT data + varchar_32_ type + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +"mcp_registry_server" { + varchar_255_ slug PK + varchar_50_ status + varchar_50_ version + datetime_3_ registryUpdatedAt + TEXT data + datetime_3_ createdAt + datetime_3_ updatedAt +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/instance_ai_messages.md b/docs/generated/sqlite-schema/instance_ai_messages.md new file mode 100644 index 00000000000..f40df2ec079 --- /dev/null +++ b/docs/generated/sqlite-schema/instance_ai_messages.md @@ -0,0 +1,73 @@ +# instance_ai_messages + +## Description + +
+Table Definition + +```sql +CREATE TABLE "instance_ai_messages" ("id" varchar(36) PRIMARY KEY NOT NULL, "threadId" varchar NOT NULL, "content" text NOT NULL, "role" varchar(16) NOT NULL, "type" varchar(32), "resourceId" varchar(255), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_1eeb64cb9d66a927988de759e6e" FOREIGN KEY ("threadId") REFERENCES "instance_ai_threads" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| threadId | varchar | | false | | [instance_ai_threads](instance_ai_threads.md) | | +| content | TEXT | | false | | | | +| role | varchar(16) | | false | | | | +| type | varchar(32) | | true | | | | +| resourceId | varchar(255) | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_instance_ai_messages_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_76e212c6867fbaa06bf0decd6f | CREATE INDEX "IDX_76e212c6867fbaa06bf0decd6f" ON "instance_ai_messages" ("resourceId") | +| IDX_1eeb64cb9d66a927988de759e6 | CREATE INDEX "IDX_1eeb64cb9d66a927988de759e6" ON "instance_ai_messages" ("threadId") | +| sqlite_autoindex_instance_ai_messages_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"instance_ai_messages" }o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"instance_ai_messages" { + varchar_36_ id PK + varchar threadId FK + TEXT content + varchar_16_ role + varchar_32_ type + varchar_255_ resourceId + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_threads" { + varchar id PK + varchar_255_ resourceId + varchar_36_ projectId FK + TEXT title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/instance_ai_observation_cursors.md b/docs/generated/sqlite-schema/instance_ai_observation_cursors.md new file mode 100644 index 00000000000..c092509f5c7 --- /dev/null +++ b/docs/generated/sqlite-schema/instance_ai_observation_cursors.md @@ -0,0 +1,65 @@ +# instance_ai_observation_cursors + +## Description + +
+Table Definition + +```sql +CREATE TABLE "instance_ai_observation_cursors" ("observationScopeId" varchar PRIMARY KEY NOT NULL, "lastObservedMessageId" varchar(36) NOT NULL, "lastObservedAt" datetime(3) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_5b6319b2e9a37c1064a72428f9a" FOREIGN KEY ("observationScopeId") REFERENCES "instance_ai_threads" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| observationScopeId | varchar | | false | | [instance_ai_threads](instance_ai_threads.md) | | +| lastObservedMessageId | varchar(36) | | false | | | | +| lastObservedAt | datetime(3) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| observationScopeId | PRIMARY KEY | PRIMARY KEY (observationScopeId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_instance_ai_observation_cursors_1 | PRIMARY KEY | PRIMARY KEY (observationScopeId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_instance_ai_observation_cursors_1 | PRIMARY KEY (observationScopeId) | + +## Relations + +```mermaid +erDiagram + +"instance_ai_observation_cursors" |o--|| "instance_ai_threads" : "FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"instance_ai_observation_cursors" { + varchar observationScopeId PK + varchar_36_ lastObservedMessageId + datetime_3_ lastObservedAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_threads" { + varchar id PK + varchar_255_ resourceId + varchar_36_ projectId FK + TEXT title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/instance_ai_observation_locks.md b/docs/generated/sqlite-schema/instance_ai_observation_locks.md new file mode 100644 index 00000000000..6eb62c3b343 --- /dev/null +++ b/docs/generated/sqlite-schema/instance_ai_observation_locks.md @@ -0,0 +1,69 @@ +# instance_ai_observation_locks + +## Description + +
+Table Definition + +```sql +CREATE TABLE "instance_ai_observation_locks" ("observationScopeId" varchar NOT NULL, "taskKind" varchar(20) NOT NULL, "holderId" varchar(64) NOT NULL, "heldUntil" datetime(3) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "CHK_instance_ai_observation_locks_taskKind" CHECK ("taskKind" IN ('observer', 'reflector')), CONSTRAINT "FK_103e2e5f454860b28ea05a82c74" FOREIGN KEY ("observationScopeId") REFERENCES "instance_ai_threads" ("id") ON DELETE CASCADE, PRIMARY KEY ("observationScopeId", "taskKind")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| observationScopeId | varchar | | false | | [instance_ai_threads](instance_ai_threads.md) | | +| taskKind | varchar(20) | | false | | | | +| holderId | varchar(64) | | false | | | | +| heldUntil | datetime(3) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| observationScopeId | PRIMARY KEY | PRIMARY KEY (observationScopeId) | +| taskKind | PRIMARY KEY | PRIMARY KEY (taskKind) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_instance_ai_observation_locks_1 | PRIMARY KEY | PRIMARY KEY (observationScopeId, taskKind) | +| - | CHECK | CHECK ("taskKind" IN ('observer', 'reflector')) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_instance_ai_observation_locks_1 | PRIMARY KEY (observationScopeId, taskKind) | + +## Relations + +```mermaid +erDiagram + +"instance_ai_observation_locks" |o--|| "instance_ai_threads" : "FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"instance_ai_observation_locks" { + varchar observationScopeId PK + varchar_20_ taskKind PK + varchar_64_ holderId + datetime_3_ heldUntil + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_threads" { + varchar id PK + varchar_255_ resourceId + varchar_36_ projectId FK + TEXT title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/instance_ai_observational_memory.md b/docs/generated/sqlite-schema/instance_ai_observational_memory.md new file mode 100644 index 00000000000..b1a75dd6066 --- /dev/null +++ b/docs/generated/sqlite-schema/instance_ai_observational_memory.md @@ -0,0 +1,121 @@ +# instance_ai_observational_memory + +## Description + +
+Table Definition + +```sql +CREATE TABLE "instance_ai_observational_memory" ("id" varchar(36) PRIMARY KEY NOT NULL, "lookupKey" varchar(255) NOT NULL, "scope" varchar(16) NOT NULL, "threadId" varchar, "resourceId" varchar(255) NOT NULL, "activeObservations" text NOT NULL DEFAULT (''), "originType" varchar(32) NOT NULL, "config" text NOT NULL, "generationCount" integer NOT NULL DEFAULT (0), "lastObservedAt" datetime(3), "pendingMessageTokens" integer NOT NULL DEFAULT (0), "totalTokensObserved" integer NOT NULL DEFAULT (0), "observationTokenCount" integer NOT NULL DEFAULT (0), "isObserving" boolean NOT NULL DEFAULT (false), "isReflecting" boolean NOT NULL DEFAULT (false), "observedMessageIds" text, "observedTimezone" varchar, "bufferedObservations" text, "bufferedObservationTokens" integer, "bufferedMessageIds" text, "bufferedReflection" text, "bufferedReflectionTokens" integer, "bufferedReflectionInputTokens" integer, "reflectedObservationLineCount" integer, "bufferedObservationChunks" text, "isBufferingObservation" boolean NOT NULL DEFAULT (false), "isBufferingReflection" boolean NOT NULL DEFAULT (false), "lastBufferedAtTokens" integer NOT NULL DEFAULT (0), "lastBufferedAtTime" datetime(3), "metadata" text, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_34018c303885cd37093458e6409" FOREIGN KEY ("threadId") REFERENCES "instance_ai_threads" ("id") ON DELETE SET NULL) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| lookupKey | varchar(255) | | false | | | | +| scope | varchar(16) | | false | | | | +| threadId | varchar | | true | | [instance_ai_threads](instance_ai_threads.md) | | +| resourceId | varchar(255) | | false | | | | +| activeObservations | TEXT | '' | false | | | | +| originType | varchar(32) | | false | | | | +| config | TEXT | | false | | | | +| generationCount | INTEGER | 0 | false | | | | +| lastObservedAt | datetime(3) | | true | | | | +| pendingMessageTokens | INTEGER | 0 | false | | | | +| totalTokensObserved | INTEGER | 0 | false | | | | +| observationTokenCount | INTEGER | 0 | false | | | | +| isObserving | boolean | false | false | | | | +| isReflecting | boolean | false | false | | | | +| observedMessageIds | TEXT | | true | | | | +| observedTimezone | varchar | | true | | | | +| bufferedObservations | TEXT | | true | | | | +| bufferedObservationTokens | INTEGER | | true | | | | +| bufferedMessageIds | TEXT | | true | | | | +| bufferedReflection | TEXT | | true | | | | +| bufferedReflectionTokens | INTEGER | | true | | | | +| bufferedReflectionInputTokens | INTEGER | | true | | | | +| reflectedObservationLineCount | INTEGER | | true | | | | +| bufferedObservationChunks | TEXT | | true | | | | +| isBufferingObservation | boolean | false | false | | | | +| isBufferingReflection | boolean | false | false | | | | +| lastBufferedAtTokens | INTEGER | 0 | false | | | | +| lastBufferedAtTime | datetime(3) | | true | | | | +| metadata | TEXT | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| sqlite_autoindex_instance_ai_observational_memory_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_a680ac96aae02dc887bbaac512 | CREATE UNIQUE INDEX "IDX_a680ac96aae02dc887bbaac512" ON "instance_ai_observational_memory" ("scope", "threadId", "resourceId") | +| IDX_92f13cb6bc694227e069447f7b | CREATE INDEX "IDX_92f13cb6bc694227e069447f7b" ON "instance_ai_observational_memory" ("lookupKey") | +| sqlite_autoindex_instance_ai_observational_memory_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"instance_ai_observational_memory" }o--o| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + +"instance_ai_observational_memory" { + varchar_36_ id PK + varchar_255_ lookupKey + varchar_16_ scope + varchar threadId FK + varchar_255_ resourceId + TEXT activeObservations + varchar_32_ originType + TEXT config + INTEGER generationCount + datetime_3_ lastObservedAt + INTEGER pendingMessageTokens + INTEGER totalTokensObserved + INTEGER observationTokenCount + boolean isObserving + boolean isReflecting + TEXT observedMessageIds + varchar observedTimezone + TEXT bufferedObservations + INTEGER bufferedObservationTokens + TEXT bufferedMessageIds + TEXT bufferedReflection + INTEGER bufferedReflectionTokens + INTEGER bufferedReflectionInputTokens + INTEGER reflectedObservationLineCount + TEXT bufferedObservationChunks + boolean isBufferingObservation + boolean isBufferingReflection + INTEGER lastBufferedAtTokens + datetime_3_ lastBufferedAtTime + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_threads" { + varchar id PK + varchar_255_ resourceId + varchar_36_ projectId FK + TEXT title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/instance_ai_observations.md b/docs/generated/sqlite-schema/instance_ai_observations.md new file mode 100644 index 00000000000..1c8bc4315f2 --- /dev/null +++ b/docs/generated/sqlite-schema/instance_ai_observations.md @@ -0,0 +1,84 @@ +# instance_ai_observations + +## Description + +
+Table Definition + +```sql +CREATE TABLE "instance_ai_observations" ("id" varchar(36) PRIMARY KEY NOT NULL, "observationScopeId" varchar NOT NULL, "marker" varchar(16) NOT NULL, "text" text NOT NULL, "parentId" varchar(36), "tokenCount" integer NOT NULL DEFAULT (0), "status" varchar(16) NOT NULL, "supersededBy" varchar(36), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "CHK_instance_ai_observations_marker" CHECK ("marker" IN ('critical', 'important', 'info', 'completion')), CONSTRAINT "CHK_instance_ai_observations_status" CHECK ("status" IN ('active', 'superseded', 'dropped')), CONSTRAINT "FK_d54fc84a6c8ac91b5e0db0378a4" FOREIGN KEY ("observationScopeId") REFERENCES "instance_ai_threads" ("id") ON DELETE CASCADE, CONSTRAINT "FK_daef2195a4a846eb70eed15e039" FOREIGN KEY ("parentId") REFERENCES "instance_ai_observations" ("id"), CONSTRAINT "FK_a80e0ee839a2f10ba4b86e19998" FOREIGN KEY ("supersededBy") REFERENCES "instance_ai_observations" ("id")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [instance_ai_observations](instance_ai_observations.md) | | | +| observationScopeId | varchar | | false | | [instance_ai_threads](instance_ai_threads.md) | | +| marker | varchar(16) | | false | | | | +| text | TEXT | | false | | | | +| parentId | varchar(36) | | true | | [instance_ai_observations](instance_ai_observations.md) | | +| tokenCount | INTEGER | 0 | false | | | | +| status | varchar(16) | | false | | | | +| supersededBy | varchar(36) | | true | | [instance_ai_observations](instance_ai_observations.md) | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (supersededBy) REFERENCES instance_ai_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (parentId) REFERENCES instance_ai_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE | +| - (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_instance_ai_observations_1 | PRIMARY KEY | PRIMARY KEY (id) | +| - | CHECK | CHECK ("marker" IN ('critical', 'important', 'info', 'completion')) | +| - | CHECK | CHECK ("status" IN ('active', 'superseded', 'dropped')) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_a80e0ee839a2f10ba4b86e1999 | CREATE INDEX "IDX_a80e0ee839a2f10ba4b86e1999" ON "instance_ai_observations" ("supersededBy") | +| IDX_daef2195a4a846eb70eed15e03 | CREATE INDEX "IDX_daef2195a4a846eb70eed15e03" ON "instance_ai_observations" ("parentId") | +| IDX_0d5db648188d338df7fb2a8064 | CREATE INDEX "IDX_0d5db648188d338df7fb2a8064" ON "instance_ai_observations" ("observationScopeId", "status", "createdAt", "id") | +| sqlite_autoindex_instance_ai_observations_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"instance_ai_observations" }o--o| "instance_ai_observations" : "FOREIGN KEY (supersededBy) REFERENCES instance_ai_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" +"instance_ai_observations" }o--o| "instance_ai_observations" : "FOREIGN KEY (parentId) REFERENCES instance_ai_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" +"instance_ai_observations" }o--|| "instance_ai_threads" : "FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"instance_ai_observations" { + varchar_36_ id PK + varchar observationScopeId FK + varchar_16_ marker + TEXT text + varchar_36_ parentId FK + INTEGER tokenCount + varchar_16_ status + varchar_36_ supersededBy FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_threads" { + varchar id PK + varchar_255_ resourceId + varchar_36_ projectId FK + TEXT title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/instance_ai_pending_confirmations.md b/docs/generated/sqlite-schema/instance_ai_pending_confirmations.md new file mode 100644 index 00000000000..ace96eac86c --- /dev/null +++ b/docs/generated/sqlite-schema/instance_ai_pending_confirmations.md @@ -0,0 +1,115 @@ +# instance_ai_pending_confirmations + +## Description + +
+Table Definition + +```sql +CREATE TABLE "instance_ai_pending_confirmations" ("requestId" varchar(36) PRIMARY KEY NOT NULL, "threadId" varchar NOT NULL, "userId" varchar NOT NULL, "kind" varchar(16) NOT NULL, "runId" varchar(36) NOT NULL, "toolCallId" varchar(64), "messageGroupId" varchar(36), "checkpointKey" varchar(255), "checkpointTaskId" varchar(36), "expiresAt" datetime(3), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "CHK_instance_ai_pending_confirmations_kind" CHECK ("kind" IN ('suspended', 'inline')), CONSTRAINT "FK_ba67ee8dc311830a2eea89b6e96" FOREIGN KEY ("threadId") REFERENCES "instance_ai_threads" ("id") ON DELETE CASCADE, CONSTRAINT "FK_df5fd25c8bbfd2b042602600d8e" FOREIGN KEY ("userId") REFERENCES "user" ("id") ON DELETE CASCADE, CONSTRAINT "FK_0babdf6e3b897a86fe4678355eb" FOREIGN KEY ("checkpointKey") REFERENCES "instance_ai_checkpoints" ("key") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| requestId | varchar(36) | | false | | | | +| threadId | varchar | | false | | [instance_ai_threads](instance_ai_threads.md) | | +| userId | varchar | | false | | [user](user.md) | | +| kind | varchar(16) | | false | | | | +| runId | varchar(36) | | false | | | | +| toolCallId | varchar(64) | | true | | | | +| messageGroupId | varchar(36) | | true | | | | +| checkpointKey | varchar(255) | | true | | [instance_ai_checkpoints](instance_ai_checkpoints.md) | | +| checkpointTaskId | varchar(36) | | true | | | | +| expiresAt | datetime(3) | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| requestId | PRIMARY KEY | PRIMARY KEY (requestId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (checkpointKey) REFERENCES instance_ai_checkpoints (key) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_instance_ai_pending_confirmations_1 | PRIMARY KEY | PRIMARY KEY (requestId) | +| - | CHECK | CHECK ("kind" IN ('suspended', 'inline')) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_d7a4aba7440449865e2b924377 | CREATE INDEX "IDX_d7a4aba7440449865e2b924377" ON "instance_ai_pending_confirmations" ("expiresAt") | +| IDX_0babdf6e3b897a86fe4678355e | CREATE INDEX "IDX_0babdf6e3b897a86fe4678355e" ON "instance_ai_pending_confirmations" ("checkpointKey") | +| IDX_df5fd25c8bbfd2b042602600d8 | CREATE INDEX "IDX_df5fd25c8bbfd2b042602600d8" ON "instance_ai_pending_confirmations" ("userId") | +| IDX_ba67ee8dc311830a2eea89b6e9 | CREATE INDEX "IDX_ba67ee8dc311830a2eea89b6e9" ON "instance_ai_pending_confirmations" ("threadId") | +| sqlite_autoindex_instance_ai_pending_confirmations_1 | PRIMARY KEY (requestId) | + +## Relations + +```mermaid +erDiagram + +"instance_ai_pending_confirmations" }o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_pending_confirmations" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_pending_confirmations" }o--o| "instance_ai_checkpoints" : "FOREIGN KEY (checkpointKey) REFERENCES instance_ai_checkpoints (key) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"instance_ai_pending_confirmations" { + varchar_36_ requestId PK + varchar threadId FK + varchar userId FK + varchar_16_ kind + varchar_36_ runId + varchar_64_ toolCallId + varchar_36_ messageGroupId + varchar_255_ checkpointKey FK + varchar_36_ checkpointTaskId + datetime_3_ expiresAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_threads" { + varchar id PK + varchar_255_ resourceId + varchar_36_ projectId FK + TEXT title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"instance_ai_checkpoints" { + varchar_255_ key PK + varchar_255_ runId + varchar threadId FK + varchar_255_ resourceId + TEXT state + datetime_3_ createdAt + datetime_3_ updatedAt + datetime_3_ expiredAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/instance_ai_resources.md b/docs/generated/sqlite-schema/instance_ai_resources.md new file mode 100644 index 00000000000..7a953639fd2 --- /dev/null +++ b/docs/generated/sqlite-schema/instance_ai_resources.md @@ -0,0 +1,54 @@ +# instance_ai_resources + +## Description + +
+Table Definition + +```sql +CREATE TABLE "instance_ai_resources" ("id" varchar(255) PRIMARY KEY NOT NULL, "workingMemory" text, "metadata" text, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW'))) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(255) | | false | | | | +| workingMemory | TEXT | | true | | | | +| metadata | TEXT | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| sqlite_autoindex_instance_ai_resources_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_instance_ai_resources_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + + +"instance_ai_resources" { + varchar_255_ id PK + TEXT workingMemory + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/instance_ai_run_snapshots.md b/docs/generated/sqlite-schema/instance_ai_run_snapshots.md new file mode 100644 index 00000000000..e0c8629c39f --- /dev/null +++ b/docs/generated/sqlite-schema/instance_ai_run_snapshots.md @@ -0,0 +1,80 @@ +# instance_ai_run_snapshots + +## Description + +
+Table Definition + +```sql +CREATE TABLE "instance_ai_run_snapshots" ("threadId" varchar NOT NULL, "runId" varchar(36) NOT NULL, "messageGroupId" varchar(36), "runIds" text, "tree" text NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "langsmithRunId" varchar(36), "langsmithTraceId" varchar(36), "traceId" varchar(64), "spanId" varchar(64), CONSTRAINT "FK_2f63fa21d09d7918f347ddbdf70" FOREIGN KEY ("threadId") REFERENCES "instance_ai_threads" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, PRIMARY KEY ("threadId", "runId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| threadId | varchar | | false | | [instance_ai_threads](instance_ai_threads.md) | | +| runId | varchar(36) | | false | | | | +| messageGroupId | varchar(36) | | true | | | | +| runIds | TEXT | | true | | | | +| tree | TEXT | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| langsmithRunId | varchar(36) | | true | | | | +| langsmithTraceId | varchar(36) | | true | | | | +| traceId | varchar(64) | | true | | | | +| spanId | varchar(64) | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| threadId | PRIMARY KEY | PRIMARY KEY (threadId) | +| runId | PRIMARY KEY | PRIMARY KEY (runId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_instance_ai_run_snapshots_1 | PRIMARY KEY | PRIMARY KEY (threadId, runId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_d3a2bc880e7a8626802e5474ad | CREATE INDEX "IDX_d3a2bc880e7a8626802e5474ad" ON "instance_ai_run_snapshots" ("threadId", "createdAt") | +| IDX_d926c16c2ad9728cb9a81790c0 | CREATE INDEX "IDX_d926c16c2ad9728cb9a81790c0" ON "instance_ai_run_snapshots" ("threadId", "messageGroupId") | +| sqlite_autoindex_instance_ai_run_snapshots_1 | PRIMARY KEY (threadId, runId) | + +## Relations + +```mermaid +erDiagram + +"instance_ai_run_snapshots" |o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"instance_ai_run_snapshots" { + varchar threadId PK + varchar_36_ runId PK + varchar_36_ messageGroupId + TEXT runIds + TEXT tree + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ langsmithRunId + varchar_36_ langsmithTraceId + varchar_64_ traceId + varchar_64_ spanId +} +"instance_ai_threads" { + varchar id PK + varchar_255_ resourceId + varchar_36_ projectId FK + TEXT title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/instance_ai_threads.md b/docs/generated/sqlite-schema/instance_ai_threads.md new file mode 100644 index 00000000000..7cb48c22c3f --- /dev/null +++ b/docs/generated/sqlite-schema/instance_ai_threads.md @@ -0,0 +1,205 @@ +# instance_ai_threads + +## Description + +
+Table Definition + +```sql +CREATE TABLE "instance_ai_threads" ("id" varchar PRIMARY KEY NOT NULL, "resourceId" varchar(255) NOT NULL, "projectId" varchar(36) NOT NULL, "title" text NOT NULL DEFAULT (''), "metadata" text, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_instance_ai_threads_projectId" FOREIGN KEY ("projectId") REFERENCES "project" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar | | false | [instance_ai_messages](instance_ai_messages.md) [instance_ai_observational_memory](instance_ai_observational_memory.md) [instance_ai_iteration_logs](instance_ai_iteration_logs.md) [ai_builder_temporary_workflow](ai_builder_temporary_workflow.md) [instance_ai_run_snapshots](instance_ai_run_snapshots.md) [instance_ai_observations](instance_ai_observations.md) [instance_ai_observation_cursors](instance_ai_observation_cursors.md) [instance_ai_observation_locks](instance_ai_observation_locks.md) [instance_ai_checkpoints](instance_ai_checkpoints.md) [instance_ai_pending_confirmations](instance_ai_pending_confirmations.md) | | | +| resourceId | varchar(255) | | false | | | | +| projectId | varchar(36) | | false | | [project](project.md) | | +| title | TEXT | '' | false | | | | +| metadata | TEXT | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_instance_ai_threads_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_instance_ai_threads_projectId | CREATE INDEX "IDX_instance_ai_threads_projectId" ON "instance_ai_threads" ("projectId") | +| IDX_instance_ai_threads_resourceId | CREATE INDEX "IDX_instance_ai_threads_resourceId" ON "instance_ai_threads" ("resourceId") | +| sqlite_autoindex_instance_ai_threads_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"instance_ai_messages" }o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_observational_memory" }o--o| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"instance_ai_iteration_logs" }o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"ai_builder_temporary_workflow" }o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_run_snapshots" |o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_observations" }o--|| "instance_ai_threads" : "FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_observation_cursors" |o--|| "instance_ai_threads" : "FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_observation_locks" |o--|| "instance_ai_threads" : "FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_checkpoints" }o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_pending_confirmations" }o--|| "instance_ai_threads" : "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_threads" }o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"instance_ai_threads" { + varchar id PK + varchar_255_ resourceId + varchar_36_ projectId FK + TEXT title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_messages" { + varchar_36_ id PK + varchar threadId FK + TEXT content + varchar_16_ role + varchar_32_ type + varchar_255_ resourceId + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_observational_memory" { + varchar_36_ id PK + varchar_255_ lookupKey + varchar_16_ scope + varchar threadId FK + varchar_255_ resourceId + TEXT activeObservations + varchar_32_ originType + TEXT config + INTEGER generationCount + datetime_3_ lastObservedAt + INTEGER pendingMessageTokens + INTEGER totalTokensObserved + INTEGER observationTokenCount + boolean isObserving + boolean isReflecting + TEXT observedMessageIds + varchar observedTimezone + TEXT bufferedObservations + INTEGER bufferedObservationTokens + TEXT bufferedMessageIds + TEXT bufferedReflection + INTEGER bufferedReflectionTokens + INTEGER bufferedReflectionInputTokens + INTEGER reflectedObservationLineCount + TEXT bufferedObservationChunks + boolean isBufferingObservation + boolean isBufferingReflection + INTEGER lastBufferedAtTokens + datetime_3_ lastBufferedAtTime + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_iteration_logs" { + varchar_36_ id PK + varchar threadId FK + varchar taskKey + TEXT entry + datetime_3_ createdAt + datetime_3_ updatedAt +} +"ai_builder_temporary_workflow" { + varchar_36_ workflowId PK + varchar threadId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_run_snapshots" { + varchar threadId PK + varchar_36_ runId PK + varchar_36_ messageGroupId + TEXT runIds + TEXT tree + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ langsmithRunId + varchar_36_ langsmithTraceId + varchar_64_ traceId + varchar_64_ spanId +} +"instance_ai_observations" { + varchar_36_ id PK + varchar observationScopeId FK + varchar_16_ marker + TEXT text + varchar_36_ parentId FK + INTEGER tokenCount + varchar_16_ status + varchar_36_ supersededBy FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_observation_cursors" { + varchar observationScopeId PK + varchar_36_ lastObservedMessageId + datetime_3_ lastObservedAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_observation_locks" { + varchar observationScopeId PK + varchar_20_ taskKind PK + varchar_64_ holderId + datetime_3_ heldUntil + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_checkpoints" { + varchar_255_ key PK + varchar_255_ runId + varchar threadId FK + varchar_255_ resourceId + TEXT state + datetime_3_ createdAt + datetime_3_ updatedAt + datetime_3_ expiredAt +} +"instance_ai_pending_confirmations" { + varchar_36_ requestId PK + varchar threadId FK + varchar userId FK + varchar_16_ kind + varchar_36_ runId + varchar_64_ toolCallId + varchar_36_ messageGroupId + varchar_255_ checkpointKey FK + varchar_36_ checkpointTaskId + datetime_3_ expiresAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"project" { + varchar_36_ id PK + varchar_255_ name + varchar_36_ type + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + varchar_512_ description + varchar creatorId FK + TEXT customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/instance_ai_workflow_snapshots.md b/docs/generated/sqlite-schema/instance_ai_workflow_snapshots.md new file mode 100644 index 00000000000..830cdb8046b --- /dev/null +++ b/docs/generated/sqlite-schema/instance_ai_workflow_snapshots.md @@ -0,0 +1,60 @@ +# instance_ai_workflow_snapshots + +## Description + +
+Table Definition + +```sql +CREATE TABLE "instance_ai_workflow_snapshots" ("runId" varchar(36) NOT NULL, "workflowName" varchar(255) NOT NULL, "resourceId" varchar(255), "status" varchar, "snapshot" text NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), PRIMARY KEY ("runId", "workflowName")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| runId | varchar(36) | | false | | | | +| workflowName | varchar(255) | | false | | | | +| resourceId | varchar(255) | | true | | | | +| status | varchar | | true | | | | +| snapshot | TEXT | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| runId | PRIMARY KEY | PRIMARY KEY (runId) | +| workflowName | PRIMARY KEY | PRIMARY KEY (workflowName) | +| sqlite_autoindex_instance_ai_workflow_snapshots_1 | PRIMARY KEY | PRIMARY KEY (runId, workflowName) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_a371ee6b8e0ebb5635f8baa46d | CREATE INDEX "IDX_a371ee6b8e0ebb5635f8baa46d" ON "instance_ai_workflow_snapshots" ("workflowName", "status") | +| sqlite_autoindex_instance_ai_workflow_snapshots_1 | PRIMARY KEY (runId, workflowName) | + +## Relations + +```mermaid +erDiagram + + +"instance_ai_workflow_snapshots" { + varchar_36_ runId PK + varchar_255_ workflowName PK + varchar_255_ resourceId + varchar status + TEXT snapshot + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/instance_version_history.md b/docs/generated/sqlite-schema/instance_version_history.md new file mode 100644 index 00000000000..c6ac6c5de28 --- /dev/null +++ b/docs/generated/sqlite-schema/instance_version_history.md @@ -0,0 +1,47 @@ +# instance_version_history + +## Description + +
+Table Definition + +```sql +CREATE TABLE "instance_version_history" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "major" integer NOT NULL, "minor" integer NOT NULL, "patch" integer NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW'))) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | INTEGER | | false | | | | +| major | INTEGER | | false | | | | +| minor | INTEGER | | false | | | | +| patch | INTEGER | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + + +"instance_version_history" { + INTEGER id + INTEGER major + INTEGER minor + INTEGER patch + datetime_3_ createdAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/invalid_auth_token.md b/docs/generated/sqlite-schema/invalid_auth_token.md new file mode 100644 index 00000000000..d491f81dbf5 --- /dev/null +++ b/docs/generated/sqlite-schema/invalid_auth_token.md @@ -0,0 +1,48 @@ +# invalid_auth_token + +## Description + +
+Table Definition + +```sql +CREATE TABLE "invalid_auth_token" ("token" varchar(512) PRIMARY KEY NOT NULL, "expiresAt" datetime(3) NOT NULL) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| token | varchar(512) | | false | | | | +| expiresAt | datetime(3) | | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| token | PRIMARY KEY | PRIMARY KEY (token) | +| sqlite_autoindex_invalid_auth_token_1 | PRIMARY KEY | PRIMARY KEY (token) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_invalid_auth_token_1 | PRIMARY KEY (token) | + +## Relations + +```mermaid +erDiagram + + +"invalid_auth_token" { + varchar_512_ token PK + datetime_3_ expiresAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/mcp_registry_server.md b/docs/generated/sqlite-schema/mcp_registry_server.md new file mode 100644 index 00000000000..87df7b165da --- /dev/null +++ b/docs/generated/sqlite-schema/mcp_registry_server.md @@ -0,0 +1,69 @@ +# mcp_registry_server + +## Description + +
+Table Definition + +```sql +CREATE TABLE "mcp_registry_server" ("slug" varchar(255) PRIMARY KEY NOT NULL, "status" varchar(50) NOT NULL, "version" varchar(50) NOT NULL, "registryUpdatedAt" datetime(3) NOT NULL, "data" text NOT NULL DEFAULT ('{}'), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "CHK_tmp_mcp_registry_server_status" CHECK ("status" IN ('active', 'deprecated'))) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| slug | varchar(255) | | false | [instance_ai_mcp_registry_connections](instance_ai_mcp_registry_connections.md) | | | +| status | varchar(50) | | false | | | | +| version | varchar(50) | | false | | | | +| registryUpdatedAt | datetime(3) | | false | | | | +| data | TEXT | '{}' | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| slug | PRIMARY KEY | PRIMARY KEY (slug) | +| sqlite_autoindex_mcp_registry_server_1 | PRIMARY KEY | PRIMARY KEY (slug) | +| - | CHECK | CHECK ("status" IN ('active', 'deprecated')) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_mcp_registry_server_1 | PRIMARY KEY (slug) | + +## Relations + +```mermaid +erDiagram + +"instance_ai_mcp_registry_connections" }o--|| "mcp_registry_server" : "FOREIGN KEY (serverSlug) REFERENCES mcp_registry_server (slug) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"mcp_registry_server" { + varchar_255_ slug PK + varchar_50_ status + varchar_50_ version + datetime_3_ registryUpdatedAt + TEXT data + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_mcp_registry_connections" { + varchar id PK + varchar_36_ credentialId FK + varchar_255_ serverSlug FK + TEXT toolFilter + varchar userId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/oauth_access_tokens.md b/docs/generated/sqlite-schema/oauth_access_tokens.md new file mode 100644 index 00000000000..64e4370a0bc --- /dev/null +++ b/docs/generated/sqlite-schema/oauth_access_tokens.md @@ -0,0 +1,82 @@ +# oauth_access_tokens + +## Description + +
+Table Definition + +```sql +CREATE TABLE "oauth_access_tokens" ("token" varchar PRIMARY KEY NOT NULL, "clientId" varchar NOT NULL, "userId" varchar NOT NULL, CONSTRAINT "FK_78b26968132b7e5e45b75876481" FOREIGN KEY ("clientId") REFERENCES "oauth_clients" ("id") ON DELETE CASCADE, CONSTRAINT "FK_7234a36d8e49a1fa85095328845" FOREIGN KEY ("userId") REFERENCES "user" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| token | varchar | | false | | | | +| clientId | varchar | | false | | [oauth_clients](oauth_clients.md) | | +| userId | varchar | | false | | [user](user.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| token | PRIMARY KEY | PRIMARY KEY (token) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_oauth_access_tokens_1 | PRIMARY KEY | PRIMARY KEY (token) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_oauth_access_tokens_1 | PRIMARY KEY (token) | + +## Relations + +```mermaid +erDiagram + +"oauth_access_tokens" }o--|| "oauth_clients" : "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_access_tokens" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"oauth_access_tokens" { + varchar token PK + varchar clientId FK + varchar userId FK +} +"oauth_clients" { + varchar id PK + varchar_255_ name + TEXT redirectUris + TEXT grantTypes + varchar_255_ clientSecret + bigint clientSecretExpiresAt + varchar_255_ tokenEndpointAuthMethod + datetime_3_ createdAt + datetime_3_ updatedAt +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/oauth_authorization_codes.md b/docs/generated/sqlite-schema/oauth_authorization_codes.md new file mode 100644 index 00000000000..da1d21912d6 --- /dev/null +++ b/docs/generated/sqlite-schema/oauth_authorization_codes.md @@ -0,0 +1,102 @@ +# oauth_authorization_codes + +## Description + +
+Table Definition + +```sql +CREATE TABLE "oauth_authorization_codes" ("code" varchar(255) PRIMARY KEY NOT NULL, "clientId" varchar NOT NULL, "userId" varchar NOT NULL, "redirectUri" varchar NOT NULL, "codeChallenge" varchar NOT NULL, "codeChallengeMethod" varchar(255) NOT NULL, "expiresAt" bigint NOT NULL, "state" varchar, "used" boolean NOT NULL DEFAULT (false), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "resource" varchar, "scope" text NOT NULL DEFAULT ('["tool:listWorkflows","tool:getWorkflowDetails"]'), CONSTRAINT "FK_e829ca1240b877f73fd5fab14a2" FOREIGN KEY ("userId") REFERENCES "user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_81de58036895ccabf2214c6d99e" FOREIGN KEY ("clientId") REFERENCES "oauth_clients" ("id") ON DELETE CASCADE ON UPDATE NO ACTION) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| code | varchar(255) | | false | | | | +| clientId | varchar | | false | | [oauth_clients](oauth_clients.md) | | +| userId | varchar | | false | | [user](user.md) | | +| redirectUri | varchar | | false | | | | +| codeChallenge | varchar | | false | | | | +| codeChallengeMethod | varchar(255) | | false | | | | +| expiresAt | bigint | | false | | | | +| state | varchar | | true | | | | +| used | boolean | false | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| resource | varchar | | true | | | | +| scope | TEXT | '["tool:listWorkflows","tool:getWorkflowDetails"]' | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| code | PRIMARY KEY | PRIMARY KEY (code) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_oauth_authorization_codes_1 | PRIMARY KEY | PRIMARY KEY (code) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_oauth_authorization_codes_1 | PRIMARY KEY (code) | + +## Relations + +```mermaid +erDiagram + +"oauth_authorization_codes" }o--|| "oauth_clients" : "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_authorization_codes" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"oauth_authorization_codes" { + varchar_255_ code PK + varchar clientId FK + varchar userId FK + varchar redirectUri + varchar codeChallenge + varchar_255_ codeChallengeMethod + bigint expiresAt + varchar state + boolean used + datetime_3_ createdAt + datetime_3_ updatedAt + varchar resource + TEXT scope +} +"oauth_clients" { + varchar id PK + varchar_255_ name + TEXT redirectUris + TEXT grantTypes + varchar_255_ clientSecret + bigint clientSecretExpiresAt + varchar_255_ tokenEndpointAuthMethod + datetime_3_ createdAt + datetime_3_ updatedAt +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/oauth_clients.md b/docs/generated/sqlite-schema/oauth_clients.md new file mode 100644 index 00000000000..165739d6f46 --- /dev/null +++ b/docs/generated/sqlite-schema/oauth_clients.md @@ -0,0 +1,101 @@ +# oauth_clients + +## Description + +
+Table Definition + +```sql +CREATE TABLE "oauth_clients" ("id" varchar PRIMARY KEY NOT NULL, "name" varchar(255) NOT NULL, "redirectUris" text NOT NULL, "grantTypes" text NOT NULL, "clientSecret" varchar(255), "clientSecretExpiresAt" bigint, "tokenEndpointAuthMethod" varchar(255) NOT NULL DEFAULT ('none'), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW'))) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar | | false | [oauth_access_tokens](oauth_access_tokens.md) [oauth_user_consents](oauth_user_consents.md) [oauth_authorization_codes](oauth_authorization_codes.md) [oauth_refresh_tokens](oauth_refresh_tokens.md) | | | +| name | varchar(255) | | false | | | | +| redirectUris | TEXT | | false | | | | +| grantTypes | TEXT | | false | | | | +| clientSecret | varchar(255) | | true | | | | +| clientSecretExpiresAt | bigint | | true | | | | +| tokenEndpointAuthMethod | varchar(255) | 'none' | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| sqlite_autoindex_oauth_clients_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_oauth_clients_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"oauth_access_tokens" }o--|| "oauth_clients" : "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_user_consents" }o--|| "oauth_clients" : "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_authorization_codes" }o--|| "oauth_clients" : "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_refresh_tokens" }o--|| "oauth_clients" : "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"oauth_clients" { + varchar id PK + varchar_255_ name + TEXT redirectUris + TEXT grantTypes + varchar_255_ clientSecret + bigint clientSecretExpiresAt + varchar_255_ tokenEndpointAuthMethod + datetime_3_ createdAt + datetime_3_ updatedAt +} +"oauth_access_tokens" { + varchar token PK + varchar clientId FK + varchar userId FK +} +"oauth_user_consents" { + INTEGER id + varchar userId FK + varchar clientId FK + bigint grantedAt +} +"oauth_authorization_codes" { + varchar_255_ code PK + varchar clientId FK + varchar userId FK + varchar redirectUri + varchar codeChallenge + varchar_255_ codeChallengeMethod + bigint expiresAt + varchar state + boolean used + datetime_3_ createdAt + datetime_3_ updatedAt + varchar resource + TEXT scope +} +"oauth_refresh_tokens" { + varchar_255_ token PK + varchar clientId FK + varchar userId FK + bigint expiresAt + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT scope +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/oauth_refresh_tokens.md b/docs/generated/sqlite-schema/oauth_refresh_tokens.md new file mode 100644 index 00000000000..4009cf9ae95 --- /dev/null +++ b/docs/generated/sqlite-schema/oauth_refresh_tokens.md @@ -0,0 +1,90 @@ +# oauth_refresh_tokens + +## Description + +
+Table Definition + +```sql +CREATE TABLE "oauth_refresh_tokens" ("token" varchar(255) PRIMARY KEY NOT NULL, "clientId" varchar NOT NULL, "userId" varchar NOT NULL, "expiresAt" bigint NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "scope" text NOT NULL DEFAULT ('["tool:listWorkflows","tool:getWorkflowDetails"]'), CONSTRAINT "FK_a699f3ed9fd0c1b19bc2608ac53" FOREIGN KEY ("userId") REFERENCES "user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_b388696ce4d8be7ffbe8d3e4b69" FOREIGN KEY ("clientId") REFERENCES "oauth_clients" ("id") ON DELETE CASCADE ON UPDATE NO ACTION) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| token | varchar(255) | | false | | | | +| clientId | varchar | | false | | [oauth_clients](oauth_clients.md) | | +| userId | varchar | | false | | [user](user.md) | | +| expiresAt | bigint | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| scope | TEXT | '["tool:listWorkflows","tool:getWorkflowDetails"]' | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| token | PRIMARY KEY | PRIMARY KEY (token) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_oauth_refresh_tokens_1 | PRIMARY KEY | PRIMARY KEY (token) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_oauth_refresh_tokens_1 | PRIMARY KEY (token) | + +## Relations + +```mermaid +erDiagram + +"oauth_refresh_tokens" }o--|| "oauth_clients" : "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_refresh_tokens" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"oauth_refresh_tokens" { + varchar_255_ token PK + varchar clientId FK + varchar userId FK + bigint expiresAt + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT scope +} +"oauth_clients" { + varchar id PK + varchar_255_ name + TEXT redirectUris + TEXT grantTypes + varchar_255_ clientSecret + bigint clientSecretExpiresAt + varchar_255_ tokenEndpointAuthMethod + datetime_3_ createdAt + datetime_3_ updatedAt +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/oauth_user_consents.md b/docs/generated/sqlite-schema/oauth_user_consents.md new file mode 100644 index 00000000000..e0ce4550f49 --- /dev/null +++ b/docs/generated/sqlite-schema/oauth_user_consents.md @@ -0,0 +1,84 @@ +# oauth_user_consents + +## Description + +
+Table Definition + +```sql +CREATE TABLE "oauth_user_consents" ("id" integer PRIMARY KEY NOT NULL, "userId" varchar NOT NULL, "clientId" varchar NOT NULL, "grantedAt" bigint NOT NULL, CONSTRAINT "UQ_083721d99ce8db4033e2958ebb4" UNIQUE ("userId", "clientId"), CONSTRAINT "FK_a651acea2f6c97f8c4514935486" FOREIGN KEY ("clientId") REFERENCES "oauth_clients" ("id") ON DELETE CASCADE, CONSTRAINT "FK_21e6c3c2d78a097478fae6aaefa" FOREIGN KEY ("userId") REFERENCES "user" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | INTEGER | | false | | | | +| userId | varchar | | false | | [user](user.md) | | +| clientId | varchar | | false | | [oauth_clients](oauth_clients.md) | | +| grantedAt | bigint | | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_oauth_user_consents_1 | UNIQUE | UNIQUE (userId, clientId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_oauth_user_consents_1 | UNIQUE (userId, clientId) | + +## Relations + +```mermaid +erDiagram + +"oauth_user_consents" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_user_consents" }o--|| "oauth_clients" : "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"oauth_user_consents" { + INTEGER id + varchar userId FK + varchar clientId FK + bigint grantedAt +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"oauth_clients" { + varchar id PK + varchar_255_ name + TEXT redirectUris + TEXT grantTypes + varchar_255_ clientSecret + bigint clientSecretExpiresAt + varchar_255_ tokenEndpointAuthMethod + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/processed_data.md b/docs/generated/sqlite-schema/processed_data.md new file mode 100644 index 00000000000..28d6eb358ab --- /dev/null +++ b/docs/generated/sqlite-schema/processed_data.md @@ -0,0 +1,79 @@ +# processed_data + +## Description + +
+Table Definition + +```sql +CREATE TABLE "processed_data" ("workflowId" varchar(36) NOT NULL, "context" varchar(255) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "value" text NOT NULL, CONSTRAINT "FK_06a69a7032c97a763c2c7599464" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, PRIMARY KEY ("workflowId", "context")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| workflowId | varchar(36) | | false | | [workflow_entity](workflow_entity.md) | | +| context | varchar(255) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| value | TEXT | | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| workflowId | PRIMARY KEY | PRIMARY KEY (workflowId) | +| context | PRIMARY KEY | PRIMARY KEY (context) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_processed_data_1 | PRIMARY KEY | PRIMARY KEY (workflowId, context) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_processed_data_1 | PRIMARY KEY (workflowId, context) | + +## Relations + +```mermaid +erDiagram + +"processed_data" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"processed_data" { + varchar_36_ workflowId PK + varchar_255_ context PK + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT value +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/project.md b/docs/generated/sqlite-schema/project.md new file mode 100644 index 00000000000..3c547cf881f --- /dev/null +++ b/docs/generated/sqlite-schema/project.md @@ -0,0 +1,196 @@ +# project + +## Description + +
+Table Definition + +```sql +CREATE TABLE "project" ("id" varchar(36) PRIMARY KEY NOT NULL, "name" varchar(255) NOT NULL, "type" varchar(36) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "icon" text, "description" varchar(512), "creatorId" varchar, "customTelemetryTags" text NOT NULL DEFAULT ('[]'), CONSTRAINT "projects_creatorId_foreign" FOREIGN KEY ("creatorId") REFERENCES "user" ("id") ON DELETE SET NULL ON UPDATE NO ACTION) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [shared_credentials](shared_credentials.md) [shared_workflow](shared_workflow.md) [folder](folder.md) [insights_metadata](insights_metadata.md) [project_relation](project_relation.md) [data_table](data_table.md) [variables](variables.md) [project_secrets_provider_access](project_secrets_provider_access.md) [role_mapping_rule_project](role_mapping_rule_project.md) [agents](agents.md) [agent_execution_threads](agent_execution_threads.md) [instance_ai_threads](instance_ai_threads.md) | | | +| name | varchar(255) | | false | | | | +| type | varchar(36) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| icon | TEXT | | true | | | | +| description | varchar(512) | | true | | | | +| creatorId | varchar | | true | | [user](user.md) | | +| customTelemetryTags | TEXT | '[]' | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (creatorId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| sqlite_autoindex_project_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_project_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"shared_credentials" |o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"shared_workflow" |o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"folder" }o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"insights_metadata" }o--o| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"project_relation" |o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"data_table" }o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"variables" }o--o| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"project_secrets_provider_access" |o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"role_mapping_rule_project" |o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agents" }o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"agent_execution_threads" }o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"instance_ai_threads" }o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"project" }o--o| "user" : "FOREIGN KEY (creatorId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + +"project" { + varchar_36_ id PK + varchar_255_ name + varchar_36_ type + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + varchar_512_ description + varchar creatorId FK + TEXT customTelemetryTags +} +"shared_credentials" { + varchar_36_ credentialsId PK + varchar_36_ projectId PK + TEXT role + datetime_3_ createdAt + datetime_3_ updatedAt +} +"shared_workflow" { + varchar_36_ workflowId PK + varchar_36_ projectId PK + TEXT role + datetime_3_ createdAt + datetime_3_ updatedAt +} +"folder" { + varchar_36_ id PK + varchar_128_ name + varchar_36_ parentFolderId FK + varchar_36_ projectId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"insights_metadata" { + INTEGER metaId + varchar_16_ workflowId FK + varchar_36_ projectId FK + varchar_128_ workflowName + varchar_255_ projectName +} +"project_relation" { + varchar_36_ projectId PK + varchar userId PK + varchar role FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"data_table" { + varchar_36_ id PK + varchar_128_ name + varchar_36_ projectId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"variables" { + varchar_36_ id PK + TEXT key + TEXT type + TEXT value + varchar_36_ projectId FK +} +"project_secrets_provider_access" { + INTEGER secretsProviderConnectionId PK + varchar_36_ projectId PK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_128_ role +} +"role_mapping_rule_project" { + varchar_16_ roleMappingRuleId PK + varchar_36_ projectId PK +} +"agents" { + varchar_36_ id PK + varchar_128_ name + varchar_512_ description + varchar_255_ projectId FK + TEXT integrations + TEXT schema + TEXT tools + TEXT skills + varchar_36_ versionId + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ activeVersionId FK +} +"agent_execution_threads" { + varchar_128_ id PK + varchar_36_ agentId FK + varchar_255_ agentName + varchar_255_ projectId FK + INTEGER sessionNumber + INTEGER totalPromptTokens + INTEGER totalCompletionTokens + REAL totalCost + INTEGER totalDuration + varchar_255_ title + varchar_8_ emoji + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_32_ taskId + varchar_36_ taskVersionId FK + varchar_128_ parentThreadId + varchar_36_ parentAgentId +} +"instance_ai_threads" { + varchar id PK + varchar_255_ resourceId + varchar_36_ projectId FK + TEXT title + TEXT metadata + datetime_3_ createdAt + datetime_3_ updatedAt +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/project_relation.md b/docs/generated/sqlite-schema/project_relation.md new file mode 100644 index 00000000000..5e5b49ffb13 --- /dev/null +++ b/docs/generated/sqlite-schema/project_relation.md @@ -0,0 +1,102 @@ +# project_relation + +## Description + +
+Table Definition + +```sql +CREATE TABLE "project_relation" ("projectId" varchar(36) NOT NULL, "userId" varchar NOT NULL, "role" varchar NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_5f0643f6717905a05164090dde7" FOREIGN KEY ("userId") REFERENCES "user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_61448d56d61802b5dfde5cdb002" FOREIGN KEY ("projectId") REFERENCES "project" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_c6b99592dc96b0d836d7a21db91" FOREIGN KEY ("role") REFERENCES "role" ("slug"), PRIMARY KEY ("projectId", "userId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| projectId | varchar(36) | | false | | [project](project.md) | | +| userId | varchar | | false | | [user](user.md) | | +| role | varchar | | false | | [role](role.md) | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| projectId | PRIMARY KEY | PRIMARY KEY (projectId) | +| userId | PRIMARY KEY | PRIMARY KEY (userId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (role) REFERENCES role (slug) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_project_relation_1 | PRIMARY KEY | PRIMARY KEY (projectId, userId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| project_relation_role_project_idx | CREATE INDEX "project_relation_role_project_idx" ON "project_relation" ("projectId", "role") | +| project_relation_role_idx | CREATE INDEX "project_relation_role_idx" ON "project_relation" ("role") | +| IDX_61448d56d61802b5dfde5cdb00 | CREATE INDEX "IDX_61448d56d61802b5dfde5cdb00" ON "project_relation" ("projectId") | +| IDX_5f0643f6717905a05164090dde | CREATE INDEX "IDX_5f0643f6717905a05164090dde" ON "project_relation" ("userId") | +| sqlite_autoindex_project_relation_1 | PRIMARY KEY (projectId, userId) | + +## Relations + +```mermaid +erDiagram + +"project_relation" |o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"project_relation" |o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"project_relation" }o--|| "role" : "FOREIGN KEY (role) REFERENCES role (slug) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" + +"project_relation" { + varchar_36_ projectId PK + varchar userId PK + varchar role FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"project" { + varchar_36_ id PK + varchar_255_ name + varchar_36_ type + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + varchar_512_ description + varchar creatorId FK + TEXT customTelemetryTags +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"role" { + varchar_128_ slug PK + TEXT displayName + TEXT description + TEXT roleType + boolean systemRole + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/project_secrets_provider_access.md b/docs/generated/sqlite-schema/project_secrets_provider_access.md new file mode 100644 index 00000000000..748906b7b07 --- /dev/null +++ b/docs/generated/sqlite-schema/project_secrets_provider_access.md @@ -0,0 +1,80 @@ +# project_secrets_provider_access + +## Description + +
+Table Definition + +```sql +CREATE TABLE "project_secrets_provider_access" ("secretsProviderConnectionId" integer NOT NULL, "projectId" varchar(36) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "role" varchar(128) NOT NULL DEFAULT ('secretsProviderConnection:user'), CONSTRAINT "CHK_project_secrets_provider_access_role" CHECK ("role" IN ('secretsProviderConnection:owner', 'secretsProviderConnection:user')), CONSTRAINT "FK_bd264b81209355b543878deedb1" FOREIGN KEY ("projectId") REFERENCES "project" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_18e5c27d2524b1638b292904e48" FOREIGN KEY ("secretsProviderConnectionId") REFERENCES "secrets_provider_connection" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, PRIMARY KEY ("secretsProviderConnectionId", "projectId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| secretsProviderConnectionId | INTEGER | | false | | [secrets_provider_connection](secrets_provider_connection.md) | | +| projectId | varchar(36) | | false | | [project](project.md) | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| role | varchar(128) | 'secretsProviderConnection:user' | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| secretsProviderConnectionId | PRIMARY KEY | PRIMARY KEY (secretsProviderConnectionId) | +| projectId | PRIMARY KEY | PRIMARY KEY (projectId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (secretsProviderConnectionId) REFERENCES secrets_provider_connection (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_project_secrets_provider_access_1 | PRIMARY KEY | PRIMARY KEY (secretsProviderConnectionId, projectId) | +| - | CHECK | CHECK ("role" IN ('secretsProviderConnection:owner', 'secretsProviderConnection:user')) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_project_secrets_provider_access_1 | PRIMARY KEY (secretsProviderConnectionId, projectId) | + +## Relations + +```mermaid +erDiagram + +"project_secrets_provider_access" |o--|| "secrets_provider_connection" : "FOREIGN KEY (secretsProviderConnectionId) REFERENCES secrets_provider_connection (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"project_secrets_provider_access" |o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"project_secrets_provider_access" { + INTEGER secretsProviderConnectionId PK + varchar_36_ projectId PK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_128_ role +} +"secrets_provider_connection" { + INTEGER id + varchar_128_ providerKey + varchar_36_ type + TEXT encryptedSettings + boolean isEnabled + datetime_3_ createdAt + datetime_3_ updatedAt +} +"project" { + varchar_36_ id PK + varchar_255_ name + varchar_36_ type + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + varchar_512_ description + varchar creatorId FK + TEXT customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/role.md b/docs/generated/sqlite-schema/role.md new file mode 100644 index 00000000000..de7c753e4c6 --- /dev/null +++ b/docs/generated/sqlite-schema/role.md @@ -0,0 +1,100 @@ +# role + +## Description + +
+Table Definition + +```sql +CREATE TABLE "role" ("slug" varchar(128) PRIMARY KEY NOT NULL, "displayName" text, "description" text, "roleType" text, "systemRole" boolean NOT NULL DEFAULT (false), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW'))) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| slug | varchar(128) | | false | [role_scope](role_scope.md) [user](user.md) [project_relation](project_relation.md) [role_mapping_rule](role_mapping_rule.md) | | | +| displayName | TEXT | | true | | | | +| description | TEXT | | true | | | | +| roleType | TEXT | | true | | | | +| systemRole | boolean | false | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| slug | PRIMARY KEY | PRIMARY KEY (slug) | +| sqlite_autoindex_role_1 | PRIMARY KEY | PRIMARY KEY (slug) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_UniqueRoleDisplayName | CREATE UNIQUE INDEX "IDX_UniqueRoleDisplayName" ON "role" ("displayName") | +| sqlite_autoindex_role_1 | PRIMARY KEY (slug) | + +## Relations + +```mermaid +erDiagram + +"role_scope" |o--|| "role" : "FOREIGN KEY (roleSlug) REFERENCES role (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE" +"user" }o--|| "role" : "FOREIGN KEY (roleSlug) REFERENCES role (slug) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" +"project_relation" }o--|| "role" : "FOREIGN KEY (role) REFERENCES role (slug) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" +"role_mapping_rule" }o--|| "role" : "FOREIGN KEY (role) REFERENCES role (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE" + +"role" { + varchar_128_ slug PK + TEXT displayName + TEXT description + TEXT roleType + boolean systemRole + datetime_3_ createdAt + datetime_3_ updatedAt +} +"role_scope" { + VARCHAR_128_ roleSlug PK + VARCHAR_128_ scopeSlug PK +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"project_relation" { + varchar_36_ projectId PK + varchar userId PK + varchar role FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"role_mapping_rule" { + varchar_16_ id PK + TEXT expression + varchar_128_ role FK + varchar_64_ type + INTEGER order + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/role_mapping_rule.md b/docs/generated/sqlite-schema/role_mapping_rule.md new file mode 100644 index 00000000000..879418486f3 --- /dev/null +++ b/docs/generated/sqlite-schema/role_mapping_rule.md @@ -0,0 +1,77 @@ +# role_mapping_rule + +## Description + +
+Table Definition + +```sql +CREATE TABLE "role_mapping_rule" ("id" varchar(16) PRIMARY KEY NOT NULL, "expression" text NOT NULL, "role" varchar(128) NOT NULL, "type" varchar(64) NOT NULL, "order" integer NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "UQ_b33ac896ad3099fc8de36fdc1c4" UNIQUE ("type", "order"), CONSTRAINT "FK_bb66e404c35996b0d6946177501" FOREIGN KEY ("role") REFERENCES "role" ("slug") ON DELETE CASCADE ON UPDATE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(16) | | false | [role_mapping_rule_project](role_mapping_rule_project.md) | | | +| expression | TEXT | | false | | | | +| role | varchar(128) | | false | | [role](role.md) | | +| type | varchar(64) | | false | | | | +| order | INTEGER | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (role) REFERENCES role (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_role_mapping_rule_2 | UNIQUE | UNIQUE (type, order) | +| sqlite_autoindex_role_mapping_rule_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_bb66e404c35996b0d694617750 | CREATE INDEX "IDX_bb66e404c35996b0d694617750" ON "role_mapping_rule" ("role") | +| sqlite_autoindex_role_mapping_rule_2 | UNIQUE (type, order) | +| sqlite_autoindex_role_mapping_rule_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"role_mapping_rule_project" |o--|| "role_mapping_rule" : "FOREIGN KEY (roleMappingRuleId) REFERENCES role_mapping_rule (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"role_mapping_rule" }o--|| "role" : "FOREIGN KEY (role) REFERENCES role (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE" + +"role_mapping_rule" { + varchar_16_ id PK + TEXT expression + varchar_128_ role FK + varchar_64_ type + INTEGER order + datetime_3_ createdAt + datetime_3_ updatedAt +} +"role_mapping_rule_project" { + varchar_16_ roleMappingRuleId PK + varchar_36_ projectId PK +} +"role" { + varchar_128_ slug PK + TEXT displayName + TEXT description + TEXT roleType + boolean systemRole + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/role_mapping_rule_project.md b/docs/generated/sqlite-schema/role_mapping_rule_project.md new file mode 100644 index 00000000000..fb52f22e372 --- /dev/null +++ b/docs/generated/sqlite-schema/role_mapping_rule_project.md @@ -0,0 +1,74 @@ +# role_mapping_rule_project + +## Description + +
+Table Definition + +```sql +CREATE TABLE "role_mapping_rule_project" ("roleMappingRuleId" varchar(16) NOT NULL, "projectId" varchar(36) NOT NULL, CONSTRAINT "FK_dd7ce4dfa09e95b36a626bd9de3" FOREIGN KEY ("roleMappingRuleId") REFERENCES "role_mapping_rule" ("id") ON DELETE CASCADE, CONSTRAINT "FK_35a78869286c65d9330d02b88f5" FOREIGN KEY ("projectId") REFERENCES "project" ("id") ON DELETE CASCADE, PRIMARY KEY ("roleMappingRuleId", "projectId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| roleMappingRuleId | varchar(16) | | false | | [role_mapping_rule](role_mapping_rule.md) | | +| projectId | varchar(36) | | false | | [project](project.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| roleMappingRuleId | PRIMARY KEY | PRIMARY KEY (roleMappingRuleId) | +| projectId | PRIMARY KEY | PRIMARY KEY (projectId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (roleMappingRuleId) REFERENCES role_mapping_rule (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_role_mapping_rule_project_1 | PRIMARY KEY | PRIMARY KEY (roleMappingRuleId, projectId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_35a78869286c65d9330d02b88f | CREATE INDEX "IDX_35a78869286c65d9330d02b88f" ON "role_mapping_rule_project" ("projectId") | +| sqlite_autoindex_role_mapping_rule_project_1 | PRIMARY KEY (roleMappingRuleId, projectId) | + +## Relations + +```mermaid +erDiagram + +"role_mapping_rule_project" |o--|| "role_mapping_rule" : "FOREIGN KEY (roleMappingRuleId) REFERENCES role_mapping_rule (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"role_mapping_rule_project" |o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"role_mapping_rule_project" { + varchar_16_ roleMappingRuleId PK + varchar_36_ projectId PK +} +"role_mapping_rule" { + varchar_16_ id PK + TEXT expression + varchar_128_ role FK + varchar_64_ type + INTEGER order + datetime_3_ createdAt + datetime_3_ updatedAt +} +"project" { + varchar_36_ id PK + varchar_255_ name + varchar_36_ type + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + varchar_512_ description + varchar creatorId FK + TEXT customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/role_scope.md b/docs/generated/sqlite-schema/role_scope.md new file mode 100644 index 00000000000..b6bb6e1eeff --- /dev/null +++ b/docs/generated/sqlite-schema/role_scope.md @@ -0,0 +1,74 @@ +# role_scope + +## Description + +
+Table Definition + +```sql +CREATE TABLE role_scope ( + "roleSlug" VARCHAR(128) NOT NULL, + "scopeSlug" VARCHAR(128) NOT NULL, + CONSTRAINT "PK_role_scope" PRIMARY KEY ("roleSlug", "scopeSlug"), + CONSTRAINT "FK_role" FOREIGN KEY ("roleSlug") REFERENCES role ("slug") ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT "FK_scope" FOREIGN KEY ("scopeSlug") REFERENCES "scope" ("slug") ON DELETE CASCADE ON UPDATE CASCADE + ) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| roleSlug | VARCHAR(128) | | false | | [role](role.md) | | +| scopeSlug | VARCHAR(128) | | false | | [scope](scope.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| roleSlug | PRIMARY KEY | PRIMARY KEY (roleSlug) | +| scopeSlug | PRIMARY KEY | PRIMARY KEY (scopeSlug) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (scopeSlug) REFERENCES scope (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (roleSlug) REFERENCES role (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_role_scope_1 | PRIMARY KEY | PRIMARY KEY (roleSlug, scopeSlug) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_role_scope_scopeSlug | CREATE INDEX "IDX_role_scope_scopeSlug" ON "role_scope" ("scopeSlug") | +| sqlite_autoindex_role_scope_1 | PRIMARY KEY (roleSlug, scopeSlug) | + +## Relations + +```mermaid +erDiagram + +"role_scope" |o--|| "role" : "FOREIGN KEY (roleSlug) REFERENCES role (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE" +"role_scope" |o--|| "scope" : "FOREIGN KEY (scopeSlug) REFERENCES scope (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE" + +"role_scope" { + VARCHAR_128_ roleSlug PK + VARCHAR_128_ scopeSlug PK +} +"role" { + varchar_128_ slug PK + TEXT displayName + TEXT description + TEXT roleType + boolean systemRole + datetime_3_ createdAt + datetime_3_ updatedAt +} +"scope" { + varchar_128_ slug PK + TEXT displayName + TEXT description +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/schema.json b/docs/generated/sqlite-schema/schema.json new file mode 100644 index 00000000000..1b4a5f6015b --- /dev/null +++ b/docs/generated/sqlite-schema/schema.json @@ -0,0 +1,13523 @@ +{ + "name": "n8n database schema (SQLite)", + "desc": "Auto-generated from the SQLite migrations in @n8n/db. Do not edit by hand.", + "tables": [ + { + "name": "settings", + "type": "table", + "columns": [ + { + "name": "key", + "type": "TEXT", + "nullable": false + }, + { + "name": "value", + "type": "TEXT", + "nullable": false, + "default": "''" + }, + { + "name": "loadOnStartup", + "type": "boolean", + "nullable": false, + "default": "false" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_settings_1", + "def": "PRIMARY KEY (key)", + "table": "settings", + "columns": [ + "key" + ] + } + ], + "constraints": [ + { + "name": "key", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (key)", + "table": "settings", + "columns": [ + "key" + ] + }, + { + "name": "sqlite_autoindex_settings_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (key)", + "table": "settings", + "columns": [ + "key" + ] + } + ], + "def": "CREATE TABLE \"settings\" (\"key\"\tTEXT NOT NULL,\"value\"\tTEXT NOT NULL DEFAULT '',\"loadOnStartup\"\tboolean NOT NULL default false,PRIMARY KEY(\"key\"))" + }, + { + "name": "installed_packages", + "type": "table", + "columns": [ + { + "name": "packageName", + "type": "char(214)", + "nullable": false + }, + { + "name": "installedVersion", + "type": "char(50)", + "nullable": false + }, + { + "name": "authorName", + "type": "char(70)", + "nullable": true + }, + { + "name": "authorEmail", + "type": "char(70)", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "'STRFTIME(''%Y-%m-%d %H:%M:%f'', ''NOW'')'" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "'STRFTIME(''%Y-%m-%d %H:%M:%f'', ''NOW'')'" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_installed_packages_1", + "def": "PRIMARY KEY (packageName)", + "table": "installed_packages", + "columns": [ + "packageName" + ] + } + ], + "constraints": [ + { + "name": "packageName", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (packageName)", + "table": "installed_packages", + "columns": [ + "packageName" + ] + }, + { + "name": "sqlite_autoindex_installed_packages_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (packageName)", + "table": "installed_packages", + "columns": [ + "packageName" + ] + } + ], + "def": "CREATE TABLE \"installed_packages\" (\"packageName\"\tchar(214) NOT NULL,\"installedVersion\"\tchar(50) NOT NULL,\"authorName\"\tchar(70) NULL,\"authorEmail\"\tchar(70) NULL,\"createdAt\"\tdatetime(3) NOT NULL DEFAULT 'STRFTIME(''%Y-%m-%d %H:%M:%f'', ''NOW'')',\"updatedAt\"\tdatetime(3) NOT NULL DEFAULT 'STRFTIME(''%Y-%m-%d %H:%M:%f'', ''NOW'')',PRIMARY KEY(\"packageName\"))" + }, + { + "name": "installed_nodes", + "type": "table", + "columns": [ + { + "name": "name", + "type": "char(200)", + "nullable": false + }, + { + "name": "type", + "type": "char(200)", + "nullable": false + }, + { + "name": "latestVersion", + "type": "INTEGER", + "nullable": true, + "default": "1" + }, + { + "name": "package", + "type": "char(214)", + "nullable": false + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_installed_nodes_1", + "def": "PRIMARY KEY (name)", + "table": "installed_nodes", + "columns": [ + "name" + ] + } + ], + "constraints": [ + { + "name": "name", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (name)", + "table": "installed_nodes", + "columns": [ + "name" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (package) REFERENCES installed_packages (packageName) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE", + "table": "installed_nodes", + "referenced_table": "installed_packages", + "columns": [ + "package" + ], + "referenced_columns": [ + "packageName" + ] + }, + { + "name": "sqlite_autoindex_installed_nodes_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (name)", + "table": "installed_nodes", + "columns": [ + "name" + ] + } + ], + "def": "CREATE TABLE \"installed_nodes\" (\"name\"\tchar(200) NOT NULL,\"type\"\tchar(200) NOT NULL,\"latestVersion\"\tINTEGER DEFAULT 1,\"package\"\tchar(214) NOT NULL,PRIMARY KEY(\"name\"),FOREIGN KEY(\"package\") REFERENCES \"installed_packages\"(\"packageName\") ON DELETE CASCADE ON UPDATE CASCADE)" + }, + { + "name": "event_destinations", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "destination", + "type": "TEXT", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "'STRFTIME(''%Y-%m-%d %H:%M:%f'', ''NOW'')'" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "'STRFTIME(''%Y-%m-%d %H:%M:%f'', ''NOW'')'" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_event_destinations_1", + "def": "PRIMARY KEY (id)", + "table": "event_destinations", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "event_destinations", + "columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_event_destinations_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "event_destinations", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"event_destinations\" (\"id\"\tvarchar(36) PRIMARY KEY NOT NULL,\"destination\" text NOT NULL,\"createdAt\"\tdatetime(3) NOT NULL DEFAULT 'STRFTIME(''%Y-%m-%d %H:%M:%f'', ''NOW'')',\"updatedAt\"\tdatetime(3) NOT NULL DEFAULT 'STRFTIME(''%Y-%m-%d %H:%M:%f'', ''NOW'')')" + }, + { + "name": "auth_identity", + "type": "table", + "columns": [ + { + "name": "userId", + "type": "VARCHAR(36)", + "nullable": true + }, + { + "name": "providerId", + "type": "VARCHAR(64)", + "nullable": false + }, + { + "name": "providerType", + "type": "VARCHAR(32)", + "nullable": false + }, + { + "name": "createdAt", + "type": "timestamp", + "nullable": false, + "default": "CURRENT_TIMESTAMP" + }, + { + "name": "updatedAt", + "type": "timestamp", + "nullable": false, + "default": "CURRENT_TIMESTAMP" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_auth_identity_1", + "def": "PRIMARY KEY (providerId, providerType)", + "table": "auth_identity", + "columns": [ + "providerId", + "providerType" + ] + } + ], + "constraints": [ + { + "name": "providerId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (providerId)", + "table": "auth_identity", + "columns": [ + "providerId" + ] + }, + { + "name": "providerType", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (providerType)", + "table": "auth_identity", + "columns": [ + "providerType" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE", + "table": "auth_identity", + "referenced_table": "user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_auth_identity_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (providerId, providerType)", + "table": "auth_identity", + "columns": [ + "providerId", + "providerType" + ] + } + ], + "def": "CREATE TABLE \"auth_identity\" (\n\t\t\t\t\"userId\" VARCHAR(36) REFERENCES \"user\" (id),\n\t\t\t\t\"providerId\" VARCHAR(64) NOT NULL,\n\t\t\t\t\"providerType\" VARCHAR(32) NOT NULL,\n\t\t\t\t\"createdAt\" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\t\t\t\"updatedAt\" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\t\t\tPRIMARY KEY(\"providerId\", \"providerType\")\n\t\t\t)" + }, + { + "name": "auth_provider_sync_history", + "type": "table", + "columns": [ + { + "name": "id", + "type": "INTEGER", + "nullable": true + }, + { + "name": "providerType", + "type": "VARCHAR(32)", + "nullable": false + }, + { + "name": "runMode", + "type": "TEXT", + "nullable": false + }, + { + "name": "status", + "type": "TEXT", + "nullable": false + }, + { + "name": "startedAt", + "type": "DATETIME", + "nullable": false + }, + { + "name": "endedAt", + "type": "DATETIME", + "nullable": false + }, + { + "name": "scanned", + "type": "INTEGER", + "nullable": false + }, + { + "name": "created", + "type": "INTEGER", + "nullable": false + }, + { + "name": "updated", + "type": "INTEGER", + "nullable": false + }, + { + "name": "disabled", + "type": "INTEGER", + "nullable": false + }, + { + "name": "error", + "type": "TEXT", + "nullable": true + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "auth_provider_sync_history", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"auth_provider_sync_history\" (\n\t\t\t\t\"id\" INTEGER PRIMARY KEY AUTOINCREMENT,\n\t\t\t\t\"providerType\" VARCHAR(32) NOT NULL,\n\t\t\t\t\"runMode\" TEXT NOT NULL,\n\t\t\t\t\"status\" TEXT NOT NULL,\n\t\t\t\t\"startedAt\" DATETIME NOT NULL,\n\t\t\t\t\"endedAt\" DATETIME NOT NULL,\n\t\t\t\t\"scanned\" INTEGER NOT NULL,\n\t\t\t\t\"created\" INTEGER NOT NULL,\n\t\t\t\t\"updated\" INTEGER NOT NULL,\n\t\t\t\t\"disabled\" INTEGER NOT NULL,\n\t\t\t\t\"error\" TEXT\n\t\t\t)" + }, + { + "name": "tag_entity", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(24)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_8f949d7a3a984759044054e89b", + "def": "CREATE UNIQUE INDEX \"IDX_8f949d7a3a984759044054e89b\" ON \"tag_entity\" (\"name\") ", + "table": "tag_entity", + "columns": [ + "name" + ] + }, + { + "name": "sqlite_autoindex_tag_entity_1", + "def": "PRIMARY KEY (id)", + "table": "tag_entity", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "tag_entity", + "columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_tag_entity_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "tag_entity", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"tag_entity\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"name\" varchar(24) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')))" + }, + { + "name": "workflows_tags", + "type": "table", + "columns": [ + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "tagId", + "type": "INTEGER", + "nullable": false + } + ], + "indexes": [ + { + "name": "idx_workflows_tags_workflow_id", + "def": "CREATE INDEX \"idx_workflows_tags_workflow_id\" ON \"workflows_tags\" (\"workflowId\")", + "table": "workflows_tags", + "columns": [ + "workflowId" + ] + }, + { + "name": "idx_workflows_tags_tag_id", + "def": "CREATE INDEX \"idx_workflows_tags_tag_id\" ON \"workflows_tags\" (\"tagId\")", + "table": "workflows_tags", + "columns": [ + "tagId" + ] + }, + { + "name": "sqlite_autoindex_workflows_tags_1", + "def": "PRIMARY KEY (workflowId, tagId)", + "table": "workflows_tags", + "columns": [ + "workflowId", + "tagId" + ] + } + ], + "constraints": [ + { + "name": "workflowId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (workflowId)", + "table": "workflows_tags", + "columns": [ + "workflowId" + ] + }, + { + "name": "tagId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (tagId)", + "table": "workflows_tags", + "columns": [ + "tagId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (tagId) REFERENCES tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "workflows_tags", + "referenced_table": "tag_entity", + "columns": [ + "tagId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "workflows_tags", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_workflows_tags_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (workflowId, tagId)", + "table": "workflows_tags", + "columns": [ + "workflowId", + "tagId" + ] + } + ], + "def": "CREATE TABLE \"workflows_tags\" (\"workflowId\" varchar(36) NOT NULL, \"tagId\" integer NOT NULL, CONSTRAINT \"FK_workflows_tags_workflow_entity\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_workflows_tags_tag_entity\" FOREIGN KEY (\"tagId\") REFERENCES \"tag_entity\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, PRIMARY KEY (\"workflowId\", \"tagId\"))" + }, + { + "name": "webhook_entity", + "type": "table", + "columns": [ + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "webhookPath", + "type": "varchar", + "nullable": false + }, + { + "name": "method", + "type": "varchar", + "nullable": false + }, + { + "name": "node", + "type": "varchar", + "nullable": false + }, + { + "name": "webhookId", + "type": "varchar", + "nullable": true + }, + { + "name": "pathLength", + "type": "INTEGER", + "nullable": true + } + ], + "indexes": [ + { + "name": "idx_webhook_entity_webhook_path_method", + "def": "CREATE INDEX \"idx_webhook_entity_webhook_path_method\" ON \"webhook_entity\" (\"webhookId\",\"method\",\"pathLength\")", + "table": "webhook_entity", + "columns": [ + "webhookId", + "method", + "pathLength" + ] + }, + { + "name": "sqlite_autoindex_webhook_entity_1", + "def": "PRIMARY KEY (webhookPath, method)", + "table": "webhook_entity", + "columns": [ + "webhookPath", + "method" + ] + } + ], + "constraints": [ + { + "name": "webhookPath", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (webhookPath)", + "table": "webhook_entity", + "columns": [ + "webhookPath" + ] + }, + { + "name": "method", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (method)", + "table": "webhook_entity", + "columns": [ + "method" + ] + }, + { + "name": "sqlite_autoindex_webhook_entity_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (webhookPath, method)", + "table": "webhook_entity", + "columns": [ + "webhookPath", + "method" + ] + } + ], + "def": "CREATE TABLE \"webhook_entity\" (\"workflowId\" varchar(36) NOT NULL, \"webhookPath\" varchar NOT NULL, \"method\" varchar NOT NULL, \"node\" varchar NOT NULL, \"webhookId\" varchar, \"pathLength\" integer, PRIMARY KEY (\"webhookPath\", \"method\"))" + }, + { + "name": "execution_data", + "type": "table", + "columns": [ + { + "name": "executionId", + "type": "INT", + "nullable": false + }, + { + "name": "workflowData", + "type": "TEXT", + "nullable": false + }, + { + "name": "data", + "type": "TEXT", + "nullable": false + }, + { + "name": "workflowVersionId", + "type": "VARCHAR(36)", + "nullable": true + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_execution_data_1", + "def": "PRIMARY KEY (executionId)", + "table": "execution_data", + "columns": [ + "executionId" + ] + } + ], + "constraints": [ + { + "name": "executionId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (executionId)", + "table": "execution_data", + "columns": [ + "executionId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "execution_data", + "referenced_table": "execution_entity", + "columns": [ + "executionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_execution_data_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (executionId)", + "table": "execution_data", + "columns": [ + "executionId" + ] + } + ], + "def": "CREATE TABLE \"execution_data\" (\n\t\t\t\t\"executionId\" int PRIMARY KEY NOT NULL,\n\t\t\t\t\"workflowData\" text NOT NULL,\n\t\t\t\t\"data\" text NOT NULL, \"workflowVersionId\" VARCHAR(36),\n\t\t\t\tFOREIGN KEY(\"executionId\") REFERENCES \"execution_entity\" (\"id\") ON DELETE CASCADE\n\t\t\t)" + }, + { + "name": "shared_credentials", + "type": "table", + "columns": [ + { + "name": "credentialsId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "role", + "type": "TEXT", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_shared_credentials_1", + "def": "PRIMARY KEY (credentialsId, projectId)", + "table": "shared_credentials", + "columns": [ + "credentialsId", + "projectId" + ] + } + ], + "constraints": [ + { + "name": "credentialsId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (credentialsId)", + "table": "shared_credentials", + "columns": [ + "credentialsId" + ] + }, + { + "name": "projectId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (projectId)", + "table": "shared_credentials", + "columns": [ + "projectId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "shared_credentials", + "referenced_table": "project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (credentialsId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "shared_credentials", + "referenced_table": "credentials_entity", + "columns": [ + "credentialsId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_shared_credentials_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (credentialsId, projectId)", + "table": "shared_credentials", + "columns": [ + "credentialsId", + "projectId" + ] + } + ], + "def": "CREATE TABLE \"shared_credentials\" (\"credentialsId\" varchar(36) NOT NULL, \"projectId\" varchar(36) NOT NULL, \"role\" text NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_416f66fc846c7c442970c094ccf\" FOREIGN KEY (\"credentialsId\") REFERENCES \"credentials_entity\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_812c2852270da1247756e77f5a4\" FOREIGN KEY (\"projectId\") REFERENCES \"project\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"credentialsId\", \"projectId\"))" + }, + { + "name": "shared_workflow", + "type": "table", + "columns": [ + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "role", + "type": "TEXT", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_shared_workflow_projectId", + "def": "CREATE INDEX \"IDX_shared_workflow_projectId\" ON \"shared_workflow\" (\"projectId\") ", + "table": "shared_workflow", + "columns": [ + "projectId" + ] + }, + { + "name": "sqlite_autoindex_shared_workflow_1", + "def": "PRIMARY KEY (workflowId, projectId)", + "table": "shared_workflow", + "columns": [ + "workflowId", + "projectId" + ] + } + ], + "constraints": [ + { + "name": "workflowId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (workflowId)", + "table": "shared_workflow", + "columns": [ + "workflowId" + ] + }, + { + "name": "projectId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (projectId)", + "table": "shared_workflow", + "columns": [ + "projectId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "shared_workflow", + "referenced_table": "project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "shared_workflow", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_shared_workflow_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (workflowId, projectId)", + "table": "shared_workflow", + "columns": [ + "workflowId", + "projectId" + ] + } + ], + "def": "CREATE TABLE \"shared_workflow\" (\"workflowId\" varchar(36) NOT NULL, \"projectId\" varchar(36) NOT NULL, \"role\" text NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_daa206a04983d47d0a9c34649ce\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_a45ea5f27bcfdc21af9b4188560\" FOREIGN KEY (\"projectId\") REFERENCES \"project\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"workflowId\", \"projectId\"))" + }, + { + "name": "execution_metadata", + "type": "table", + "columns": [ + { + "name": "id", + "type": "INTEGER", + "nullable": false + }, + { + "name": "executionId", + "type": "INTEGER", + "nullable": false + }, + { + "name": "key", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "value", + "type": "TEXT", + "nullable": false + } + ], + "indexes": [ + { + "name": "IDX_cec8eea3bf49551482ccb4933e", + "def": "CREATE UNIQUE INDEX \"IDX_cec8eea3bf49551482ccb4933e\" ON \"execution_metadata\" (\"executionId\", \"key\") ", + "table": "execution_metadata", + "columns": [ + "executionId", + "key" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "execution_metadata", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "execution_metadata", + "referenced_table": "execution_entity", + "columns": [ + "executionId" + ], + "referenced_columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"execution_metadata\" (\"id\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, \"executionId\" integer NOT NULL, \"key\" varchar(255) NOT NULL, \"value\" text NOT NULL, CONSTRAINT \"FK_31d0b4c93fb85ced26f6005cda3\" FOREIGN KEY (\"executionId\") REFERENCES \"execution_entity\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "invalid_auth_token", + "type": "table", + "columns": [ + { + "name": "token", + "type": "varchar(512)", + "nullable": false + }, + { + "name": "expiresAt", + "type": "datetime(3)", + "nullable": false + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_invalid_auth_token_1", + "def": "PRIMARY KEY (token)", + "table": "invalid_auth_token", + "columns": [ + "token" + ] + } + ], + "constraints": [ + { + "name": "token", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (token)", + "table": "invalid_auth_token", + "columns": [ + "token" + ] + }, + { + "name": "sqlite_autoindex_invalid_auth_token_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (token)", + "table": "invalid_auth_token", + "columns": [ + "token" + ] + } + ], + "def": "CREATE TABLE \"invalid_auth_token\" (\"token\" varchar(512) PRIMARY KEY NOT NULL, \"expiresAt\" datetime(3) NOT NULL)" + }, + { + "name": "execution_annotations", + "type": "table", + "columns": [ + { + "name": "id", + "type": "INTEGER", + "nullable": false + }, + { + "name": "executionId", + "type": "INTEGER", + "nullable": false + }, + { + "name": "vote", + "type": "varchar(6)", + "nullable": true + }, + { + "name": "note", + "type": "TEXT", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_97f863fa83c4786f1956508496", + "def": "CREATE UNIQUE INDEX \"IDX_97f863fa83c4786f1956508496\" ON \"execution_annotations\" (\"executionId\") ", + "table": "execution_annotations", + "columns": [ + "executionId" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "execution_annotations", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "execution_annotations", + "referenced_table": "execution_entity", + "columns": [ + "executionId" + ], + "referenced_columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"execution_annotations\" (\"id\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, \"executionId\" integer NOT NULL, \"vote\" varchar(6), \"note\" text, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_97f863fa83c4786f19565084960\" FOREIGN KEY (\"executionId\") REFERENCES \"execution_entity\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "annotation_tag_entity", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(24)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_ae51b54c4bb430cf92f48b623f", + "def": "CREATE UNIQUE INDEX \"IDX_ae51b54c4bb430cf92f48b623f\" ON \"annotation_tag_entity\" (\"name\") ", + "table": "annotation_tag_entity", + "columns": [ + "name" + ] + }, + { + "name": "sqlite_autoindex_annotation_tag_entity_1", + "def": "PRIMARY KEY (id)", + "table": "annotation_tag_entity", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "annotation_tag_entity", + "columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_annotation_tag_entity_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "annotation_tag_entity", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"annotation_tag_entity\" (\"id\" varchar(16) PRIMARY KEY NOT NULL, \"name\" varchar(24) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')))" + }, + { + "name": "execution_annotation_tags", + "type": "table", + "columns": [ + { + "name": "annotationId", + "type": "INTEGER", + "nullable": false + }, + { + "name": "tagId", + "type": "varchar(24)", + "nullable": false + } + ], + "indexes": [ + { + "name": "IDX_c1519757391996eb06064f0e7c", + "def": "CREATE INDEX \"IDX_c1519757391996eb06064f0e7c\" ON \"execution_annotation_tags\" (\"annotationId\") ", + "table": "execution_annotation_tags", + "columns": [ + "annotationId" + ] + }, + { + "name": "IDX_a3697779b366e131b2bbdae297", + "def": "CREATE INDEX \"IDX_a3697779b366e131b2bbdae297\" ON \"execution_annotation_tags\" (\"tagId\") ", + "table": "execution_annotation_tags", + "columns": [ + "tagId" + ] + }, + { + "name": "sqlite_autoindex_execution_annotation_tags_1", + "def": "PRIMARY KEY (annotationId, tagId)", + "table": "execution_annotation_tags", + "columns": [ + "annotationId", + "tagId" + ] + } + ], + "constraints": [ + { + "name": "annotationId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (annotationId)", + "table": "execution_annotation_tags", + "columns": [ + "annotationId" + ] + }, + { + "name": "tagId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (tagId)", + "table": "execution_annotation_tags", + "columns": [ + "tagId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (tagId) REFERENCES annotation_tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "execution_annotation_tags", + "referenced_table": "annotation_tag_entity", + "columns": [ + "tagId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (annotationId) REFERENCES execution_annotations (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "execution_annotation_tags", + "referenced_table": "execution_annotations", + "columns": [ + "annotationId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_execution_annotation_tags_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (annotationId, tagId)", + "table": "execution_annotation_tags", + "columns": [ + "annotationId", + "tagId" + ] + } + ], + "def": "CREATE TABLE \"execution_annotation_tags\" (\"annotationId\" integer NOT NULL, \"tagId\" varchar(24) NOT NULL, CONSTRAINT \"FK_c1519757391996eb06064f0e7c8\" FOREIGN KEY (\"annotationId\") REFERENCES \"execution_annotations\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_a3697779b366e131b2bbdae2976\" FOREIGN KEY (\"tagId\") REFERENCES \"annotation_tag_entity\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"annotationId\", \"tagId\"))" + }, + { + "name": "processed_data", + "type": "table", + "columns": [ + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "context", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "value", + "type": "TEXT", + "nullable": false + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_processed_data_1", + "def": "PRIMARY KEY (workflowId, context)", + "table": "processed_data", + "columns": [ + "workflowId", + "context" + ] + } + ], + "constraints": [ + { + "name": "workflowId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (workflowId)", + "table": "processed_data", + "columns": [ + "workflowId" + ] + }, + { + "name": "context", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (context)", + "table": "processed_data", + "columns": [ + "context" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "processed_data", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_processed_data_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (workflowId, context)", + "table": "processed_data", + "columns": [ + "workflowId", + "context" + ] + } + ], + "def": "CREATE TABLE \"processed_data\" (\"workflowId\" varchar(36) NOT NULL, \"context\" varchar(255) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"value\" text NOT NULL, CONSTRAINT \"FK_06a69a7032c97a763c2c7599464\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, PRIMARY KEY (\"workflowId\", \"context\"))" + }, + { + "name": "folder", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "parentFolderId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_14f68deffaf858465715995508", + "def": "CREATE UNIQUE INDEX \"IDX_14f68deffaf858465715995508\" ON \"folder\" (\"projectId\", \"id\") ", + "table": "folder", + "columns": [ + "projectId", + "id" + ] + }, + { + "name": "sqlite_autoindex_folder_1", + "def": "PRIMARY KEY (id)", + "table": "folder", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "folder", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (parentFolderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "folder", + "referenced_table": "folder", + "columns": [ + "parentFolderId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "folder", + "referenced_table": "project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_folder_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "folder", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"folder\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"name\" varchar(128) NOT NULL, \"parentFolderId\" varchar(36), \"projectId\" varchar(36) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_a8260b0b36939c6247f385b8221\" FOREIGN KEY (\"projectId\") REFERENCES \"project\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_804ea52f6729e3940498bd54d78\" FOREIGN KEY (\"parentFolderId\") REFERENCES \"folder\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "folder_tag", + "type": "table", + "columns": [ + { + "name": "folderId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "tagId", + "type": "varchar(36)", + "nullable": false + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_folder_tag_1", + "def": "PRIMARY KEY (folderId, tagId)", + "table": "folder_tag", + "columns": [ + "folderId", + "tagId" + ] + } + ], + "constraints": [ + { + "name": "folderId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (folderId)", + "table": "folder_tag", + "columns": [ + "folderId" + ] + }, + { + "name": "tagId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (tagId)", + "table": "folder_tag", + "columns": [ + "tagId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (tagId) REFERENCES tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "folder_tag", + "referenced_table": "tag_entity", + "columns": [ + "tagId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (folderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "folder_tag", + "referenced_table": "folder", + "columns": [ + "folderId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_folder_tag_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (folderId, tagId)", + "table": "folder_tag", + "columns": [ + "folderId", + "tagId" + ] + } + ], + "def": "CREATE TABLE \"folder_tag\" (\"folderId\" varchar(36) NOT NULL, \"tagId\" varchar(36) NOT NULL, CONSTRAINT \"FK_94a60854e06f2897b2e0d39edba\" FOREIGN KEY (\"folderId\") REFERENCES \"folder\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_dc88164176283de80af47621746\" FOREIGN KEY (\"tagId\") REFERENCES \"tag_entity\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"folderId\", \"tagId\"))" + }, + { + "name": "insights_metadata", + "type": "table", + "columns": [ + { + "name": "metaId", + "type": "INTEGER", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(16)", + "nullable": true + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "workflowName", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "projectName", + "type": "varchar(255)", + "nullable": false + } + ], + "indexes": [ + { + "name": "IDX_1d8ab99d5861c9388d2dc1cf73", + "def": "CREATE UNIQUE INDEX \"IDX_1d8ab99d5861c9388d2dc1cf73\" ON \"insights_metadata\" (\"workflowId\") ", + "table": "insights_metadata", + "columns": [ + "workflowId" + ] + } + ], + "constraints": [ + { + "name": "metaId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (metaId)", + "table": "insights_metadata", + "columns": [ + "metaId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "insights_metadata", + "referenced_table": "project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "insights_metadata", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"insights_metadata\" (\"metaId\" integer PRIMARY KEY NOT NULL, \"workflowId\" varchar(16), \"projectId\" varchar(36), \"workflowName\" varchar(128) NOT NULL, \"projectName\" varchar(255) NOT NULL, CONSTRAINT \"FK_1d8ab99d5861c9388d2dc1cf733\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE SET NULL, CONSTRAINT \"FK_2375a1eda085adb16b24615b69c\" FOREIGN KEY (\"projectId\") REFERENCES \"project\" (\"id\") ON DELETE SET NULL)" + }, + { + "name": "scope", + "type": "table", + "columns": [ + { + "name": "slug", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "displayName", + "type": "TEXT", + "nullable": true + }, + { + "name": "description", + "type": "TEXT", + "nullable": true + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_scope_1", + "def": "PRIMARY KEY (slug)", + "table": "scope", + "columns": [ + "slug" + ] + } + ], + "constraints": [ + { + "name": "slug", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (slug)", + "table": "scope", + "columns": [ + "slug" + ] + }, + { + "name": "sqlite_autoindex_scope_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (slug)", + "table": "scope", + "columns": [ + "slug" + ] + } + ], + "def": "CREATE TABLE \"scope\" (\"slug\" varchar(128) PRIMARY KEY NOT NULL, \"displayName\" text, \"description\" text)" + }, + { + "name": "role_scope", + "type": "table", + "columns": [ + { + "name": "roleSlug", + "type": "VARCHAR(128)", + "nullable": false + }, + { + "name": "scopeSlug", + "type": "VARCHAR(128)", + "nullable": false + } + ], + "indexes": [ + { + "name": "IDX_role_scope_scopeSlug", + "def": "CREATE INDEX \"IDX_role_scope_scopeSlug\" ON \"role_scope\" (\"scopeSlug\") ", + "table": "role_scope", + "columns": [ + "scopeSlug" + ] + }, + { + "name": "sqlite_autoindex_role_scope_1", + "def": "PRIMARY KEY (roleSlug, scopeSlug)", + "table": "role_scope", + "columns": [ + "roleSlug", + "scopeSlug" + ] + } + ], + "constraints": [ + { + "name": "roleSlug", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (roleSlug)", + "table": "role_scope", + "columns": [ + "roleSlug" + ] + }, + { + "name": "scopeSlug", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (scopeSlug)", + "table": "role_scope", + "columns": [ + "scopeSlug" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (scopeSlug) REFERENCES scope (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE", + "table": "role_scope", + "referenced_table": "scope", + "columns": [ + "scopeSlug" + ], + "referenced_columns": [ + "slug" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (roleSlug) REFERENCES role (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE", + "table": "role_scope", + "referenced_table": "role", + "columns": [ + "roleSlug" + ], + "referenced_columns": [ + "slug" + ] + }, + { + "name": "sqlite_autoindex_role_scope_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (roleSlug, scopeSlug)", + "table": "role_scope", + "columns": [ + "roleSlug", + "scopeSlug" + ] + } + ], + "def": "CREATE TABLE role_scope (\n\t\t\t\t\t\"roleSlug\" VARCHAR(128) NOT NULL,\n\t\t\t\t\t\"scopeSlug\" VARCHAR(128) NOT NULL,\n\t\t\t\t\tCONSTRAINT \"PK_role_scope\" PRIMARY KEY (\"roleSlug\", \"scopeSlug\"),\n\t\t\t\t\tCONSTRAINT \"FK_role\" FOREIGN KEY (\"roleSlug\") REFERENCES role (\"slug\") ON DELETE CASCADE ON UPDATE CASCADE,\n\t\t\t\t\tCONSTRAINT \"FK_scope\" FOREIGN KEY (\"scopeSlug\") REFERENCES \"scope\" (\"slug\") ON DELETE CASCADE ON UPDATE CASCADE\n\t\t\t\t)" + }, + { + "name": "user", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar", + "nullable": true + }, + { + "name": "email", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "firstName", + "type": "varchar(32)", + "nullable": true + }, + { + "name": "lastName", + "type": "varchar(32)", + "nullable": true + }, + { + "name": "password", + "type": "varchar", + "nullable": true + }, + { + "name": "personalizationAnswers", + "type": "TEXT", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "settings", + "type": "TEXT", + "nullable": true + }, + { + "name": "disabled", + "type": "boolean", + "nullable": false, + "default": "FALSE" + }, + { + "name": "mfaEnabled", + "type": "boolean", + "nullable": false, + "default": "FALSE" + }, + { + "name": "mfaSecret", + "type": "TEXT", + "nullable": true + }, + { + "name": "mfaRecoveryCodes", + "type": "TEXT", + "nullable": true + }, + { + "name": "lastActiveAt", + "type": "date", + "nullable": true + }, + { + "name": "roleSlug", + "type": "varchar(128)", + "nullable": false, + "default": "'global:member'" + } + ], + "indexes": [ + { + "name": "user_role_idx", + "def": "CREATE INDEX \"user_role_idx\" ON \"user\" (\"roleSlug\") ", + "table": "user", + "columns": [ + "roleSlug" + ] + }, + { + "name": "sqlite_autoindex_user_2", + "def": "UNIQUE (email)", + "table": "user", + "columns": [ + "email" + ] + }, + { + "name": "sqlite_autoindex_user_1", + "def": "PRIMARY KEY (id)", + "table": "user", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "user", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (roleSlug) REFERENCES role (slug) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE", + "table": "user", + "referenced_table": "role", + "columns": [ + "roleSlug" + ], + "referenced_columns": [ + "slug" + ] + }, + { + "name": "sqlite_autoindex_user_2", + "type": "UNIQUE", + "def": "UNIQUE (email)", + "table": "user", + "columns": [ + "email" + ] + }, + { + "name": "sqlite_autoindex_user_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "user", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"user\" (\"id\" varchar PRIMARY KEY, \"email\" varchar(255), \"firstName\" varchar(32), \"lastName\" varchar(32), \"password\" varchar, \"personalizationAnswers\" text, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"settings\" text, \"disabled\" boolean NOT NULL DEFAULT (FALSE), \"mfaEnabled\" boolean NOT NULL DEFAULT (FALSE), \"mfaSecret\" text, \"mfaRecoveryCodes\" text, \"lastActiveAt\" date, \"roleSlug\" varchar(128) NOT NULL DEFAULT ('global:member'), CONSTRAINT \"UQ_e12875dfb3b1d92d7d7c5377e22\" UNIQUE (\"email\"), CONSTRAINT \"FK_eaea92ee7bfb9c1b6cd01505d56\" FOREIGN KEY (\"roleSlug\") REFERENCES \"role\" (\"slug\"))" + }, + { + "name": "test_case_execution", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "testRunId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "pastExecutionId", + "type": "INTEGER", + "nullable": true + }, + { + "name": "executionId", + "type": "INTEGER", + "nullable": true + }, + { + "name": "evaluationExecutionId", + "type": "INTEGER", + "nullable": true + }, + { + "name": "status", + "type": "varchar", + "nullable": false + }, + { + "name": "runAt", + "type": "datetime(3)", + "nullable": true + }, + { + "name": "completedAt", + "type": "datetime(3)", + "nullable": true + }, + { + "name": "errorCode", + "type": "varchar", + "nullable": true + }, + { + "name": "errorDetails", + "type": "TEXT", + "nullable": true + }, + { + "name": "metrics", + "type": "TEXT", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "inputs", + "type": "TEXT", + "nullable": true + }, + { + "name": "outputs", + "type": "TEXT", + "nullable": true + }, + { + "name": "runIndex", + "type": "INTEGER", + "nullable": true, + "default": "NULL" + } + ], + "indexes": [ + { + "name": "IDX_8e4b4774db42f1e6dda3452b2a", + "def": "CREATE INDEX \"IDX_8e4b4774db42f1e6dda3452b2a\" ON \"test_case_execution\" (\"testRunId\") ", + "table": "test_case_execution", + "columns": [ + "testRunId" + ] + }, + { + "name": "sqlite_autoindex_test_case_execution_1", + "def": "PRIMARY KEY (id)", + "table": "test_case_execution", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "test_case_execution", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (testRunId) REFERENCES test_run (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "test_case_execution", + "referenced_table": "test_run", + "columns": [ + "testRunId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (pastExecutionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "test_case_execution", + "referenced_table": "execution_entity", + "columns": [ + "pastExecutionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 2)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "test_case_execution", + "referenced_table": "execution_entity", + "columns": [ + "executionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 3)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (evaluationExecutionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "test_case_execution", + "referenced_table": "execution_entity", + "columns": [ + "evaluationExecutionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_test_case_execution_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "test_case_execution", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"test_case_execution\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"testRunId\" varchar(36) NOT NULL, \"pastExecutionId\" integer, \"executionId\" integer, \"evaluationExecutionId\" integer, \"status\" varchar NOT NULL, \"runAt\" datetime(3), \"completedAt\" datetime(3), \"errorCode\" varchar, \"errorDetails\" text, \"metrics\" text, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"inputs\" text, \"outputs\" text, \"runIndex\" INTEGER DEFAULT NULL, CONSTRAINT \"FK_dfbe194e3ebdfe49a87bc4692ca\" FOREIGN KEY (\"evaluationExecutionId\") REFERENCES \"execution_entity\" (\"id\") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT \"FK_e48965fac35d0f5b9e7f51d8c44\" FOREIGN KEY (\"executionId\") REFERENCES \"execution_entity\" (\"id\") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT \"FK_258d954733841d51edd826a562b\" FOREIGN KEY (\"pastExecutionId\") REFERENCES \"execution_entity\" (\"id\") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT \"FK_8e4b4774db42f1e6dda3452b2af\" FOREIGN KEY (\"testRunId\") REFERENCES \"test_run\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION)" + }, + { + "name": "project_relation", + "type": "table", + "columns": [ + { + "name": "projectId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "userId", + "type": "varchar", + "nullable": false + }, + { + "name": "role", + "type": "varchar", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "project_relation_role_project_idx", + "def": "CREATE INDEX \"project_relation_role_project_idx\" ON \"project_relation\" (\"projectId\", \"role\") ", + "table": "project_relation", + "columns": [ + "projectId", + "role" + ] + }, + { + "name": "project_relation_role_idx", + "def": "CREATE INDEX \"project_relation_role_idx\" ON \"project_relation\" (\"role\") ", + "table": "project_relation", + "columns": [ + "role" + ] + }, + { + "name": "IDX_61448d56d61802b5dfde5cdb00", + "def": "CREATE INDEX \"IDX_61448d56d61802b5dfde5cdb00\" ON \"project_relation\" (\"projectId\") ", + "table": "project_relation", + "columns": [ + "projectId" + ] + }, + { + "name": "IDX_5f0643f6717905a05164090dde", + "def": "CREATE INDEX \"IDX_5f0643f6717905a05164090dde\" ON \"project_relation\" (\"userId\") ", + "table": "project_relation", + "columns": [ + "userId" + ] + }, + { + "name": "sqlite_autoindex_project_relation_1", + "def": "PRIMARY KEY (projectId, userId)", + "table": "project_relation", + "columns": [ + "projectId", + "userId" + ] + } + ], + "constraints": [ + { + "name": "projectId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (projectId)", + "table": "project_relation", + "columns": [ + "projectId" + ] + }, + { + "name": "userId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (userId)", + "table": "project_relation", + "columns": [ + "userId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (role) REFERENCES role (slug) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE", + "table": "project_relation", + "referenced_table": "role", + "columns": [ + "role" + ], + "referenced_columns": [ + "slug" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "project_relation", + "referenced_table": "project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 2)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "project_relation", + "referenced_table": "user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_project_relation_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (projectId, userId)", + "table": "project_relation", + "columns": [ + "projectId", + "userId" + ] + } + ], + "def": "CREATE TABLE \"project_relation\" (\"projectId\" varchar(36) NOT NULL, \"userId\" varchar NOT NULL, \"role\" varchar NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_5f0643f6717905a05164090dde7\" FOREIGN KEY (\"userId\") REFERENCES \"user\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_61448d56d61802b5dfde5cdb002\" FOREIGN KEY (\"projectId\") REFERENCES \"project\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_c6b99592dc96b0d836d7a21db91\" FOREIGN KEY (\"role\") REFERENCES \"role\" (\"slug\"), PRIMARY KEY (\"projectId\", \"userId\"))" + }, + { + "name": "data_table", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_data_table_2", + "def": "UNIQUE (projectId, name)", + "table": "data_table", + "columns": [ + "projectId", + "name" + ] + }, + { + "name": "sqlite_autoindex_data_table_1", + "def": "PRIMARY KEY (id)", + "table": "data_table", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "data_table", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "data_table", + "referenced_table": "project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_data_table_2", + "type": "UNIQUE", + "def": "UNIQUE (projectId, name)", + "table": "data_table", + "columns": [ + "projectId", + "name" + ] + }, + { + "name": "sqlite_autoindex_data_table_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "data_table", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"data_table\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"name\" varchar(128) NOT NULL, \"projectId\" varchar(36) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"UQ_b23096ef747281ac944d28e8b0d\" UNIQUE (\"projectId\", \"name\"), CONSTRAINT \"FK_c2a794257dee48af7c9abf681de\" FOREIGN KEY (\"projectId\") REFERENCES \"project\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "data_table_column", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(32)", + "nullable": false + }, + { + "name": "index", + "type": "INTEGER", + "nullable": false + }, + { + "name": "dataTableId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_data_table_column_2", + "def": "UNIQUE (dataTableId, name)", + "table": "data_table_column", + "columns": [ + "dataTableId", + "name" + ] + }, + { + "name": "sqlite_autoindex_data_table_column_1", + "def": "PRIMARY KEY (id)", + "table": "data_table_column", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "data_table_column", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (dataTableId) REFERENCES data_table (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "data_table_column", + "referenced_table": "data_table", + "columns": [ + "dataTableId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_data_table_column_2", + "type": "UNIQUE", + "def": "UNIQUE (dataTableId, name)", + "table": "data_table_column", + "columns": [ + "dataTableId", + "name" + ] + }, + { + "name": "sqlite_autoindex_data_table_column_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "data_table_column", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"data_table_column\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"name\" varchar(128) NOT NULL, \"type\" varchar(32) NOT NULL, \"index\" integer NOT NULL, \"dataTableId\" varchar(36) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"UQ_8082ec4890f892f0bc77473a123\" UNIQUE (\"dataTableId\", \"name\"), CONSTRAINT \"FK_930b6e8faaf88294cef23484160\" FOREIGN KEY (\"dataTableId\") REFERENCES \"data_table\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "role", + "type": "table", + "columns": [ + { + "name": "slug", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "displayName", + "type": "TEXT", + "nullable": true + }, + { + "name": "description", + "type": "TEXT", + "nullable": true + }, + { + "name": "roleType", + "type": "TEXT", + "nullable": true + }, + { + "name": "systemRole", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_UniqueRoleDisplayName", + "def": "CREATE UNIQUE INDEX \"IDX_UniqueRoleDisplayName\" ON \"role\" (\"displayName\")", + "table": "role", + "columns": [ + "displayName" + ] + }, + { + "name": "sqlite_autoindex_role_1", + "def": "PRIMARY KEY (slug)", + "table": "role", + "columns": [ + "slug" + ] + } + ], + "constraints": [ + { + "name": "slug", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (slug)", + "table": "role", + "columns": [ + "slug" + ] + }, + { + "name": "sqlite_autoindex_role_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (slug)", + "table": "role", + "columns": [ + "slug" + ] + } + ], + "def": "CREATE TABLE \"role\" (\"slug\" varchar(128) PRIMARY KEY NOT NULL, \"displayName\" text, \"description\" text, \"roleType\" text, \"systemRole\" boolean NOT NULL DEFAULT (false), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')))" + }, + { + "name": "variables", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "key", + "type": "TEXT", + "nullable": false + }, + { + "name": "type", + "type": "TEXT", + "nullable": false, + "default": "'string'" + }, + { + "name": "value", + "type": "TEXT", + "nullable": true + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": true + } + ], + "indexes": [ + { + "name": "variables_global_key_unique", + "def": "CREATE UNIQUE INDEX \"variables_global_key_unique\"\n\t\t\t ON \"variables\" (\"key\")\n\t\t\t WHERE projectId IS NULL", + "table": "variables", + "columns": [ + "key" + ] + }, + { + "name": "variables_project_key_unique", + "def": "CREATE UNIQUE INDEX \"variables_project_key_unique\" ON \"variables\" (\"projectId\", \"key\") ", + "table": "variables", + "columns": [ + "projectId", + "key" + ] + }, + { + "name": "sqlite_autoindex_variables_1", + "def": "PRIMARY KEY (id)", + "table": "variables", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "variables", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "variables", + "referenced_table": "project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_variables_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "variables", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"variables\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"key\" text NOT NULL, \"type\" text NOT NULL DEFAULT ('string'), \"value\" text, \"projectId\" varchar(36), CONSTRAINT \"FK_a0f13eaa709a21b77a3a9721319\" FOREIGN KEY (\"projectId\") REFERENCES \"project\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "insights_raw", + "type": "table", + "columns": [ + { + "name": "id", + "type": "INTEGER", + "nullable": false + }, + { + "name": "metaId", + "type": "INTEGER", + "nullable": false + }, + { + "name": "type", + "type": "INTEGER", + "nullable": false + }, + { + "name": "value", + "type": "bigint", + "nullable": false + }, + { + "name": "timestamp", + "type": "datetime(0)", + "nullable": false, + "default": "CURRENT_TIMESTAMP" + } + ], + "indexes": [ + { + "name": "IDX_insights_raw_timestamp_id", + "def": "CREATE INDEX \"IDX_insights_raw_timestamp_id\" ON \"insights_raw\" (\"timestamp\", \"id\") ", + "table": "insights_raw", + "columns": [ + "timestamp", + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "insights_raw", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (metaId) REFERENCES insights_metadata (metaId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "insights_raw", + "referenced_table": "insights_metadata", + "columns": [ + "metaId" + ], + "referenced_columns": [ + "metaId" + ] + } + ], + "def": "CREATE TABLE \"insights_raw\" (\"id\" integer PRIMARY KEY NOT NULL, \"metaId\" integer NOT NULL, \"type\" integer NOT NULL, \"value\" bigint NOT NULL, \"timestamp\" datetime(0) NOT NULL DEFAULT (CURRENT_TIMESTAMP), CONSTRAINT \"FK_d66d942bc9907488832eb0eed81\" FOREIGN KEY (\"metaId\") REFERENCES \"insights_metadata\" (\"metaId\") ON DELETE CASCADE)" + }, + { + "name": "insights_by_period", + "type": "table", + "columns": [ + { + "name": "id", + "type": "INTEGER", + "nullable": false + }, + { + "name": "metaId", + "type": "INTEGER", + "nullable": false + }, + { + "name": "type", + "type": "INTEGER", + "nullable": false + }, + { + "name": "value", + "type": "bigint", + "nullable": false + }, + { + "name": "periodUnit", + "type": "INTEGER", + "nullable": false + }, + { + "name": "periodStart", + "type": "datetime(0)", + "nullable": true, + "default": "CURRENT_TIMESTAMP" + } + ], + "indexes": [ + { + "name": "IDX_a4da41795da1422f680c723e80", + "def": "CREATE UNIQUE INDEX \"IDX_a4da41795da1422f680c723e80\" ON \"insights_by_period\" (\"periodStart\", \"type\", \"periodUnit\", \"metaId\") ", + "table": "insights_by_period", + "columns": [ + "periodStart", + "type", + "periodUnit", + "metaId" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "insights_by_period", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (metaId) REFERENCES insights_metadata (metaId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "insights_by_period", + "referenced_table": "insights_metadata", + "columns": [ + "metaId" + ], + "referenced_columns": [ + "metaId" + ] + } + ], + "def": "CREATE TABLE \"insights_by_period\" (\"id\" integer PRIMARY KEY NOT NULL, \"metaId\" integer NOT NULL, \"type\" integer NOT NULL, \"value\" bigint NOT NULL, \"periodUnit\" integer NOT NULL, \"periodStart\" datetime(0) DEFAULT (CURRENT_TIMESTAMP), CONSTRAINT \"FK_e8881f2214df046dc2740260fe8\" FOREIGN KEY (\"metaId\") REFERENCES \"insights_metadata\" (\"metaId\") ON DELETE CASCADE)" + }, + { + "name": "oauth_clients", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar", + "nullable": false + }, + { + "name": "name", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "redirectUris", + "type": "TEXT", + "nullable": false + }, + { + "name": "grantTypes", + "type": "TEXT", + "nullable": false + }, + { + "name": "clientSecret", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "clientSecretExpiresAt", + "type": "bigint", + "nullable": true + }, + { + "name": "tokenEndpointAuthMethod", + "type": "varchar(255)", + "nullable": false, + "default": "'none'" + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_oauth_clients_1", + "def": "PRIMARY KEY (id)", + "table": "oauth_clients", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "oauth_clients", + "columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_oauth_clients_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "oauth_clients", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"oauth_clients\" (\"id\" varchar PRIMARY KEY NOT NULL, \"name\" varchar(255) NOT NULL, \"redirectUris\" text NOT NULL, \"grantTypes\" text NOT NULL, \"clientSecret\" varchar(255), \"clientSecretExpiresAt\" bigint, \"tokenEndpointAuthMethod\" varchar(255) NOT NULL DEFAULT ('none'), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')))" + }, + { + "name": "oauth_access_tokens", + "type": "table", + "columns": [ + { + "name": "token", + "type": "varchar", + "nullable": false + }, + { + "name": "clientId", + "type": "varchar", + "nullable": false + }, + { + "name": "userId", + "type": "varchar", + "nullable": false + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_oauth_access_tokens_1", + "def": "PRIMARY KEY (token)", + "table": "oauth_access_tokens", + "columns": [ + "token" + ] + } + ], + "constraints": [ + { + "name": "token", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (token)", + "table": "oauth_access_tokens", + "columns": [ + "token" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "oauth_access_tokens", + "referenced_table": "user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "oauth_access_tokens", + "referenced_table": "oauth_clients", + "columns": [ + "clientId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_oauth_access_tokens_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (token)", + "table": "oauth_access_tokens", + "columns": [ + "token" + ] + } + ], + "def": "CREATE TABLE \"oauth_access_tokens\" (\"token\" varchar PRIMARY KEY NOT NULL, \"clientId\" varchar NOT NULL, \"userId\" varchar NOT NULL, CONSTRAINT \"FK_78b26968132b7e5e45b75876481\" FOREIGN KEY (\"clientId\") REFERENCES \"oauth_clients\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_7234a36d8e49a1fa85095328845\" FOREIGN KEY (\"userId\") REFERENCES \"user\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "oauth_user_consents", + "type": "table", + "columns": [ + { + "name": "id", + "type": "INTEGER", + "nullable": false + }, + { + "name": "userId", + "type": "varchar", + "nullable": false + }, + { + "name": "clientId", + "type": "varchar", + "nullable": false + }, + { + "name": "grantedAt", + "type": "bigint", + "nullable": false + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_oauth_user_consents_1", + "def": "UNIQUE (userId, clientId)", + "table": "oauth_user_consents", + "columns": [ + "userId", + "clientId" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "oauth_user_consents", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "oauth_user_consents", + "referenced_table": "user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "oauth_user_consents", + "referenced_table": "oauth_clients", + "columns": [ + "clientId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_oauth_user_consents_1", + "type": "UNIQUE", + "def": "UNIQUE (userId, clientId)", + "table": "oauth_user_consents", + "columns": [ + "userId", + "clientId" + ] + } + ], + "def": "CREATE TABLE \"oauth_user_consents\" (\"id\" integer PRIMARY KEY NOT NULL, \"userId\" varchar NOT NULL, \"clientId\" varchar NOT NULL, \"grantedAt\" bigint NOT NULL, CONSTRAINT \"UQ_083721d99ce8db4033e2958ebb4\" UNIQUE (\"userId\", \"clientId\"), CONSTRAINT \"FK_a651acea2f6c97f8c4514935486\" FOREIGN KEY (\"clientId\") REFERENCES \"oauth_clients\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_21e6c3c2d78a097478fae6aaefa\" FOREIGN KEY (\"userId\") REFERENCES \"user\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "dynamic_credential_resolver", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "config", + "type": "TEXT", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_9c9ee9df586e60bb723234e499", + "def": "CREATE INDEX \"IDX_9c9ee9df586e60bb723234e499\" ON \"dynamic_credential_resolver\" (\"type\") ", + "table": "dynamic_credential_resolver", + "columns": [ + "type" + ] + }, + { + "name": "sqlite_autoindex_dynamic_credential_resolver_1", + "def": "PRIMARY KEY (id)", + "table": "dynamic_credential_resolver", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "dynamic_credential_resolver", + "columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_dynamic_credential_resolver_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "dynamic_credential_resolver", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"dynamic_credential_resolver\" (\"id\" varchar(16) PRIMARY KEY NOT NULL, \"name\" varchar(128) NOT NULL, \"type\" varchar(128) NOT NULL, \"config\" text NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')))" + }, + { + "name": "credentials_entity", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "data", + "type": "TEXT", + "nullable": false + }, + { + "name": "type", + "type": "varchar(32)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "isManaged", + "type": "boolean", + "nullable": false, + "default": "0" + }, + { + "name": "isGlobal", + "type": "boolean", + "nullable": false, + "default": "0" + }, + { + "name": "isResolvable", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "resolvableAllowFallback", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "resolverId", + "type": "varchar(16)", + "nullable": true + } + ], + "indexes": [ + { + "name": "idx_credentials_entity_type", + "def": "CREATE INDEX \"idx_credentials_entity_type\" ON \"credentials_entity\" (\"type\") ", + "table": "credentials_entity", + "columns": [ + "type" + ] + }, + { + "name": "sqlite_autoindex_credentials_entity_1", + "def": "PRIMARY KEY (id)", + "table": "credentials_entity", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "credentials_entity", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (resolverId) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "credentials_entity", + "referenced_table": "dynamic_credential_resolver", + "columns": [ + "resolverId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_credentials_entity_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "credentials_entity", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"credentials_entity\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"name\" varchar(128) NOT NULL, \"data\" text NOT NULL, \"type\" varchar(32) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"isManaged\" boolean NOT NULL DEFAULT (0), \"isGlobal\" boolean NOT NULL DEFAULT (0), \"isResolvable\" boolean NOT NULL DEFAULT (false), \"resolvableAllowFallback\" boolean NOT NULL DEFAULT (false), \"resolverId\" varchar(16), CONSTRAINT \"credentials_entity_resolverId_foreign\" FOREIGN KEY (\"resolverId\") REFERENCES \"dynamic_credential_resolver\" (\"id\") ON DELETE SET NULL)" + }, + { + "name": "chat_hub_messages", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar", + "nullable": false + }, + { + "name": "sessionId", + "type": "varchar", + "nullable": false + }, + { + "name": "previousMessageId", + "type": "varchar", + "nullable": true + }, + { + "name": "revisionOfMessageId", + "type": "varchar", + "nullable": true + }, + { + "name": "retryOfMessageId", + "type": "varchar", + "nullable": true + }, + { + "name": "type", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "content", + "type": "TEXT", + "nullable": false + }, + { + "name": "provider", + "type": "varchar(16)", + "nullable": true + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "executionId", + "type": "INTEGER", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "agentId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "status", + "type": "varchar(16)", + "nullable": false, + "default": "'success'" + }, + { + "name": "attachments", + "type": "TEXT", + "nullable": true + }, + { + "name": "model", + "type": "VARCHAR(256)", + "nullable": true + } + ], + "indexes": [ + { + "name": "IDX_chat_hub_messages_sessionId", + "def": "CREATE INDEX \"IDX_chat_hub_messages_sessionId\"\n\t\t\tON \"chat_hub_messages\"(\"sessionId\")", + "table": "chat_hub_messages", + "columns": [ + "sessionId" + ] + }, + { + "name": "sqlite_autoindex_chat_hub_messages_1", + "def": "PRIMARY KEY (id)", + "table": "chat_hub_messages", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "chat_hub_messages", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "chat_hub_messages", + "referenced_table": "chat_hub_agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "chat_hub_messages", + "referenced_table": "execution_entity", + "columns": [ + "executionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 2)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (revisionOfMessageId) REFERENCES chat_hub_messages (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "chat_hub_messages", + "referenced_table": "chat_hub_messages", + "columns": [ + "revisionOfMessageId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 3)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (retryOfMessageId) REFERENCES chat_hub_messages (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "chat_hub_messages", + "referenced_table": "chat_hub_messages", + "columns": [ + "retryOfMessageId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 4)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "chat_hub_messages", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 5)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (previousMessageId) REFERENCES chat_hub_messages (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "chat_hub_messages", + "referenced_table": "chat_hub_messages", + "columns": [ + "previousMessageId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 6)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (sessionId) REFERENCES chat_hub_sessions (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "chat_hub_messages", + "referenced_table": "chat_hub_sessions", + "columns": [ + "sessionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_chat_hub_messages_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "chat_hub_messages", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"chat_hub_messages\" (\"id\" varchar PRIMARY KEY NOT NULL, \"sessionId\" varchar NOT NULL, \"previousMessageId\" varchar, \"revisionOfMessageId\" varchar, \"retryOfMessageId\" varchar, \"type\" varchar(16) NOT NULL, \"name\" varchar(128) NOT NULL, \"content\" text NOT NULL, \"provider\" varchar(16), \"workflowId\" varchar(36), \"executionId\" integer, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"agentId\" varchar(36), \"status\" varchar(16) NOT NULL DEFAULT ('success'), \"attachments\" text, \"model\" VARCHAR(256), CONSTRAINT \"FK_e22538eb50a71a17954cd7e076c\" FOREIGN KEY (\"sessionId\") REFERENCES \"chat_hub_sessions\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_e5d1fa722c5a8d38ac204746662\" FOREIGN KEY (\"previousMessageId\") REFERENCES \"chat_hub_messages\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_acf8926098f063cdbbad8497fd1\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT \"FK_25c9736e7f769f3a005eef4b372\" FOREIGN KEY (\"retryOfMessageId\") REFERENCES \"chat_hub_messages\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_1f4998c8a7dec9e00a9ab15550e\" FOREIGN KEY (\"revisionOfMessageId\") REFERENCES \"chat_hub_messages\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_6afb260449dd7a9b85355d4e0c9\" FOREIGN KEY (\"executionId\") REFERENCES \"execution_entity\" (\"id\") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT \"FK_chat_hub_messages_agentId\" FOREIGN KEY (\"agentId\") REFERENCES \"chat_hub_agents\" (\"id\") ON DELETE SET NULL)" + }, + { + "name": "workflow_statistics", + "type": "table", + "columns": [ + { + "name": "id", + "type": "INTEGER", + "nullable": true + }, + { + "name": "count", + "type": "INTEGER", + "nullable": true, + "default": "0" + }, + { + "name": "latestEvent", + "type": "DATETIME", + "nullable": true + }, + { + "name": "name", + "type": "VARCHAR(128)", + "nullable": false + }, + { + "name": "workflowId", + "type": "VARCHAR(36)", + "nullable": false + }, + { + "name": "workflowName", + "type": "VARCHAR(128)", + "nullable": true + }, + { + "name": "rootCount", + "type": "INTEGER", + "nullable": true, + "default": "0" + } + ], + "indexes": [ + { + "name": "IDX_workflow_statistics_workflow_name", + "def": "CREATE UNIQUE INDEX \"IDX_workflow_statistics_workflow_name\" ON \"workflow_statistics\" (\"workflowId\", \"name\")", + "table": "workflow_statistics", + "columns": [ + "workflowId", + "name" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "workflow_statistics", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"workflow_statistics\" (\n\t\t\t\t\"id\" INTEGER PRIMARY KEY AUTOINCREMENT,\n\t\t\t\t\"count\" INTEGER DEFAULT 0,\n\t\t\t\t\"latestEvent\" DATETIME,\n\t\t\t\t\"name\" VARCHAR(128) NOT NULL,\n\t\t\t\t\"workflowId\" VARCHAR(36) NOT NULL,\n\t\t\t\t\"workflowName\" VARCHAR(128),\n\t\t\t\t\"rootCount\" INTEGER DEFAULT 0\n\t\t\t)" + }, + { + "name": "dynamic_credential_user_entry", + "type": "table", + "columns": [ + { + "name": "credentialId", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "userId", + "type": "varchar", + "nullable": false + }, + { + "name": "resolverId", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "data", + "type": "TEXT", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_6edec973a6450990977bb854c3", + "def": "CREATE INDEX \"IDX_6edec973a6450990977bb854c3\" ON \"dynamic_credential_user_entry\" (\"resolverId\") ", + "table": "dynamic_credential_user_entry", + "columns": [ + "resolverId" + ] + }, + { + "name": "IDX_a36dc616fabc3f736bb82410a2", + "def": "CREATE INDEX \"IDX_a36dc616fabc3f736bb82410a2\" ON \"dynamic_credential_user_entry\" (\"userId\") ", + "table": "dynamic_credential_user_entry", + "columns": [ + "userId" + ] + }, + { + "name": "sqlite_autoindex_dynamic_credential_user_entry_1", + "def": "PRIMARY KEY (credentialId, userId, resolverId)", + "table": "dynamic_credential_user_entry", + "columns": [ + "credentialId", + "userId", + "resolverId" + ] + } + ], + "constraints": [ + { + "name": "credentialId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (credentialId)", + "table": "dynamic_credential_user_entry", + "columns": [ + "credentialId" + ] + }, + { + "name": "userId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (userId)", + "table": "dynamic_credential_user_entry", + "columns": [ + "userId" + ] + }, + { + "name": "resolverId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (resolverId)", + "table": "dynamic_credential_user_entry", + "columns": [ + "resolverId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "dynamic_credential_user_entry", + "referenced_table": "user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (resolverId) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "dynamic_credential_user_entry", + "referenced_table": "dynamic_credential_resolver", + "columns": [ + "resolverId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 2)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "dynamic_credential_user_entry", + "referenced_table": "credentials_entity", + "columns": [ + "credentialId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_dynamic_credential_user_entry_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (credentialId, userId, resolverId)", + "table": "dynamic_credential_user_entry", + "columns": [ + "credentialId", + "userId", + "resolverId" + ] + } + ], + "def": "CREATE TABLE \"dynamic_credential_user_entry\" (\"credentialId\" varchar(16) NOT NULL, \"userId\" varchar NOT NULL, \"resolverId\" varchar(16) NOT NULL, \"data\" text NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_945ba70b342a066d1306b12ccd2\" FOREIGN KEY (\"credentialId\") REFERENCES \"credentials_entity\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_6edec973a6450990977bb854c38\" FOREIGN KEY (\"resolverId\") REFERENCES \"dynamic_credential_resolver\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_a36dc616fabc3f736bb82410a22\" FOREIGN KEY (\"userId\") REFERENCES \"user\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"credentialId\", \"userId\", \"resolverId\"))" + }, + { + "name": "workflow_dependency", + "type": "table", + "columns": [ + { + "name": "id", + "type": "INTEGER", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "workflowVersionId", + "type": "INTEGER", + "nullable": false + }, + { + "name": "dependencyType", + "type": "varchar(32)", + "nullable": false + }, + { + "name": "dependencyKey", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "indexVersionId", + "type": "smallint", + "nullable": false, + "default": "1" + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "dependencyInfo", + "type": "TEXT", + "nullable": true + }, + { + "name": "publishedVersionId", + "type": "varchar(36)", + "nullable": true + } + ], + "indexes": [ + { + "name": "IDX_workflow_dependency_publishedVersionId", + "def": "CREATE INDEX \"IDX_workflow_dependency_publishedVersionId\" ON \"workflow_dependency\" (\"publishedVersionId\") ", + "table": "workflow_dependency", + "columns": [ + "publishedVersionId" + ] + }, + { + "name": "IDX_a4ff2d9b9628ea988fa9e7d0bf", + "def": "CREATE INDEX \"IDX_a4ff2d9b9628ea988fa9e7d0bf\" ON \"workflow_dependency\" (\"workflowId\") ", + "table": "workflow_dependency", + "columns": [ + "workflowId" + ] + }, + { + "name": "IDX_e7fe1cfda990c14a445937d0b9", + "def": "CREATE INDEX \"IDX_e7fe1cfda990c14a445937d0b9\" ON \"workflow_dependency\" (\"dependencyType\") ", + "table": "workflow_dependency", + "columns": [ + "dependencyType" + ] + }, + { + "name": "IDX_e48a201071ab85d9d09119d640", + "def": "CREATE INDEX \"IDX_e48a201071ab85d9d09119d640\" ON \"workflow_dependency\" (\"dependencyKey\") ", + "table": "workflow_dependency", + "columns": [ + "dependencyKey" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "workflow_dependency", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "workflow_dependency", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"workflow_dependency\" (\"id\" integer PRIMARY KEY NOT NULL, \"workflowId\" varchar(36) NOT NULL, \"workflowVersionId\" integer NOT NULL, \"dependencyType\" varchar(32) NOT NULL, \"dependencyKey\" varchar(255) NOT NULL, \"indexVersionId\" smallint NOT NULL DEFAULT (1), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"dependencyInfo\" text, \"publishedVersionId\" varchar(36), CONSTRAINT \"FK_a4ff2d9b9628ea988fa9e7d0bf8\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION)" + }, + { + "name": "secrets_provider_connection", + "type": "table", + "columns": [ + { + "name": "id", + "type": "INTEGER", + "nullable": false + }, + { + "name": "providerKey", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "encryptedSettings", + "type": "TEXT", + "nullable": false + }, + { + "name": "isEnabled", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_secrets_provider_connection_providerKey", + "def": "CREATE UNIQUE INDEX \"IDX_secrets_provider_connection_providerKey\" ON \"secrets_provider_connection\" (\"providerKey\") ", + "table": "secrets_provider_connection", + "columns": [ + "providerKey" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "secrets_provider_connection", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"secrets_provider_connection\" (\"id\" integer PRIMARY KEY NOT NULL, \"providerKey\" varchar(128) NOT NULL, \"type\" varchar(36) NOT NULL, \"encryptedSettings\" text NOT NULL, \"isEnabled\" boolean NOT NULL DEFAULT (false), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')))" + }, + { + "name": "dynamic_credential_entry", + "type": "table", + "columns": [ + { + "name": "credential_id", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "subject_id", + "type": "varchar(2048)", + "nullable": false + }, + { + "name": "resolver_id", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "data", + "type": "TEXT", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_d61a12235d268a49af6a3c09c1", + "def": "CREATE INDEX \"IDX_d61a12235d268a49af6a3c09c1\" ON \"dynamic_credential_entry\" (\"resolver_id\") ", + "table": "dynamic_credential_entry", + "columns": [ + "resolver_id" + ] + }, + { + "name": "IDX_62476b94b56d9dc7ed9ed75d3d", + "def": "CREATE INDEX \"IDX_62476b94b56d9dc7ed9ed75d3d\" ON \"dynamic_credential_entry\" (\"subject_id\") ", + "table": "dynamic_credential_entry", + "columns": [ + "subject_id" + ] + }, + { + "name": "sqlite_autoindex_dynamic_credential_entry_1", + "def": "PRIMARY KEY (credential_id, subject_id, resolver_id)", + "table": "dynamic_credential_entry", + "columns": [ + "credential_id", + "subject_id", + "resolver_id" + ] + } + ], + "constraints": [ + { + "name": "credential_id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (credential_id)", + "table": "dynamic_credential_entry", + "columns": [ + "credential_id" + ] + }, + { + "name": "subject_id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (subject_id)", + "table": "dynamic_credential_entry", + "columns": [ + "subject_id" + ] + }, + { + "name": "resolver_id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (resolver_id)", + "table": "dynamic_credential_entry", + "columns": [ + "resolver_id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (resolver_id) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "dynamic_credential_entry", + "referenced_table": "dynamic_credential_resolver", + "columns": [ + "resolver_id" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (credential_id) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "dynamic_credential_entry", + "referenced_table": "credentials_entity", + "columns": [ + "credential_id" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_dynamic_credential_entry_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (credential_id, subject_id, resolver_id)", + "table": "dynamic_credential_entry", + "columns": [ + "credential_id", + "subject_id", + "resolver_id" + ] + } + ], + "def": "CREATE TABLE \"dynamic_credential_entry\" (\"credential_id\" varchar(16) NOT NULL, \"subject_id\" varchar(2048) NOT NULL, \"resolver_id\" varchar(16) NOT NULL, \"data\" text NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_a6d1dd080958304a47a02952aab\" FOREIGN KEY (\"credential_id\") REFERENCES \"credentials_entity\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_d61a12235d268a49af6a3c09c13\" FOREIGN KEY (\"resolver_id\") REFERENCES \"dynamic_credential_resolver\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"credential_id\", \"subject_id\", \"resolver_id\"))" + }, + { + "name": "chat_hub_tools", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar", + "nullable": false + }, + { + "name": "name", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "typeVersion", + "type": "REAL", + "nullable": false + }, + { + "name": "ownerId", + "type": "varchar", + "nullable": false + }, + { + "name": "definition", + "type": "TEXT", + "nullable": false + }, + { + "name": "enabled", + "type": "boolean", + "nullable": false, + "default": "true" + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_4c72ebdb265d1775bf61147af0", + "def": "CREATE UNIQUE INDEX \"IDX_4c72ebdb265d1775bf61147af0\" ON \"chat_hub_tools\" (\"ownerId\", \"name\") ", + "table": "chat_hub_tools", + "columns": [ + "ownerId", + "name" + ] + }, + { + "name": "sqlite_autoindex_chat_hub_tools_1", + "def": "PRIMARY KEY (id)", + "table": "chat_hub_tools", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "chat_hub_tools", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "chat_hub_tools", + "referenced_table": "user", + "columns": [ + "ownerId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_chat_hub_tools_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "chat_hub_tools", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"chat_hub_tools\" (\"id\" varchar PRIMARY KEY NOT NULL, \"name\" varchar(255) NOT NULL, \"type\" varchar(255) NOT NULL, \"typeVersion\" real NOT NULL, \"ownerId\" varchar NOT NULL, \"definition\" text NOT NULL, \"enabled\" boolean NOT NULL DEFAULT (true), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_b8030b47af9213f1fd15450fb7f\" FOREIGN KEY (\"ownerId\") REFERENCES \"user\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "chat_hub_session_tools", + "type": "table", + "columns": [ + { + "name": "sessionId", + "type": "varchar", + "nullable": false + }, + { + "name": "toolId", + "type": "varchar", + "nullable": false + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_chat_hub_session_tools_1", + "def": "PRIMARY KEY (sessionId, toolId)", + "table": "chat_hub_session_tools", + "columns": [ + "sessionId", + "toolId" + ] + } + ], + "constraints": [ + { + "name": "sessionId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (sessionId)", + "table": "chat_hub_session_tools", + "columns": [ + "sessionId" + ] + }, + { + "name": "toolId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (toolId)", + "table": "chat_hub_session_tools", + "columns": [ + "toolId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (toolId) REFERENCES chat_hub_tools (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "chat_hub_session_tools", + "referenced_table": "chat_hub_tools", + "columns": [ + "toolId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (sessionId) REFERENCES chat_hub_sessions (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "chat_hub_session_tools", + "referenced_table": "chat_hub_sessions", + "columns": [ + "sessionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_chat_hub_session_tools_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (sessionId, toolId)", + "table": "chat_hub_session_tools", + "columns": [ + "sessionId", + "toolId" + ] + } + ], + "def": "CREATE TABLE \"chat_hub_session_tools\" (\"sessionId\" varchar NOT NULL, \"toolId\" varchar NOT NULL, CONSTRAINT \"FK_e649bf1295f4ed8d4299ed290f9\" FOREIGN KEY (\"sessionId\") REFERENCES \"chat_hub_sessions\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_6596a328affd8d4967ffb303eee\" FOREIGN KEY (\"toolId\") REFERENCES \"chat_hub_tools\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"sessionId\", \"toolId\"))" + }, + { + "name": "chat_hub_agent_tools", + "type": "table", + "columns": [ + { + "name": "agentId", + "type": "varchar", + "nullable": false + }, + { + "name": "toolId", + "type": "varchar", + "nullable": false + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_chat_hub_agent_tools_1", + "def": "PRIMARY KEY (agentId, toolId)", + "table": "chat_hub_agent_tools", + "columns": [ + "agentId", + "toolId" + ] + } + ], + "constraints": [ + { + "name": "agentId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (agentId)", + "table": "chat_hub_agent_tools", + "columns": [ + "agentId" + ] + }, + { + "name": "toolId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (toolId)", + "table": "chat_hub_agent_tools", + "columns": [ + "toolId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (toolId) REFERENCES chat_hub_tools (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "chat_hub_agent_tools", + "referenced_table": "chat_hub_tools", + "columns": [ + "toolId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "chat_hub_agent_tools", + "referenced_table": "chat_hub_agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_chat_hub_agent_tools_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (agentId, toolId)", + "table": "chat_hub_agent_tools", + "columns": [ + "agentId", + "toolId" + ] + } + ], + "def": "CREATE TABLE \"chat_hub_agent_tools\" (\"agentId\" varchar NOT NULL, \"toolId\" varchar NOT NULL, CONSTRAINT \"FK_2b53d796b3dbae91b1a9553c048\" FOREIGN KEY (\"agentId\") REFERENCES \"chat_hub_agents\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_43e70f04c53344f82483d0570f6\" FOREIGN KEY (\"toolId\") REFERENCES \"chat_hub_tools\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"agentId\", \"toolId\"))" + }, + { + "name": "chat_hub_agents", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar", + "nullable": false + }, + { + "name": "name", + "type": "varchar(256)", + "nullable": false + }, + { + "name": "description", + "type": "varchar(512)", + "nullable": true + }, + { + "name": "systemPrompt", + "type": "TEXT", + "nullable": false + }, + { + "name": "ownerId", + "type": "varchar", + "nullable": false + }, + { + "name": "credentialId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "provider", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "model", + "type": "varchar(64)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "icon", + "type": "TEXT", + "nullable": true + }, + { + "name": "files", + "type": "TEXT", + "nullable": false, + "default": "'[]'" + }, + { + "name": "suggestedPrompts", + "type": "TEXT", + "nullable": false, + "default": "'[]'" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_chat_hub_agents_1", + "def": "PRIMARY KEY (id)", + "table": "chat_hub_agents", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "chat_hub_agents", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "chat_hub_agents", + "referenced_table": "user", + "columns": [ + "ownerId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "chat_hub_agents", + "referenced_table": "credentials_entity", + "columns": [ + "credentialId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_chat_hub_agents_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "chat_hub_agents", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"chat_hub_agents\" (\"id\" varchar PRIMARY KEY NOT NULL, \"name\" varchar(256) NOT NULL, \"description\" varchar(512), \"systemPrompt\" text NOT NULL, \"ownerId\" varchar NOT NULL, \"credentialId\" varchar(36), \"provider\" varchar(16) NOT NULL, \"model\" varchar(64) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"icon\" text, \"files\" text NOT NULL DEFAULT ('[]'), \"suggestedPrompts\" text NOT NULL DEFAULT ('[]'), CONSTRAINT \"FK_9c61ad497dcbae499c96a6a78ba\" FOREIGN KEY (\"credentialId\") REFERENCES \"credentials_entity\" (\"id\") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT \"FK_441ba2caba11e077ce3fbfa2cd8\" FOREIGN KEY (\"ownerId\") REFERENCES \"user\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION)" + }, + { + "name": "project_secrets_provider_access", + "type": "table", + "columns": [ + { + "name": "secretsProviderConnectionId", + "type": "INTEGER", + "nullable": false + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "role", + "type": "varchar(128)", + "nullable": false, + "default": "'secretsProviderConnection:user'" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_project_secrets_provider_access_1", + "def": "PRIMARY KEY (secretsProviderConnectionId, projectId)", + "table": "project_secrets_provider_access", + "columns": [ + "secretsProviderConnectionId", + "projectId" + ] + } + ], + "constraints": [ + { + "name": "secretsProviderConnectionId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (secretsProviderConnectionId)", + "table": "project_secrets_provider_access", + "columns": [ + "secretsProviderConnectionId" + ] + }, + { + "name": "projectId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (projectId)", + "table": "project_secrets_provider_access", + "columns": [ + "projectId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (secretsProviderConnectionId) REFERENCES secrets_provider_connection (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "project_secrets_provider_access", + "referenced_table": "secrets_provider_connection", + "columns": [ + "secretsProviderConnectionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "project_secrets_provider_access", + "referenced_table": "project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_project_secrets_provider_access_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (secretsProviderConnectionId, projectId)", + "table": "project_secrets_provider_access", + "columns": [ + "secretsProviderConnectionId", + "projectId" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK (\"role\" IN ('secretsProviderConnection:owner', 'secretsProviderConnection:user'))", + "table": "project_secrets_provider_access", + "columns": [ + "role" + ] + } + ], + "def": "CREATE TABLE \"project_secrets_provider_access\" (\"secretsProviderConnectionId\" integer NOT NULL, \"projectId\" varchar(36) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"role\" varchar(128) NOT NULL DEFAULT ('secretsProviderConnection:user'), CONSTRAINT \"CHK_project_secrets_provider_access_role\" CHECK (\"role\" IN ('secretsProviderConnection:owner', 'secretsProviderConnection:user')), CONSTRAINT \"FK_bd264b81209355b543878deedb1\" FOREIGN KEY (\"projectId\") REFERENCES \"project\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_18e5c27d2524b1638b292904e48\" FOREIGN KEY (\"secretsProviderConnectionId\") REFERENCES \"secrets_provider_connection\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, PRIMARY KEY (\"secretsProviderConnectionId\", \"projectId\"))" + }, + { + "name": "workflow_published_version", + "type": "table", + "columns": [ + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "publishedVersionId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_workflow_published_version_1", + "def": "PRIMARY KEY (workflowId)", + "table": "workflow_published_version", + "columns": [ + "workflowId" + ] + } + ], + "constraints": [ + { + "name": "workflowId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (workflowId)", + "table": "workflow_published_version", + "columns": [ + "workflowId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (publishedVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE", + "table": "workflow_published_version", + "referenced_table": "workflow_history", + "columns": [ + "publishedVersionId" + ], + "referenced_columns": [ + "versionId" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE", + "table": "workflow_published_version", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 2)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "workflow_published_version", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 3)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (publishedVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "workflow_published_version", + "referenced_table": "workflow_history", + "columns": [ + "publishedVersionId" + ], + "referenced_columns": [ + "versionId" + ] + }, + { + "name": "sqlite_autoindex_workflow_published_version_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (workflowId)", + "table": "workflow_published_version", + "columns": [ + "workflowId" + ] + } + ], + "def": "CREATE TABLE \"workflow_published_version\" (\"workflowId\" varchar(36) PRIMARY KEY NOT NULL, \"publishedVersionId\" varchar(36) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_df3428a541b802d6a63ac56e330\" FOREIGN KEY (\"publishedVersionId\") REFERENCES \"workflow_history\" (\"versionId\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_5c76fb7ee939fe2530374d3f75a\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_5c76fb7ee939fe2530374d3f75a\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE RESTRICT, CONSTRAINT \"FK_df3428a541b802d6a63ac56e330\" FOREIGN KEY (\"publishedVersionId\") REFERENCES \"workflow_history\" (\"versionId\") ON DELETE RESTRICT)" + }, + { + "name": "chat_hub_sessions", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar", + "nullable": false + }, + { + "name": "title", + "type": "varchar(256)", + "nullable": false + }, + { + "name": "ownerId", + "type": "varchar", + "nullable": false + }, + { + "name": "lastMessageAt", + "type": "datetime(3)", + "nullable": false + }, + { + "name": "credentialId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "provider", + "type": "varchar(16)", + "nullable": true + }, + { + "name": "model", + "type": "varchar(64)", + "nullable": true + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "agentId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "agentName", + "type": "varchar(128)", + "nullable": true + }, + { + "name": "type", + "type": "varchar(16)", + "nullable": false, + "default": "'production'" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_chat_hub_sessions_1", + "def": "PRIMARY KEY (id)", + "table": "chat_hub_sessions", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "chat_hub_sessions", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "chat_hub_sessions", + "referenced_table": "user", + "columns": [ + "ownerId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "chat_hub_sessions", + "referenced_table": "credentials_entity", + "columns": [ + "credentialId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 2)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "chat_hub_sessions", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 3)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "chat_hub_sessions", + "referenced_table": "chat_hub_agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_chat_hub_sessions_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "chat_hub_sessions", + "columns": [ + "id" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK (\"type\" IN ('production', 'manual'))", + "table": "chat_hub_sessions", + "columns": [ + "type" + ] + } + ], + "def": "CREATE TABLE \"chat_hub_sessions\" (\"id\" varchar PRIMARY KEY NOT NULL, \"title\" varchar(256) NOT NULL, \"ownerId\" varchar NOT NULL, \"lastMessageAt\" datetime(3) NOT NULL, \"credentialId\" varchar(36), \"provider\" varchar(16), \"model\" varchar(64), \"workflowId\" varchar(36), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"agentId\" varchar(36), \"agentName\" varchar(128), \"type\" varchar(16) NOT NULL DEFAULT ('production'), CONSTRAINT \"CHK_chat_hub_sessions_type\" CHECK (\"type\" IN ('production', 'manual')), CONSTRAINT \"FK_chat_hub_sessions_agentId\" FOREIGN KEY (\"agentId\") REFERENCES \"chat_hub_agents\" (\"id\") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT \"FK_9f9293d9f552496c40e0d1a8f80\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT \"FK_7bc13b4c7e6afbfaf9be326c189\" FOREIGN KEY (\"credentialId\") REFERENCES \"credentials_entity\" (\"id\") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT \"FK_e9ecf8ede7d989fcd18790fe36a\" FOREIGN KEY (\"ownerId\") REFERENCES \"user\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION)" + }, + { + "name": "role_mapping_rule", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "expression", + "type": "TEXT", + "nullable": false + }, + { + "name": "role", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(64)", + "nullable": false + }, + { + "name": "order", + "type": "INTEGER", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_bb66e404c35996b0d694617750", + "def": "CREATE INDEX \"IDX_bb66e404c35996b0d694617750\" ON \"role_mapping_rule\" (\"role\") ", + "table": "role_mapping_rule", + "columns": [ + "role" + ] + }, + { + "name": "sqlite_autoindex_role_mapping_rule_2", + "def": "UNIQUE (type, order)", + "table": "role_mapping_rule", + "columns": [ + "type", + "order" + ] + }, + { + "name": "sqlite_autoindex_role_mapping_rule_1", + "def": "PRIMARY KEY (id)", + "table": "role_mapping_rule", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "role_mapping_rule", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (role) REFERENCES role (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE", + "table": "role_mapping_rule", + "referenced_table": "role", + "columns": [ + "role" + ], + "referenced_columns": [ + "slug" + ] + }, + { + "name": "sqlite_autoindex_role_mapping_rule_2", + "type": "UNIQUE", + "def": "UNIQUE (type, order)", + "table": "role_mapping_rule", + "columns": [ + "type", + "order" + ] + }, + { + "name": "sqlite_autoindex_role_mapping_rule_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "role_mapping_rule", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"role_mapping_rule\" (\"id\" varchar(16) PRIMARY KEY NOT NULL, \"expression\" text NOT NULL, \"role\" varchar(128) NOT NULL, \"type\" varchar(64) NOT NULL, \"order\" integer NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"UQ_b33ac896ad3099fc8de36fdc1c4\" UNIQUE (\"type\", \"order\"), CONSTRAINT \"FK_bb66e404c35996b0d6946177501\" FOREIGN KEY (\"role\") REFERENCES \"role\" (\"slug\") ON DELETE CASCADE ON UPDATE CASCADE)" + }, + { + "name": "role_mapping_rule_project", + "type": "table", + "columns": [ + { + "name": "roleMappingRuleId", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": false + } + ], + "indexes": [ + { + "name": "IDX_35a78869286c65d9330d02b88f", + "def": "CREATE INDEX \"IDX_35a78869286c65d9330d02b88f\" ON \"role_mapping_rule_project\" (\"projectId\") ", + "table": "role_mapping_rule_project", + "columns": [ + "projectId" + ] + }, + { + "name": "sqlite_autoindex_role_mapping_rule_project_1", + "def": "PRIMARY KEY (roleMappingRuleId, projectId)", + "table": "role_mapping_rule_project", + "columns": [ + "roleMappingRuleId", + "projectId" + ] + } + ], + "constraints": [ + { + "name": "roleMappingRuleId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (roleMappingRuleId)", + "table": "role_mapping_rule_project", + "columns": [ + "roleMappingRuleId" + ] + }, + { + "name": "projectId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (projectId)", + "table": "role_mapping_rule_project", + "columns": [ + "projectId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "role_mapping_rule_project", + "referenced_table": "project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (roleMappingRuleId) REFERENCES role_mapping_rule (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "role_mapping_rule_project", + "referenced_table": "role_mapping_rule", + "columns": [ + "roleMappingRuleId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_role_mapping_rule_project_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (roleMappingRuleId, projectId)", + "table": "role_mapping_rule_project", + "columns": [ + "roleMappingRuleId", + "projectId" + ] + } + ], + "def": "CREATE TABLE \"role_mapping_rule_project\" (\"roleMappingRuleId\" varchar(16) NOT NULL, \"projectId\" varchar(36) NOT NULL, CONSTRAINT \"FK_dd7ce4dfa09e95b36a626bd9de3\" FOREIGN KEY (\"roleMappingRuleId\") REFERENCES \"role_mapping_rule\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_35a78869286c65d9330d02b88f5\" FOREIGN KEY (\"projectId\") REFERENCES \"project\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"roleMappingRuleId\", \"projectId\"))" + }, + { + "name": "credential_dependency", + "type": "table", + "columns": [ + { + "name": "id", + "type": "INTEGER", + "nullable": false + }, + { + "name": "credentialId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "dependencyType", + "type": "varchar(64)", + "nullable": false + }, + { + "name": "dependencyId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_credential_dependency_credentialId_dependencyType_dependencyId", + "def": "CREATE UNIQUE INDEX \"IDX_credential_dependency_credentialId_dependencyType_dependencyId\" ON \"credential_dependency\" (\"credentialId\", \"dependencyType\", \"dependencyId\") ", + "table": "credential_dependency", + "columns": [ + "credentialId", + "dependencyType", + "dependencyId" + ] + }, + { + "name": "IDX_91ee85fa9619dd6776725e117b", + "def": "CREATE INDEX \"IDX_91ee85fa9619dd6776725e117b\" ON \"credential_dependency\" (\"dependencyType\", \"dependencyId\") ", + "table": "credential_dependency", + "columns": [ + "dependencyType", + "dependencyId" + ] + }, + { + "name": "IDX_5ec8e8c8d3539f3696cf73b43b", + "def": "CREATE INDEX \"IDX_5ec8e8c8d3539f3696cf73b43b\" ON \"credential_dependency\" (\"credentialId\") ", + "table": "credential_dependency", + "columns": [ + "credentialId" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "credential_dependency", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "credential_dependency", + "referenced_table": "credentials_entity", + "columns": [ + "credentialId" + ], + "referenced_columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"credential_dependency\" (\"id\" integer PRIMARY KEY NOT NULL, \"credentialId\" varchar(36) NOT NULL, \"dependencyType\" varchar(64) NOT NULL, \"dependencyId\" varchar(255) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_5ec8e8c8d3539f3696cf73b43bf\" FOREIGN KEY (\"credentialId\") REFERENCES \"credentials_entity\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "workflow_builder_session", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "userId", + "type": "varchar", + "nullable": false + }, + { + "name": "messages", + "type": "TEXT", + "nullable": false, + "default": "'[]'" + }, + { + "name": "previousSummary", + "type": "TEXT", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "activeVersionCardId", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "resumeAfterRestoreMessageId", + "type": "varchar(255)", + "nullable": true + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_workflow_builder_session_2", + "def": "UNIQUE (workflowId, userId)", + "table": "workflow_builder_session", + "columns": [ + "workflowId", + "userId" + ] + }, + { + "name": "sqlite_autoindex_workflow_builder_session_1", + "def": "PRIMARY KEY (id)", + "table": "workflow_builder_session", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "workflow_builder_session", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "workflow_builder_session", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "workflow_builder_session", + "referenced_table": "user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_workflow_builder_session_2", + "type": "UNIQUE", + "def": "UNIQUE (workflowId, userId)", + "table": "workflow_builder_session", + "columns": [ + "workflowId", + "userId" + ] + }, + { + "name": "sqlite_autoindex_workflow_builder_session_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "workflow_builder_session", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"workflow_builder_session\" (\"id\" varchar PRIMARY KEY NOT NULL, \"workflowId\" varchar(36) NOT NULL, \"userId\" varchar NOT NULL, \"messages\" text NOT NULL DEFAULT ('[]'), \"previousSummary\" text, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"activeVersionCardId\" varchar(255), \"resumeAfterRestoreMessageId\" varchar(255), CONSTRAINT \"UQ_ec2aa73632932d485a1d5192ce1\" UNIQUE (\"workflowId\", \"userId\"), CONSTRAINT \"FK_00290cdeee4d4d7db84709be936\" FOREIGN KEY (\"userId\") REFERENCES \"user\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_7983c618db48f47bf5a4cc1e1e4\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION)" + }, + { + "name": "instance_version_history", + "type": "table", + "columns": [ + { + "name": "id", + "type": "INTEGER", + "nullable": false + }, + { + "name": "major", + "type": "INTEGER", + "nullable": false + }, + { + "name": "minor", + "type": "INTEGER", + "nullable": false + }, + { + "name": "patch", + "type": "INTEGER", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "instance_version_history", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"instance_version_history\" (\"id\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, \"major\" integer NOT NULL, \"minor\" integer NOT NULL, \"patch\" integer NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')))" + }, + { + "name": "instance_ai_messages", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "threadId", + "type": "varchar", + "nullable": false + }, + { + "name": "content", + "type": "TEXT", + "nullable": false + }, + { + "name": "role", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(32)", + "nullable": true + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_76e212c6867fbaa06bf0decd6f", + "def": "CREATE INDEX \"IDX_76e212c6867fbaa06bf0decd6f\" ON \"instance_ai_messages\" (\"resourceId\") ", + "table": "instance_ai_messages", + "columns": [ + "resourceId" + ] + }, + { + "name": "IDX_1eeb64cb9d66a927988de759e6", + "def": "CREATE INDEX \"IDX_1eeb64cb9d66a927988de759e6\" ON \"instance_ai_messages\" (\"threadId\") ", + "table": "instance_ai_messages", + "columns": [ + "threadId" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_messages_1", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_messages", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_messages", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "instance_ai_messages", + "referenced_table": "instance_ai_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_messages_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_messages", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"instance_ai_messages\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"threadId\" varchar NOT NULL, \"content\" text NOT NULL, \"role\" varchar(16) NOT NULL, \"type\" varchar(32), \"resourceId\" varchar(255), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_1eeb64cb9d66a927988de759e6e\" FOREIGN KEY (\"threadId\") REFERENCES \"instance_ai_threads\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "instance_ai_resources", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "workingMemory", + "type": "TEXT", + "nullable": true + }, + { + "name": "metadata", + "type": "TEXT", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_instance_ai_resources_1", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_resources", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_resources", + "columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_resources_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_resources", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"instance_ai_resources\" (\"id\" varchar(255) PRIMARY KEY NOT NULL, \"workingMemory\" text, \"metadata\" text, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')))" + }, + { + "name": "instance_ai_observational_memory", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "lookupKey", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "scope", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "threadId", + "type": "varchar", + "nullable": true + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "activeObservations", + "type": "TEXT", + "nullable": false, + "default": "''" + }, + { + "name": "originType", + "type": "varchar(32)", + "nullable": false + }, + { + "name": "config", + "type": "TEXT", + "nullable": false + }, + { + "name": "generationCount", + "type": "INTEGER", + "nullable": false, + "default": "0" + }, + { + "name": "lastObservedAt", + "type": "datetime(3)", + "nullable": true + }, + { + "name": "pendingMessageTokens", + "type": "INTEGER", + "nullable": false, + "default": "0" + }, + { + "name": "totalTokensObserved", + "type": "INTEGER", + "nullable": false, + "default": "0" + }, + { + "name": "observationTokenCount", + "type": "INTEGER", + "nullable": false, + "default": "0" + }, + { + "name": "isObserving", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "isReflecting", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "observedMessageIds", + "type": "TEXT", + "nullable": true + }, + { + "name": "observedTimezone", + "type": "varchar", + "nullable": true + }, + { + "name": "bufferedObservations", + "type": "TEXT", + "nullable": true + }, + { + "name": "bufferedObservationTokens", + "type": "INTEGER", + "nullable": true + }, + { + "name": "bufferedMessageIds", + "type": "TEXT", + "nullable": true + }, + { + "name": "bufferedReflection", + "type": "TEXT", + "nullable": true + }, + { + "name": "bufferedReflectionTokens", + "type": "INTEGER", + "nullable": true + }, + { + "name": "bufferedReflectionInputTokens", + "type": "INTEGER", + "nullable": true + }, + { + "name": "reflectedObservationLineCount", + "type": "INTEGER", + "nullable": true + }, + { + "name": "bufferedObservationChunks", + "type": "TEXT", + "nullable": true + }, + { + "name": "isBufferingObservation", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "isBufferingReflection", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "lastBufferedAtTokens", + "type": "INTEGER", + "nullable": false, + "default": "0" + }, + { + "name": "lastBufferedAtTime", + "type": "datetime(3)", + "nullable": true + }, + { + "name": "metadata", + "type": "TEXT", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_a680ac96aae02dc887bbaac512", + "def": "CREATE UNIQUE INDEX \"IDX_a680ac96aae02dc887bbaac512\" ON \"instance_ai_observational_memory\" (\"scope\", \"threadId\", \"resourceId\") ", + "table": "instance_ai_observational_memory", + "columns": [ + "scope", + "threadId", + "resourceId" + ] + }, + { + "name": "IDX_92f13cb6bc694227e069447f7b", + "def": "CREATE INDEX \"IDX_92f13cb6bc694227e069447f7b\" ON \"instance_ai_observational_memory\" (\"lookupKey\") ", + "table": "instance_ai_observational_memory", + "columns": [ + "lookupKey" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_observational_memory_1", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_observational_memory", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_observational_memory", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "instance_ai_observational_memory", + "referenced_table": "instance_ai_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_observational_memory_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_observational_memory", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"instance_ai_observational_memory\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"lookupKey\" varchar(255) NOT NULL, \"scope\" varchar(16) NOT NULL, \"threadId\" varchar, \"resourceId\" varchar(255) NOT NULL, \"activeObservations\" text NOT NULL DEFAULT (''), \"originType\" varchar(32) NOT NULL, \"config\" text NOT NULL, \"generationCount\" integer NOT NULL DEFAULT (0), \"lastObservedAt\" datetime(3), \"pendingMessageTokens\" integer NOT NULL DEFAULT (0), \"totalTokensObserved\" integer NOT NULL DEFAULT (0), \"observationTokenCount\" integer NOT NULL DEFAULT (0), \"isObserving\" boolean NOT NULL DEFAULT (false), \"isReflecting\" boolean NOT NULL DEFAULT (false), \"observedMessageIds\" text, \"observedTimezone\" varchar, \"bufferedObservations\" text, \"bufferedObservationTokens\" integer, \"bufferedMessageIds\" text, \"bufferedReflection\" text, \"bufferedReflectionTokens\" integer, \"bufferedReflectionInputTokens\" integer, \"reflectedObservationLineCount\" integer, \"bufferedObservationChunks\" text, \"isBufferingObservation\" boolean NOT NULL DEFAULT (false), \"isBufferingReflection\" boolean NOT NULL DEFAULT (false), \"lastBufferedAtTokens\" integer NOT NULL DEFAULT (0), \"lastBufferedAtTime\" datetime(3), \"metadata\" text, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_34018c303885cd37093458e6409\" FOREIGN KEY (\"threadId\") REFERENCES \"instance_ai_threads\" (\"id\") ON DELETE SET NULL)" + }, + { + "name": "instance_ai_workflow_snapshots", + "type": "table", + "columns": [ + { + "name": "runId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "workflowName", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "status", + "type": "varchar", + "nullable": true + }, + { + "name": "snapshot", + "type": "TEXT", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_a371ee6b8e0ebb5635f8baa46d", + "def": "CREATE INDEX \"IDX_a371ee6b8e0ebb5635f8baa46d\" ON \"instance_ai_workflow_snapshots\" (\"workflowName\", \"status\") ", + "table": "instance_ai_workflow_snapshots", + "columns": [ + "workflowName", + "status" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_workflow_snapshots_1", + "def": "PRIMARY KEY (runId, workflowName)", + "table": "instance_ai_workflow_snapshots", + "columns": [ + "runId", + "workflowName" + ] + } + ], + "constraints": [ + { + "name": "runId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (runId)", + "table": "instance_ai_workflow_snapshots", + "columns": [ + "runId" + ] + }, + { + "name": "workflowName", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (workflowName)", + "table": "instance_ai_workflow_snapshots", + "columns": [ + "workflowName" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_workflow_snapshots_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (runId, workflowName)", + "table": "instance_ai_workflow_snapshots", + "columns": [ + "runId", + "workflowName" + ] + } + ], + "def": "CREATE TABLE \"instance_ai_workflow_snapshots\" (\"runId\" varchar(36) NOT NULL, \"workflowName\" varchar(255) NOT NULL, \"resourceId\" varchar(255), \"status\" varchar, \"snapshot\" text NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), PRIMARY KEY (\"runId\", \"workflowName\"))" + }, + { + "name": "instance_ai_iteration_logs", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "threadId", + "type": "varchar", + "nullable": false + }, + { + "name": "taskKey", + "type": "varchar", + "nullable": false + }, + { + "name": "entry", + "type": "TEXT", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_02751202c9a2ad75f2d8e14f5e", + "def": "CREATE INDEX \"IDX_02751202c9a2ad75f2d8e14f5e\" ON \"instance_ai_iteration_logs\" (\"threadId\", \"taskKey\", \"createdAt\") ", + "table": "instance_ai_iteration_logs", + "columns": [ + "threadId", + "taskKey", + "createdAt" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_iteration_logs_1", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_iteration_logs", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_iteration_logs", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "instance_ai_iteration_logs", + "referenced_table": "instance_ai_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_iteration_logs_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_iteration_logs", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"instance_ai_iteration_logs\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"threadId\" varchar NOT NULL, \"taskKey\" varchar NOT NULL, \"entry\" text NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_8bfcc6c51fd3d69b1eae8aebd49\" FOREIGN KEY (\"threadId\") REFERENCES \"instance_ai_threads\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "token_exchange_jti", + "type": "table", + "columns": [ + { + "name": "jti", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "expiresAt", + "type": "datetime(3)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_token_exchange_jti_1", + "def": "PRIMARY KEY (jti)", + "table": "token_exchange_jti", + "columns": [ + "jti" + ] + } + ], + "constraints": [ + { + "name": "jti", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (jti)", + "table": "token_exchange_jti", + "columns": [ + "jti" + ] + }, + { + "name": "sqlite_autoindex_token_exchange_jti_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (jti)", + "table": "token_exchange_jti", + "columns": [ + "jti" + ] + } + ], + "def": "CREATE TABLE \"token_exchange_jti\" (\"jti\" varchar(255) PRIMARY KEY NOT NULL, \"expiresAt\" datetime(3) NOT NULL, \"createdAt\" datetime(3) NOT NULL)" + }, + { + "name": "workflow_publish_history", + "type": "table", + "columns": [ + { + "name": "id", + "type": "INTEGER", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "versionId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "event", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "userId", + "type": "varchar", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_070b5de842ece9ccdda0d9738b", + "def": "CREATE INDEX \"IDX_070b5de842ece9ccdda0d9738b\" ON \"workflow_publish_history\" (\"workflowId\", \"versionId\") ", + "table": "workflow_publish_history", + "columns": [ + "workflowId", + "versionId" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "workflow_publish_history", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (versionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "workflow_publish_history", + "referenced_table": "workflow_history", + "columns": [ + "versionId" + ], + "referenced_columns": [ + "versionId" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "workflow_publish_history", + "referenced_table": "user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 2)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (versionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "workflow_publish_history", + "referenced_table": "workflow_history", + "columns": [ + "versionId" + ], + "referenced_columns": [ + "versionId" + ] + }, + { + "name": "- (Foreign key ID: 3)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "workflow_publish_history", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK (((\"event\" IN ('activated', 'deactivated'))))", + "table": "workflow_publish_history", + "columns": [ + "event" + ] + } + ], + "def": "CREATE TABLE \"workflow_publish_history\" (\"id\" integer PRIMARY KEY NOT NULL, \"workflowId\" varchar(36) NOT NULL, \"versionId\" varchar(36), \"event\" varchar(36) NOT NULL, \"userId\" varchar, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"CHK_workflow_publish_history_event\" CHECK (((\"event\" IN ('activated', 'deactivated')))), CONSTRAINT \"FK_c01316f8c2d7101ec4fa9809267\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_b4cfbc7556d07f36ca177f5e473\" FOREIGN KEY (\"versionId\") REFERENCES \"workflow_history\" (\"versionId\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_6eab5bd9eedabe9c54bd879fc40\" FOREIGN KEY (\"userId\") REFERENCES \"user\" (\"id\") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT \"FK_b4cfbc7556d07f36ca177f5e473\" FOREIGN KEY (\"versionId\") REFERENCES \"workflow_history\" (\"versionId\") ON DELETE SET NULL)" + }, + { + "name": "trusted_key_source", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(32)", + "nullable": false + }, + { + "name": "config", + "type": "TEXT", + "nullable": false + }, + { + "name": "status", + "type": "varchar(32)", + "nullable": false, + "default": "'pending'" + }, + { + "name": "lastError", + "type": "TEXT", + "nullable": true + }, + { + "name": "lastRefreshedAt", + "type": "datetime(3)", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_trusted_key_source_1", + "def": "PRIMARY KEY (id)", + "table": "trusted_key_source", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "trusted_key_source", + "columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_trusted_key_source_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "trusted_key_source", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"trusted_key_source\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"type\" varchar(32) NOT NULL, \"config\" text NOT NULL, \"status\" varchar(32) NOT NULL DEFAULT ('pending'), \"lastError\" text, \"lastRefreshedAt\" datetime(3), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')))" + }, + { + "name": "trusted_key", + "type": "table", + "columns": [ + { + "name": "sourceId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "kid", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "data", + "type": "TEXT", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_trusted_key_1", + "def": "PRIMARY KEY (sourceId, kid)", + "table": "trusted_key", + "columns": [ + "sourceId", + "kid" + ] + } + ], + "constraints": [ + { + "name": "sourceId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (sourceId)", + "table": "trusted_key", + "columns": [ + "sourceId" + ] + }, + { + "name": "kid", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (kid)", + "table": "trusted_key", + "columns": [ + "kid" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (sourceId) REFERENCES trusted_key_source (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "trusted_key", + "referenced_table": "trusted_key_source", + "columns": [ + "sourceId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_trusted_key_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (sourceId, kid)", + "table": "trusted_key", + "columns": [ + "sourceId", + "kid" + ] + } + ], + "def": "CREATE TABLE \"trusted_key\" (\"sourceId\" varchar(36) NOT NULL, \"kid\" varchar(255) NOT NULL, \"data\" text NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_8c2938d746943dd8f608d23c891\" FOREIGN KEY (\"sourceId\") REFERENCES \"trusted_key_source\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"sourceId\", \"kid\"))" + }, + { + "name": "user_favorites", + "type": "table", + "columns": [ + { + "name": "id", + "type": "INTEGER", + "nullable": false + }, + { + "name": "userId", + "type": "varchar", + "nullable": false + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "resourceType", + "type": "varchar(64)", + "nullable": false + } + ], + "indexes": [ + { + "name": "IDX_1d11050a381548c42c32cc25c4", + "def": "CREATE INDEX \"IDX_1d11050a381548c42c32cc25c4\" ON \"user_favorites\" (\"resourceType\", \"resourceId\") ", + "table": "user_favorites", + "columns": [ + "resourceType", + "resourceId" + ] + }, + { + "name": "IDX_1dd5c393ad0517be3c31a7af83", + "def": "CREATE INDEX \"IDX_1dd5c393ad0517be3c31a7af83\" ON \"user_favorites\" (\"userId\") ", + "table": "user_favorites", + "columns": [ + "userId" + ] + }, + { + "name": "sqlite_autoindex_user_favorites_1", + "def": "UNIQUE (userId, resourceId, resourceType)", + "table": "user_favorites", + "columns": [ + "userId", + "resourceId", + "resourceType" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "user_favorites", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "user_favorites", + "referenced_table": "user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_user_favorites_1", + "type": "UNIQUE", + "def": "UNIQUE (userId, resourceId, resourceType)", + "table": "user_favorites", + "columns": [ + "userId", + "resourceId", + "resourceType" + ] + } + ], + "def": "CREATE TABLE \"user_favorites\" (\"id\" integer PRIMARY KEY NOT NULL, \"userId\" varchar NOT NULL, \"resourceId\" varchar(255) NOT NULL, \"resourceType\" varchar(64) NOT NULL, CONSTRAINT \"UQ_cf6ae658ead9ffc124723413c65\" UNIQUE (\"userId\", \"resourceId\", \"resourceType\"), CONSTRAINT \"FK_1dd5c393ad0517be3c31a7af836\" FOREIGN KEY (\"userId\") REFERENCES \"user\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "deployment_key", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(64)", + "nullable": false + }, + { + "name": "value", + "type": "TEXT", + "nullable": false + }, + { + "name": "algorithm", + "type": "varchar(20)", + "nullable": true + }, + { + "name": "status", + "type": "varchar(20)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_deployment_key_jwe_private_key_active", + "def": "CREATE UNIQUE INDEX \"IDX_deployment_key_jwe_private_key_active\" ON \"deployment_key\" (\"type\", \"algorithm\") WHERE status = 'active' AND type = 'jwe.private-key'", + "table": "deployment_key", + "columns": [ + "type", + "algorithm" + ] + }, + { + "name": "IDX_deployment_key_signing_binary_data_active", + "def": "CREATE UNIQUE INDEX \"IDX_deployment_key_signing_binary_data_active\" ON \"deployment_key\" (\"type\") WHERE status = 'active' AND type = 'signing.binary_data'", + "table": "deployment_key", + "columns": [ + "type" + ] + }, + { + "name": "IDX_deployment_key_signing_hmac_active", + "def": "CREATE UNIQUE INDEX \"IDX_deployment_key_signing_hmac_active\" ON \"deployment_key\" (\"type\") WHERE status = 'active' AND type = 'signing.hmac'", + "table": "deployment_key", + "columns": [ + "type" + ] + }, + { + "name": "IDX_deployment_key_signing_jwt_active", + "def": "CREATE UNIQUE INDEX \"IDX_deployment_key_signing_jwt_active\" ON \"deployment_key\" (\"type\") WHERE status = 'active' AND type = 'signing.jwt'", + "table": "deployment_key", + "columns": [ + "type" + ] + }, + { + "name": "IDX_deployment_key_instance_id_active", + "def": "CREATE UNIQUE INDEX \"IDX_deployment_key_instance_id_active\" ON \"deployment_key\" (\"type\") WHERE status = 'active' AND type = 'instance.id'", + "table": "deployment_key", + "columns": [ + "type" + ] + }, + { + "name": "IDX_deployment_key_data_encryption_active", + "def": "CREATE UNIQUE INDEX \"IDX_deployment_key_data_encryption_active\" ON \"deployment_key\" (\"type\") WHERE status = 'active' AND type = 'data_encryption'", + "table": "deployment_key", + "columns": [ + "type" + ] + }, + { + "name": "sqlite_autoindex_deployment_key_1", + "def": "PRIMARY KEY (id)", + "table": "deployment_key", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "deployment_key", + "columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_deployment_key_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "deployment_key", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"deployment_key\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"type\" varchar(64) NOT NULL, \"value\" text NOT NULL, \"algorithm\" varchar(20), \"status\" varchar(20) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')))" + }, + { + "name": "ai_builder_temporary_workflow", + "type": "table", + "columns": [ + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "threadId", + "type": "varchar", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_39b07732e819fb561d74c38763", + "def": "CREATE INDEX \"IDX_39b07732e819fb561d74c38763\" ON \"ai_builder_temporary_workflow\" (\"threadId\") ", + "table": "ai_builder_temporary_workflow", + "columns": [ + "threadId" + ] + }, + { + "name": "sqlite_autoindex_ai_builder_temporary_workflow_1", + "def": "PRIMARY KEY (workflowId)", + "table": "ai_builder_temporary_workflow", + "columns": [ + "workflowId" + ] + } + ], + "constraints": [ + { + "name": "workflowId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (workflowId)", + "table": "ai_builder_temporary_workflow", + "columns": [ + "workflowId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "ai_builder_temporary_workflow", + "referenced_table": "instance_ai_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "ai_builder_temporary_workflow", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_ai_builder_temporary_workflow_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (workflowId)", + "table": "ai_builder_temporary_workflow", + "columns": [ + "workflowId" + ] + } + ], + "def": "CREATE TABLE \"ai_builder_temporary_workflow\" (\"workflowId\" varchar(36) PRIMARY KEY NOT NULL, \"threadId\" varchar NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_85a87a1ba0f61999fe11dc56325\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_39b07732e819fb561d74c38763f\" FOREIGN KEY (\"threadId\") REFERENCES \"instance_ai_threads\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "execution_entity", + "type": "table", + "columns": [ + { + "name": "id", + "type": "INTEGER", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "finished", + "type": "boolean", + "nullable": false + }, + { + "name": "mode", + "type": "varchar", + "nullable": false + }, + { + "name": "retryOf", + "type": "varchar", + "nullable": true + }, + { + "name": "retrySuccessId", + "type": "varchar", + "nullable": true + }, + { + "name": "startedAt", + "type": "datetime", + "nullable": true + }, + { + "name": "stoppedAt", + "type": "datetime", + "nullable": true + }, + { + "name": "waitTill", + "type": "datetime", + "nullable": true + }, + { + "name": "status", + "type": "varchar", + "nullable": false + }, + { + "name": "deletedAt", + "type": "datetime(3)", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "storedAt", + "type": "varchar(2)", + "nullable": false, + "default": "'db'" + }, + { + "name": "tracingContext", + "type": "TEXT", + "nullable": true + }, + { + "name": "deduplicationKey", + "type": "varchar(255)", + "nullable": true + } + ], + "indexes": [ + { + "name": "IDX_execution_entity_deduplicationKey", + "def": "CREATE UNIQUE INDEX \"IDX_execution_entity_deduplicationKey\" ON \"execution_entity\" (\"deduplicationKey\") WHERE \"deduplicationKey\" IS NOT NULL", + "table": "execution_entity", + "columns": [ + "deduplicationKey" + ] + }, + { + "name": "IDX_execution_entity_stoppedAt", + "def": "CREATE INDEX \"IDX_execution_entity_stoppedAt\" ON \"execution_entity\" (\"stoppedAt\") ", + "table": "execution_entity", + "columns": [ + "stoppedAt" + ] + }, + { + "name": "IDX_execution_entity_deletedAt", + "def": "CREATE INDEX \"IDX_execution_entity_deletedAt\" ON \"execution_entity\" (\"deletedAt\") ", + "table": "execution_entity", + "columns": [ + "deletedAt" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "execution_entity", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "execution_entity", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"execution_entity\" (\"id\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, \"workflowId\" varchar(36) NOT NULL, \"finished\" boolean NOT NULL, \"mode\" varchar NOT NULL, \"retryOf\" varchar, \"retrySuccessId\" varchar, \"startedAt\" datetime, \"stoppedAt\" datetime, \"waitTill\" datetime, \"status\" varchar NOT NULL, \"deletedAt\" datetime(3), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"storedAt\" varchar(2) NOT NULL DEFAULT ('db'), \"tracingContext\" text, \"deduplicationKey\" varchar(255), CONSTRAINT \"FK_c4d999a5e90784e8caccf5589de\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION)" + }, + { + "name": "evaluation_config", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "status", + "type": "varchar(16)", + "nullable": false, + "default": "'valid'" + }, + { + "name": "invalidReason", + "type": "varchar(64)", + "nullable": true + }, + { + "name": "datasetSource", + "type": "varchar(32)", + "nullable": false + }, + { + "name": "datasetRef", + "type": "TEXT", + "nullable": false + }, + { + "name": "startNodeName", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "endNodeName", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "metrics", + "type": "TEXT", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_fd7542bb123074760285dc1bbf", + "def": "CREATE INDEX \"IDX_fd7542bb123074760285dc1bbf\" ON \"evaluation_config\" (\"workflowId\") ", + "table": "evaluation_config", + "columns": [ + "workflowId" + ] + }, + { + "name": "sqlite_autoindex_evaluation_config_2", + "def": "UNIQUE (workflowId, name)", + "table": "evaluation_config", + "columns": [ + "workflowId", + "name" + ] + }, + { + "name": "sqlite_autoindex_evaluation_config_1", + "def": "PRIMARY KEY (id)", + "table": "evaluation_config", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "evaluation_config", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "evaluation_config", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_evaluation_config_2", + "type": "UNIQUE", + "def": "UNIQUE (workflowId, name)", + "table": "evaluation_config", + "columns": [ + "workflowId", + "name" + ] + }, + { + "name": "sqlite_autoindex_evaluation_config_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "evaluation_config", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"evaluation_config\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"workflowId\" varchar(36) NOT NULL, \"name\" varchar(128) NOT NULL, \"status\" varchar(16) NOT NULL DEFAULT ('valid'), \"invalidReason\" varchar(64), \"datasetSource\" varchar(32) NOT NULL, \"datasetRef\" text NOT NULL, \"startNodeName\" varchar(255) NOT NULL, \"endNodeName\" varchar(255) NOT NULL, \"metrics\" text NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"UQ_3c3c99a712e971835c52292e44c\" UNIQUE (\"workflowId\", \"name\"), CONSTRAINT \"FK_fd7542bb123074760285dc1bbf3\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "evaluation_collection", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "description", + "type": "TEXT", + "nullable": true + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "evaluationConfigId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "createdById", + "type": "varchar", + "nullable": true + }, + { + "name": "insightsCache", + "type": "TEXT", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_d634a0c93fd7de68a87eab951b", + "def": "CREATE INDEX \"IDX_d634a0c93fd7de68a87eab951b\" ON \"evaluation_collection\" (\"evaluationConfigId\") ", + "table": "evaluation_collection", + "columns": [ + "evaluationConfigId" + ] + }, + { + "name": "IDX_a48ce930c3bc7604894b8f0eaa", + "def": "CREATE INDEX \"IDX_a48ce930c3bc7604894b8f0eaa\" ON \"evaluation_collection\" (\"workflowId\") ", + "table": "evaluation_collection", + "columns": [ + "workflowId" + ] + }, + { + "name": "sqlite_autoindex_evaluation_collection_1", + "def": "PRIMARY KEY (id)", + "table": "evaluation_collection", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "evaluation_collection", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (createdById) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "evaluation_collection", + "referenced_table": "user", + "columns": [ + "createdById" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (evaluationConfigId) REFERENCES evaluation_config (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "evaluation_collection", + "referenced_table": "evaluation_config", + "columns": [ + "evaluationConfigId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 2)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "evaluation_collection", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_evaluation_collection_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "evaluation_collection", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"evaluation_collection\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"name\" varchar(128) NOT NULL, \"description\" text, \"workflowId\" varchar(36) NOT NULL, \"evaluationConfigId\" varchar(36) NOT NULL, \"createdById\" varchar, \"insightsCache\" text, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_a48ce930c3bc7604894b8f0eaad\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_d634a0c93fd7de68a87eab951b2\" FOREIGN KEY (\"evaluationConfigId\") REFERENCES \"evaluation_config\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_f4561f38b5a22a4f090d5cd3eae\" FOREIGN KEY (\"createdById\") REFERENCES \"user\" (\"id\") ON DELETE SET NULL)" + }, + { + "name": "test_run", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "status", + "type": "varchar", + "nullable": false + }, + { + "name": "errorCode", + "type": "varchar", + "nullable": true + }, + { + "name": "errorDetails", + "type": "TEXT", + "nullable": true + }, + { + "name": "runAt", + "type": "datetime(3)", + "nullable": true + }, + { + "name": "completedAt", + "type": "datetime(3)", + "nullable": true + }, + { + "name": "metrics", + "type": "TEXT", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "runningInstanceId", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "cancelRequested", + "type": "boolean", + "nullable": false, + "default": "FALSE" + }, + { + "name": "workflowVersionId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "evaluationConfigId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "evaluationConfigSnapshot", + "type": "TEXT", + "nullable": true + }, + { + "name": "collectionId", + "type": "varchar(36)", + "nullable": true + } + ], + "indexes": [ + { + "name": "IDX_test_run_collectionId", + "def": "CREATE INDEX \"IDX_test_run_collectionId\" ON \"test_run\" (\"collectionId\") ", + "table": "test_run", + "columns": [ + "collectionId" + ] + }, + { + "name": "IDX_d6870d3b6e4c185d33926f423c", + "def": "CREATE INDEX \"IDX_d6870d3b6e4c185d33926f423c\" ON \"test_run\" (\"workflowId\") ", + "table": "test_run", + "columns": [ + "workflowId" + ] + }, + { + "name": "IDX_test_run_evaluationConfigId", + "def": "CREATE INDEX \"IDX_test_run_evaluationConfigId\" ON \"test_run\" (\"evaluationConfigId\") ", + "table": "test_run", + "columns": [ + "evaluationConfigId" + ] + }, + { + "name": "sqlite_autoindex_test_run_1", + "def": "PRIMARY KEY (id)", + "table": "test_run", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "test_run", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (collectionId) REFERENCES evaluation_collection (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "test_run", + "referenced_table": "evaluation_collection", + "columns": [ + "collectionId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "test_run", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 2)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (evaluationConfigId) REFERENCES evaluation_config (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "test_run", + "referenced_table": "evaluation_config", + "columns": [ + "evaluationConfigId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_test_run_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "test_run", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"test_run\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"workflowId\" varchar(36) NOT NULL, \"status\" varchar NOT NULL, \"errorCode\" varchar, \"errorDetails\" text, \"runAt\" datetime(3), \"completedAt\" datetime(3), \"metrics\" text, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"runningInstanceId\" varchar(255), \"cancelRequested\" boolean NOT NULL DEFAULT (FALSE), \"workflowVersionId\" varchar(36), \"evaluationConfigId\" varchar(36), \"evaluationConfigSnapshot\" text, \"collectionId\" varchar(36), CONSTRAINT \"FK_test_run_evaluation_config_id\" FOREIGN KEY (\"evaluationConfigId\") REFERENCES \"evaluation_config\" (\"id\") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT \"FK_d6870d3b6e4c185d33926f423c8\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_test_run_collection_id\" FOREIGN KEY (\"collectionId\") REFERENCES \"evaluation_collection\" (\"id\") ON DELETE SET NULL)" + }, + { + "name": "agent_checkpoints", + "type": "table", + "columns": [ + { + "name": "runId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "agentId", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "state", + "type": "TEXT", + "nullable": true + }, + { + "name": "expired", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_5e31c210f896d539964bf99fe3", + "def": "CREATE INDEX \"IDX_5e31c210f896d539964bf99fe3\" ON \"agent_checkpoints\" (\"agentId\") ", + "table": "agent_checkpoints", + "columns": [ + "agentId" + ] + }, + { + "name": "sqlite_autoindex_agent_checkpoints_1", + "def": "PRIMARY KEY (runId)", + "table": "agent_checkpoints", + "columns": [ + "runId" + ] + } + ], + "constraints": [ + { + "name": "runId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (runId)", + "table": "agent_checkpoints", + "columns": [ + "runId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agent_checkpoints", + "referenced_table": "agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agent_checkpoints_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (runId)", + "table": "agent_checkpoints", + "columns": [ + "runId" + ] + } + ], + "def": "CREATE TABLE \"agent_checkpoints\" (\"runId\" varchar(255) PRIMARY KEY NOT NULL, \"agentId\" varchar(255), \"state\" text, \"expired\" boolean NOT NULL DEFAULT (false), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_5e31c210f896d539964bf99fe32\" FOREIGN KEY (\"agentId\") REFERENCES \"agents\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "agents_resources", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "metadata", + "type": "TEXT", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_agents_resources_1", + "def": "PRIMARY KEY (id)", + "table": "agents_resources", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agents_resources", + "columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agents_resources_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agents_resources", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"agents_resources\" (\"id\" varchar(255) PRIMARY KEY NOT NULL, \"metadata\" text, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')))" + }, + { + "name": "agents_threads", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "title", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "metadata", + "type": "TEXT", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_54fa1b94f34a409beafae567a4", + "def": "CREATE INDEX \"IDX_54fa1b94f34a409beafae567a4\" ON \"agents_threads\" (\"resourceId\") ", + "table": "agents_threads", + "columns": [ + "resourceId" + ] + }, + { + "name": "sqlite_autoindex_agents_threads_1", + "def": "PRIMARY KEY (id)", + "table": "agents_threads", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agents_threads", + "columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agents_threads_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agents_threads", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"agents_threads\" (\"id\" varchar(128) PRIMARY KEY NOT NULL, \"resourceId\" varchar(255) NOT NULL, \"title\" varchar(255), \"metadata\" text, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')))" + }, + { + "name": "agents_messages", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "threadId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "role", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "content", + "type": "TEXT", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_agents_messages_threadId_createdAt", + "def": "CREATE INDEX \"IDX_agents_messages_threadId_createdAt\" ON \"agents_messages\" (\"threadId\", \"createdAt\") ", + "table": "agents_messages", + "columns": [ + "threadId", + "createdAt" + ] + }, + { + "name": "IDX_fc7bf858660bfafd19181e8e35", + "def": "CREATE INDEX \"IDX_fc7bf858660bfafd19181e8e35\" ON \"agents_messages\" (\"threadId\", \"createdAt\") ", + "table": "agents_messages", + "columns": [ + "threadId", + "createdAt" + ] + }, + { + "name": "sqlite_autoindex_agents_messages_1", + "def": "PRIMARY KEY (id)", + "table": "agents_messages", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agents_messages", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (threadId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_messages", + "referenced_table": "agents_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agents_messages_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agents_messages", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"agents_messages\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"threadId\" varchar(255) NOT NULL, \"resourceId\" varchar(255) NOT NULL, \"role\" varchar(36) NOT NULL, \"type\" varchar(36), \"content\" text NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_0a8057a61afabd2999608ffd0d9\" FOREIGN KEY (\"threadId\") REFERENCES \"agents_threads\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "agent_execution", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "threadId", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "status", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "startedAt", + "type": "datetime(3)", + "nullable": true + }, + { + "name": "stoppedAt", + "type": "datetime(3)", + "nullable": true + }, + { + "name": "duration", + "type": "INTEGER", + "nullable": false, + "default": "0" + }, + { + "name": "userMessage", + "type": "TEXT", + "nullable": false + }, + { + "name": "assistantResponse", + "type": "TEXT", + "nullable": false + }, + { + "name": "model", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "promptTokens", + "type": "INTEGER", + "nullable": true + }, + { + "name": "completionTokens", + "type": "INTEGER", + "nullable": true + }, + { + "name": "totalTokens", + "type": "INTEGER", + "nullable": true + }, + { + "name": "cost", + "type": "REAL", + "nullable": true + }, + { + "name": "toolCalls", + "type": "TEXT", + "nullable": true + }, + { + "name": "timeline", + "type": "TEXT", + "nullable": true + }, + { + "name": "error", + "type": "TEXT", + "nullable": true + }, + { + "name": "hitlStatus", + "type": "varchar(16)", + "nullable": true + }, + { + "name": "source", + "type": "varchar(32)", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_63d3c3a68b9cebf05f967f0b1c", + "def": "CREATE INDEX \"IDX_63d3c3a68b9cebf05f967f0b1c\" ON \"agent_execution\" (\"threadId\", \"createdAt\") ", + "table": "agent_execution", + "columns": [ + "threadId", + "createdAt" + ] + }, + { + "name": "sqlite_autoindex_agent_execution_1", + "def": "PRIMARY KEY (id)", + "table": "agent_execution", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agent_execution", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (threadId) REFERENCES agent_execution_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agent_execution", + "referenced_table": "agent_execution_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agent_execution_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agent_execution", + "columns": [ + "id" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK ((\"status\" IN ('success', 'error')))", + "table": "agent_execution", + "columns": [ + "status", + "error" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK ((\"hitlStatus\" IN ('suspended', 'resumed')))", + "table": "agent_execution", + "columns": [ + "hitlStatus" + ] + } + ], + "def": "CREATE TABLE \"agent_execution\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"threadId\" varchar(128) NOT NULL, \"status\" varchar(16) NOT NULL, \"startedAt\" datetime(3), \"stoppedAt\" datetime(3), \"duration\" integer NOT NULL DEFAULT (0), \"userMessage\" text NOT NULL, \"assistantResponse\" text NOT NULL, \"model\" varchar(255), \"promptTokens\" integer, \"completionTokens\" integer, \"totalTokens\" integer, \"cost\" real, \"toolCalls\" text, \"timeline\" text, \"error\" text, \"hitlStatus\" varchar(16), \"source\" varchar(32), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"CHK_agent_execution_status\" CHECK ((\"status\" IN ('success', 'error'))), CONSTRAINT \"CHK_agent_execution_hitlStatus\" CHECK ((\"hitlStatus\" IN ('suspended', 'resumed'))), CONSTRAINT \"FK_add2432fb6034cc18b6af299dce\" FOREIGN KEY (\"threadId\") REFERENCES \"agent_execution_threads\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION)" + }, + { + "name": "workflow_history", + "type": "table", + "columns": [ + { + "name": "versionId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "authors", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "nodes", + "type": "TEXT", + "nullable": false + }, + { + "name": "connections", + "type": "TEXT", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": true + }, + { + "name": "autosaved", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "description", + "type": "TEXT", + "nullable": true + }, + { + "name": "nodeGroups", + "type": "TEXT", + "nullable": false, + "default": "'[]'" + } + ], + "indexes": [ + { + "name": "IDX_1e31657f5fe46816c34be7c1b4", + "def": "CREATE INDEX \"IDX_1e31657f5fe46816c34be7c1b4\" ON \"workflow_history\" (\"workflowId\") ", + "table": "workflow_history", + "columns": [ + "workflowId" + ] + }, + { + "name": "sqlite_autoindex_workflow_history_1", + "def": "PRIMARY KEY (versionId)", + "table": "workflow_history", + "columns": [ + "versionId" + ] + } + ], + "constraints": [ + { + "name": "versionId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (versionId)", + "table": "workflow_history", + "columns": [ + "versionId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "workflow_history", + "referenced_table": "workflow_entity", + "columns": [ + "workflowId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_workflow_history_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (versionId)", + "table": "workflow_history", + "columns": [ + "versionId" + ] + } + ], + "def": "CREATE TABLE \"workflow_history\" (\"versionId\" varchar(36) PRIMARY KEY NOT NULL, \"workflowId\" varchar(36) NOT NULL, \"authors\" varchar(255) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"nodes\" text NOT NULL, \"connections\" text NOT NULL, \"name\" varchar(128), \"autosaved\" boolean NOT NULL DEFAULT (false), \"description\" text, \"nodeGroups\" text NOT NULL DEFAULT ('[]'), CONSTRAINT \"FK_1e31657f5fe46816c34be7c1b4b\" FOREIGN KEY (\"workflowId\") REFERENCES \"workflow_entity\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION)" + }, + { + "name": "instance_ai_run_snapshots", + "type": "table", + "columns": [ + { + "name": "threadId", + "type": "varchar", + "nullable": false + }, + { + "name": "runId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "messageGroupId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "runIds", + "type": "TEXT", + "nullable": true + }, + { + "name": "tree", + "type": "TEXT", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "langsmithRunId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "langsmithTraceId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "traceId", + "type": "varchar(64)", + "nullable": true + }, + { + "name": "spanId", + "type": "varchar(64)", + "nullable": true + } + ], + "indexes": [ + { + "name": "IDX_d3a2bc880e7a8626802e5474ad", + "def": "CREATE INDEX \"IDX_d3a2bc880e7a8626802e5474ad\" ON \"instance_ai_run_snapshots\" (\"threadId\", \"createdAt\") ", + "table": "instance_ai_run_snapshots", + "columns": [ + "threadId", + "createdAt" + ] + }, + { + "name": "IDX_d926c16c2ad9728cb9a81790c0", + "def": "CREATE INDEX \"IDX_d926c16c2ad9728cb9a81790c0\" ON \"instance_ai_run_snapshots\" (\"threadId\", \"messageGroupId\") ", + "table": "instance_ai_run_snapshots", + "columns": [ + "threadId", + "messageGroupId" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_run_snapshots_1", + "def": "PRIMARY KEY (threadId, runId)", + "table": "instance_ai_run_snapshots", + "columns": [ + "threadId", + "runId" + ] + } + ], + "constraints": [ + { + "name": "threadId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (threadId)", + "table": "instance_ai_run_snapshots", + "columns": [ + "threadId" + ] + }, + { + "name": "runId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (runId)", + "table": "instance_ai_run_snapshots", + "columns": [ + "runId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "instance_ai_run_snapshots", + "referenced_table": "instance_ai_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_run_snapshots_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (threadId, runId)", + "table": "instance_ai_run_snapshots", + "columns": [ + "threadId", + "runId" + ] + } + ], + "def": "CREATE TABLE \"instance_ai_run_snapshots\" (\"threadId\" varchar NOT NULL, \"runId\" varchar(36) NOT NULL, \"messageGroupId\" varchar(36), \"runIds\" text, \"tree\" text NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"langsmithRunId\" varchar(36), \"langsmithTraceId\" varchar(36), \"traceId\" varchar(64), \"spanId\" varchar(64), CONSTRAINT \"FK_2f63fa21d09d7918f347ddbdf70\" FOREIGN KEY (\"threadId\") REFERENCES \"instance_ai_threads\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, PRIMARY KEY (\"threadId\", \"runId\"))" + }, + { + "name": "agents_observations", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "observationScopeId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "marker", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "text", + "type": "TEXT", + "nullable": false + }, + { + "name": "parentId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "tokenCount", + "type": "INTEGER", + "nullable": false, + "default": "0" + }, + { + "name": "status", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "supersededBy", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_127ee1078ffa952bb37b511efa", + "def": "CREATE INDEX \"IDX_127ee1078ffa952bb37b511efa\" ON \"agents_observations\" (\"supersededBy\") ", + "table": "agents_observations", + "columns": [ + "supersededBy" + ] + }, + { + "name": "IDX_501e2d1701a10e24fb69ab5fc5", + "def": "CREATE INDEX \"IDX_501e2d1701a10e24fb69ab5fc5\" ON \"agents_observations\" (\"parentId\") ", + "table": "agents_observations", + "columns": [ + "parentId" + ] + }, + { + "name": "IDX_4cfd8a70ebb0a5b0cf047dca3c", + "def": "CREATE INDEX \"IDX_4cfd8a70ebb0a5b0cf047dca3c\" ON \"agents_observations\" (\"observationScopeId\") ", + "table": "agents_observations", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "IDX_07cb1e4a302629c5fa5d74d2bb", + "def": "CREATE INDEX \"IDX_07cb1e4a302629c5fa5d74d2bb\" ON \"agents_observations\" (\"agentId\", \"observationScopeId\", \"status\") ", + "table": "agents_observations", + "columns": [ + "agentId", + "observationScopeId", + "status" + ] + }, + { + "name": "sqlite_autoindex_agents_observations_1", + "def": "PRIMARY KEY (id)", + "table": "agents_observations", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agents_observations", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (supersededBy) REFERENCES agents_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE", + "table": "agents_observations", + "referenced_table": "agents_observations", + "columns": [ + "supersededBy" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (parentId) REFERENCES agents_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE", + "table": "agents_observations", + "referenced_table": "agents_observations", + "columns": [ + "parentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 2)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_observations", + "referenced_table": "agents_threads", + "columns": [ + "observationScopeId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 3)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_observations", + "referenced_table": "agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agents_observations_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agents_observations", + "columns": [ + "id" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK (\"marker\" IN ('critical', 'important', 'info', 'completion'))", + "table": "agents_observations", + "columns": [ + "marker" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK (\"status\" IN ('active', 'superseded', 'dropped'))", + "table": "agents_observations", + "columns": [ + "status" + ] + } + ], + "def": "CREATE TABLE \"agents_observations\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"agentId\" varchar(36) NOT NULL, \"observationScopeId\" varchar(255) NOT NULL, \"marker\" varchar(16) NOT NULL, \"text\" text NOT NULL, \"parentId\" varchar(36), \"tokenCount\" integer NOT NULL DEFAULT (0), \"status\" varchar(16) NOT NULL, \"supersededBy\" varchar(36), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"CHK_agents_observations_marker\" CHECK (\"marker\" IN ('critical', 'important', 'info', 'completion')), CONSTRAINT \"CHK_agents_observations_status\" CHECK (\"status\" IN ('active', 'superseded', 'dropped')), CONSTRAINT \"FK_d206432be97b7ed88d187479b1b\" FOREIGN KEY (\"agentId\") REFERENCES \"agents\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_4cfd8a70ebb0a5b0cf047dca3cf\" FOREIGN KEY (\"observationScopeId\") REFERENCES \"agents_threads\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_501e2d1701a10e24fb69ab5fc5f\" FOREIGN KEY (\"parentId\") REFERENCES \"agents_observations\" (\"id\"), CONSTRAINT \"FK_127ee1078ffa952bb37b511efad\" FOREIGN KEY (\"supersededBy\") REFERENCES \"agents_observations\" (\"id\"))" + }, + { + "name": "agents_observation_cursors", + "type": "table", + "columns": [ + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "observationScopeId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "lastObservedMessageId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "lastObservedAt", + "type": "datetime(3)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_87aa187d27ea67eafd16490515", + "def": "CREATE INDEX \"IDX_87aa187d27ea67eafd16490515\" ON \"agents_observation_cursors\" (\"observationScopeId\") ", + "table": "agents_observation_cursors", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "sqlite_autoindex_agents_observation_cursors_1", + "def": "PRIMARY KEY (agentId, observationScopeId)", + "table": "agents_observation_cursors", + "columns": [ + "agentId", + "observationScopeId" + ] + } + ], + "constraints": [ + { + "name": "agentId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (agentId)", + "table": "agents_observation_cursors", + "columns": [ + "agentId" + ] + }, + { + "name": "observationScopeId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (observationScopeId)", + "table": "agents_observation_cursors", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_observation_cursors", + "referenced_table": "agents_threads", + "columns": [ + "observationScopeId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_observation_cursors", + "referenced_table": "agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agents_observation_cursors_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (agentId, observationScopeId)", + "table": "agents_observation_cursors", + "columns": [ + "agentId", + "observationScopeId" + ] + } + ], + "def": "CREATE TABLE \"agents_observation_cursors\" (\"agentId\" varchar(36) NOT NULL, \"observationScopeId\" varchar(255) NOT NULL, \"lastObservedMessageId\" varchar(36) NOT NULL, \"lastObservedAt\" datetime(3) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_64e92819f4b413661ed6e2c3c3d\" FOREIGN KEY (\"agentId\") REFERENCES \"agents\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_87aa187d27ea67eafd164905154\" FOREIGN KEY (\"observationScopeId\") REFERENCES \"agents_threads\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"agentId\", \"observationScopeId\"))" + }, + { + "name": "agents_observation_locks", + "type": "table", + "columns": [ + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "observationScopeId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "taskKind", + "type": "varchar(20)", + "nullable": false + }, + { + "name": "holderId", + "type": "varchar(64)", + "nullable": false + }, + { + "name": "heldUntil", + "type": "datetime(3)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_6b55089892e447c2f82e5ec60e", + "def": "CREATE INDEX \"IDX_6b55089892e447c2f82e5ec60e\" ON \"agents_observation_locks\" (\"observationScopeId\") ", + "table": "agents_observation_locks", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "sqlite_autoindex_agents_observation_locks_1", + "def": "PRIMARY KEY (agentId, observationScopeId, taskKind)", + "table": "agents_observation_locks", + "columns": [ + "agentId", + "observationScopeId", + "taskKind" + ] + } + ], + "constraints": [ + { + "name": "agentId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (agentId)", + "table": "agents_observation_locks", + "columns": [ + "agentId" + ] + }, + { + "name": "observationScopeId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (observationScopeId)", + "table": "agents_observation_locks", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "taskKind", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (taskKind)", + "table": "agents_observation_locks", + "columns": [ + "taskKind" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_observation_locks", + "referenced_table": "agents_threads", + "columns": [ + "observationScopeId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_observation_locks", + "referenced_table": "agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agents_observation_locks_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (agentId, observationScopeId, taskKind)", + "table": "agents_observation_locks", + "columns": [ + "agentId", + "observationScopeId", + "taskKind" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK (\"taskKind\" IN ('observer', 'reflector'))", + "table": "agents_observation_locks", + "columns": [ + "taskKind" + ] + } + ], + "def": "CREATE TABLE \"agents_observation_locks\" (\"agentId\" varchar(36) NOT NULL, \"observationScopeId\" varchar(255) NOT NULL, \"taskKind\" varchar(20) NOT NULL, \"holderId\" varchar(64) NOT NULL, \"heldUntil\" datetime(3) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"CHK_agents_observation_locks_taskKind\" CHECK (\"taskKind\" IN ('observer', 'reflector')), CONSTRAINT \"FK_093e44ae20f2518e97d83a95433\" FOREIGN KEY (\"agentId\") REFERENCES \"agents\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_6b55089892e447c2f82e5ec60ed\" FOREIGN KEY (\"observationScopeId\") REFERENCES \"agents_threads\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"agentId\", \"observationScopeId\", \"taskKind\"))" + }, + { + "name": "agents_memory_entries", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "content", + "type": "TEXT", + "nullable": false + }, + { + "name": "contentHash", + "type": "varchar(64)", + "nullable": false + }, + { + "name": "status", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "supersededBy", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "embeddingModel", + "type": "varchar(128)", + "nullable": true + }, + { + "name": "embedding", + "type": "TEXT", + "nullable": true + }, + { + "name": "metadata", + "type": "TEXT", + "nullable": true + }, + { + "name": "lastSeenAt", + "type": "datetime(3)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_0edf1226b77ddc525eae493807", + "def": "CREATE INDEX \"IDX_0edf1226b77ddc525eae493807\" ON \"agents_memory_entries\" (\"supersededBy\") ", + "table": "agents_memory_entries", + "columns": [ + "supersededBy" + ] + }, + { + "name": "IDX_1443a75e59adbfb796071d6639", + "def": "CREATE INDEX \"IDX_1443a75e59adbfb796071d6639\" ON \"agents_memory_entries\" (\"resourceId\") ", + "table": "agents_memory_entries", + "columns": [ + "resourceId" + ] + }, + { + "name": "IDX_a03e04e94bea8439dd166d4b52", + "def": "CREATE UNIQUE INDEX \"IDX_a03e04e94bea8439dd166d4b52\" ON \"agents_memory_entries\" (\"agentId\", \"resourceId\", \"contentHash\") ", + "table": "agents_memory_entries", + "columns": [ + "agentId", + "resourceId", + "contentHash" + ] + }, + { + "name": "IDX_aff2807b31eccbafe59d0474f0", + "def": "CREATE INDEX \"IDX_aff2807b31eccbafe59d0474f0\" ON \"agents_memory_entries\" (\"agentId\", \"resourceId\", \"status\", \"createdAt\", \"id\") ", + "table": "agents_memory_entries", + "columns": [ + "agentId", + "resourceId", + "status", + "createdAt", + "id" + ] + }, + { + "name": "sqlite_autoindex_agents_memory_entries_1", + "def": "PRIMARY KEY (id)", + "table": "agents_memory_entries", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agents_memory_entries", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (supersededBy) REFERENCES agents_memory_entries (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE", + "table": "agents_memory_entries", + "referenced_table": "agents_memory_entries", + "columns": [ + "supersededBy" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (resourceId) REFERENCES agents_resources (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_memory_entries", + "referenced_table": "agents_resources", + "columns": [ + "resourceId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 2)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_memory_entries", + "referenced_table": "agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agents_memory_entries_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agents_memory_entries", + "columns": [ + "id" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK (\"status\" IN ('active', 'superseded', 'dropped'))", + "table": "agents_memory_entries", + "columns": [ + "status" + ] + } + ], + "def": "CREATE TABLE \"agents_memory_entries\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"agentId\" varchar(36) NOT NULL, \"resourceId\" varchar(255) NOT NULL, \"content\" text NOT NULL, \"contentHash\" varchar(64) NOT NULL, \"status\" varchar(16) NOT NULL, \"supersededBy\" varchar(36), \"embeddingModel\" varchar(128), \"embedding\" text, \"metadata\" text, \"lastSeenAt\" datetime(3) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"CHK_agents_memory_entries_status\" CHECK (\"status\" IN ('active', 'superseded', 'dropped')), CONSTRAINT \"FK_28e981fb675e9b44ce02f0ec1dd\" FOREIGN KEY (\"agentId\") REFERENCES \"agents\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_1443a75e59adbfb796071d66393\" FOREIGN KEY (\"resourceId\") REFERENCES \"agents_resources\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_0edf1226b77ddc525eae4938079\" FOREIGN KEY (\"supersededBy\") REFERENCES \"agents_memory_entries\" (\"id\"))" + }, + { + "name": "agents_memory_entry_locks", + "type": "table", + "columns": [ + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "holderId", + "type": "varchar(64)", + "nullable": false + }, + { + "name": "heldUntil", + "type": "datetime(3)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_9594c0983cfee1c8ff49b05848", + "def": "CREATE INDEX \"IDX_9594c0983cfee1c8ff49b05848\" ON \"agents_memory_entry_locks\" (\"resourceId\") ", + "table": "agents_memory_entry_locks", + "columns": [ + "resourceId" + ] + }, + { + "name": "sqlite_autoindex_agents_memory_entry_locks_1", + "def": "PRIMARY KEY (agentId, resourceId)", + "table": "agents_memory_entry_locks", + "columns": [ + "agentId", + "resourceId" + ] + } + ], + "constraints": [ + { + "name": "agentId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (agentId)", + "table": "agents_memory_entry_locks", + "columns": [ + "agentId" + ] + }, + { + "name": "resourceId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (resourceId)", + "table": "agents_memory_entry_locks", + "columns": [ + "resourceId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (resourceId) REFERENCES agents_resources (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_memory_entry_locks", + "referenced_table": "agents_resources", + "columns": [ + "resourceId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_memory_entry_locks", + "referenced_table": "agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agents_memory_entry_locks_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (agentId, resourceId)", + "table": "agents_memory_entry_locks", + "columns": [ + "agentId", + "resourceId" + ] + } + ], + "def": "CREATE TABLE \"agents_memory_entry_locks\" (\"agentId\" varchar(36) NOT NULL, \"resourceId\" varchar(255) NOT NULL, \"holderId\" varchar(64) NOT NULL, \"heldUntil\" datetime(3) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_0ccf6d9ea6f44fa1c264fc2f795\" FOREIGN KEY (\"agentId\") REFERENCES \"agents\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_9594c0983cfee1c8ff49b05848b\" FOREIGN KEY (\"resourceId\") REFERENCES \"agents_resources\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"agentId\", \"resourceId\"))" + }, + { + "name": "agents_memory_entry_sources", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "memoryEntryId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "observationId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "threadId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "evidenceHash", + "type": "varchar(64)", + "nullable": false + }, + { + "name": "evidenceText", + "type": "TEXT", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_451d387a182fa8dd8002dfc3a7", + "def": "CREATE INDEX \"IDX_451d387a182fa8dd8002dfc3a7\" ON \"agents_memory_entry_sources\" (\"threadId\") ", + "table": "agents_memory_entry_sources", + "columns": [ + "threadId" + ] + }, + { + "name": "IDX_f9573af4ed653f13b0ba1f7b12", + "def": "CREATE INDEX \"IDX_f9573af4ed653f13b0ba1f7b12\" ON \"agents_memory_entry_sources\" (\"agentId\", \"threadId\") ", + "table": "agents_memory_entry_sources", + "columns": [ + "agentId", + "threadId" + ] + }, + { + "name": "IDX_cb7c15d22fd068a0806aa57fc0", + "def": "CREATE INDEX \"IDX_cb7c15d22fd068a0806aa57fc0\" ON \"agents_memory_entry_sources\" (\"observationId\") ", + "table": "agents_memory_entry_sources", + "columns": [ + "observationId" + ] + }, + { + "name": "IDX_a353ac251315ef0af6ad3c9f0a", + "def": "CREATE UNIQUE INDEX \"IDX_a353ac251315ef0af6ad3c9f0a\" ON \"agents_memory_entry_sources\" (\"memoryEntryId\", \"observationId\", \"evidenceHash\") ", + "table": "agents_memory_entry_sources", + "columns": [ + "memoryEntryId", + "observationId", + "evidenceHash" + ] + }, + { + "name": "sqlite_autoindex_agents_memory_entry_sources_1", + "def": "PRIMARY KEY (id)", + "table": "agents_memory_entry_sources", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agents_memory_entry_sources", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (threadId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_memory_entry_sources", + "referenced_table": "agents_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (observationId) REFERENCES agents_observations (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_memory_entry_sources", + "referenced_table": "agents_observations", + "columns": [ + "observationId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 2)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (memoryEntryId) REFERENCES agents_memory_entries (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_memory_entry_sources", + "referenced_table": "agents_memory_entries", + "columns": [ + "memoryEntryId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 3)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_memory_entry_sources", + "referenced_table": "agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agents_memory_entry_sources_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agents_memory_entry_sources", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"agents_memory_entry_sources\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"agentId\" varchar(36) NOT NULL, \"memoryEntryId\" varchar(36) NOT NULL, \"observationId\" varchar(36) NOT NULL, \"threadId\" varchar(255) NOT NULL, \"evidenceHash\" varchar(64) NOT NULL, \"evidenceText\" text NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_c38e8a57a36b880e39a52ada2e8\" FOREIGN KEY (\"agentId\") REFERENCES \"agents\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_4706f6223313959b7437a2b48df\" FOREIGN KEY (\"memoryEntryId\") REFERENCES \"agents_memory_entries\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_cb7c15d22fd068a0806aa57fc03\" FOREIGN KEY (\"observationId\") REFERENCES \"agents_observations\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_451d387a182fa8dd8002dfc3a77\" FOREIGN KEY (\"threadId\") REFERENCES \"agents_threads\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "agents_memory_entry_cursors", + "type": "table", + "columns": [ + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "observationScopeId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "lastIndexedObservationId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "lastIndexedObservationCreatedAt", + "type": "datetime(3)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_069e791e428391a5569e7a96b2", + "def": "CREATE INDEX \"IDX_069e791e428391a5569e7a96b2\" ON \"agents_memory_entry_cursors\" (\"observationScopeId\") ", + "table": "agents_memory_entry_cursors", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "sqlite_autoindex_agents_memory_entry_cursors_1", + "def": "PRIMARY KEY (agentId, observationScopeId)", + "table": "agents_memory_entry_cursors", + "columns": [ + "agentId", + "observationScopeId" + ] + } + ], + "constraints": [ + { + "name": "agentId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (agentId)", + "table": "agents_memory_entry_cursors", + "columns": [ + "agentId" + ] + }, + { + "name": "observationScopeId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (observationScopeId)", + "table": "agents_memory_entry_cursors", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_memory_entry_cursors", + "referenced_table": "agents_threads", + "columns": [ + "observationScopeId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents_memory_entry_cursors", + "referenced_table": "agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agents_memory_entry_cursors_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (agentId, observationScopeId)", + "table": "agents_memory_entry_cursors", + "columns": [ + "agentId", + "observationScopeId" + ] + } + ], + "def": "CREATE TABLE \"agents_memory_entry_cursors\" (\"agentId\" varchar(36) NOT NULL, \"observationScopeId\" varchar(255) NOT NULL, \"lastIndexedObservationId\" varchar(36) NOT NULL, \"lastIndexedObservationCreatedAt\" datetime(3) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_746780fd115e5e4352457a3c617\" FOREIGN KEY (\"agentId\") REFERENCES \"agents\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_069e791e428391a5569e7a96b20\" FOREIGN KEY (\"observationScopeId\") REFERENCES \"agents_threads\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"agentId\", \"observationScopeId\"))" + }, + { + "name": "agent_history", + "type": "table", + "columns": [ + { + "name": "versionId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "schema", + "type": "TEXT", + "nullable": true + }, + { + "name": "tools", + "type": "TEXT", + "nullable": true + }, + { + "name": "skills", + "type": "TEXT", + "nullable": true + }, + { + "name": "publishedById", + "type": "varchar", + "nullable": true + }, + { + "name": "author", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_87cd5a8da20304b089ea2f83fe", + "def": "CREATE INDEX \"IDX_87cd5a8da20304b089ea2f83fe\" ON \"agent_history\" (\"agentId\") ", + "table": "agent_history", + "columns": [ + "agentId" + ] + }, + { + "name": "sqlite_autoindex_agent_history_1", + "def": "PRIMARY KEY (versionId)", + "table": "agent_history", + "columns": [ + "versionId" + ] + } + ], + "constraints": [ + { + "name": "versionId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (versionId)", + "table": "agent_history", + "columns": [ + "versionId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (publishedById) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "agent_history", + "referenced_table": "user", + "columns": [ + "publishedById" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agent_history", + "referenced_table": "agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agent_history_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (versionId)", + "table": "agent_history", + "columns": [ + "versionId" + ] + } + ], + "def": "CREATE TABLE \"agent_history\" (\"versionId\" varchar(36) PRIMARY KEY NOT NULL, \"agentId\" varchar(36) NOT NULL, \"schema\" text, \"tools\" text, \"skills\" text, \"publishedById\" varchar, \"author\" varchar(255) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_87cd5a8da20304b089ea2f83fec\" FOREIGN KEY (\"agentId\") REFERENCES \"agents\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_8771675f44c58fb40e0feb9ee35\" FOREIGN KEY (\"publishedById\") REFERENCES \"user\" (\"id\") ON DELETE SET NULL)" + }, + { + "name": "agents", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "description", + "type": "varchar(512)", + "nullable": true + }, + { + "name": "projectId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "integrations", + "type": "TEXT", + "nullable": false, + "default": "'[]'" + }, + { + "name": "schema", + "type": "TEXT", + "nullable": true + }, + { + "name": "tools", + "type": "TEXT", + "nullable": false, + "default": "'{}'" + }, + { + "name": "skills", + "type": "TEXT", + "nullable": false, + "default": "'{}'" + }, + { + "name": "versionId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "activeVersionId", + "type": "varchar(36)", + "nullable": true + } + ], + "indexes": [ + { + "name": "IDX_agents_projectId", + "def": "CREATE INDEX \"IDX_agents_projectId\" ON \"agents\" (\"projectId\") ", + "table": "agents", + "columns": [ + "projectId" + ] + }, + { + "name": "IDX_a30d560207c4071d98aa03c179", + "def": "CREATE INDEX \"IDX_a30d560207c4071d98aa03c179\" ON \"agents\" (\"projectId\") ", + "table": "agents", + "columns": [ + "projectId" + ] + }, + { + "name": "sqlite_autoindex_agents_1", + "def": "PRIMARY KEY (id)", + "table": "agents", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agents", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (activeVersionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "agents", + "referenced_table": "agent_history", + "columns": [ + "activeVersionId" + ], + "referenced_columns": [ + "versionId" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agents", + "referenced_table": "project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agents_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agents", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"agents\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"name\" varchar(128) NOT NULL, \"description\" varchar(512), \"projectId\" varchar(255) NOT NULL, \"integrations\" text NOT NULL DEFAULT ('[]'), \"schema\" text, \"tools\" text NOT NULL DEFAULT ('{}'), \"skills\" text NOT NULL DEFAULT ('{}'), \"versionId\" varchar(36), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"activeVersionId\" varchar(36), CONSTRAINT \"FK_a30d560207c4071d98aa03c179c\" FOREIGN KEY (\"projectId\") REFERENCES \"project\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_940597dfe9753375309ce6aeea0\" FOREIGN KEY (\"activeVersionId\") REFERENCES \"agent_history\" (\"versionId\") ON DELETE SET NULL)" + }, + { + "name": "instance_ai_observations", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "observationScopeId", + "type": "varchar", + "nullable": false + }, + { + "name": "marker", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "text", + "type": "TEXT", + "nullable": false + }, + { + "name": "parentId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "tokenCount", + "type": "INTEGER", + "nullable": false, + "default": "0" + }, + { + "name": "status", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "supersededBy", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_a80e0ee839a2f10ba4b86e1999", + "def": "CREATE INDEX \"IDX_a80e0ee839a2f10ba4b86e1999\" ON \"instance_ai_observations\" (\"supersededBy\") ", + "table": "instance_ai_observations", + "columns": [ + "supersededBy" + ] + }, + { + "name": "IDX_daef2195a4a846eb70eed15e03", + "def": "CREATE INDEX \"IDX_daef2195a4a846eb70eed15e03\" ON \"instance_ai_observations\" (\"parentId\") ", + "table": "instance_ai_observations", + "columns": [ + "parentId" + ] + }, + { + "name": "IDX_0d5db648188d338df7fb2a8064", + "def": "CREATE INDEX \"IDX_0d5db648188d338df7fb2a8064\" ON \"instance_ai_observations\" (\"observationScopeId\", \"status\", \"createdAt\", \"id\") ", + "table": "instance_ai_observations", + "columns": [ + "observationScopeId", + "status", + "createdAt", + "id" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_observations_1", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_observations", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_observations", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (supersededBy) REFERENCES instance_ai_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE", + "table": "instance_ai_observations", + "referenced_table": "instance_ai_observations", + "columns": [ + "supersededBy" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (parentId) REFERENCES instance_ai_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE", + "table": "instance_ai_observations", + "referenced_table": "instance_ai_observations", + "columns": [ + "parentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 2)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "instance_ai_observations", + "referenced_table": "instance_ai_threads", + "columns": [ + "observationScopeId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_observations_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_observations", + "columns": [ + "id" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK (\"marker\" IN ('critical', 'important', 'info', 'completion'))", + "table": "instance_ai_observations", + "columns": [ + "marker" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK (\"status\" IN ('active', 'superseded', 'dropped'))", + "table": "instance_ai_observations", + "columns": [ + "status" + ] + } + ], + "def": "CREATE TABLE \"instance_ai_observations\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"observationScopeId\" varchar NOT NULL, \"marker\" varchar(16) NOT NULL, \"text\" text NOT NULL, \"parentId\" varchar(36), \"tokenCount\" integer NOT NULL DEFAULT (0), \"status\" varchar(16) NOT NULL, \"supersededBy\" varchar(36), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"CHK_instance_ai_observations_marker\" CHECK (\"marker\" IN ('critical', 'important', 'info', 'completion')), CONSTRAINT \"CHK_instance_ai_observations_status\" CHECK (\"status\" IN ('active', 'superseded', 'dropped')), CONSTRAINT \"FK_d54fc84a6c8ac91b5e0db0378a4\" FOREIGN KEY (\"observationScopeId\") REFERENCES \"instance_ai_threads\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_daef2195a4a846eb70eed15e039\" FOREIGN KEY (\"parentId\") REFERENCES \"instance_ai_observations\" (\"id\"), CONSTRAINT \"FK_a80e0ee839a2f10ba4b86e19998\" FOREIGN KEY (\"supersededBy\") REFERENCES \"instance_ai_observations\" (\"id\"))" + }, + { + "name": "instance_ai_observation_cursors", + "type": "table", + "columns": [ + { + "name": "observationScopeId", + "type": "varchar", + "nullable": false + }, + { + "name": "lastObservedMessageId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "lastObservedAt", + "type": "datetime(3)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_instance_ai_observation_cursors_1", + "def": "PRIMARY KEY (observationScopeId)", + "table": "instance_ai_observation_cursors", + "columns": [ + "observationScopeId" + ] + } + ], + "constraints": [ + { + "name": "observationScopeId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (observationScopeId)", + "table": "instance_ai_observation_cursors", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "instance_ai_observation_cursors", + "referenced_table": "instance_ai_threads", + "columns": [ + "observationScopeId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_observation_cursors_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (observationScopeId)", + "table": "instance_ai_observation_cursors", + "columns": [ + "observationScopeId" + ] + } + ], + "def": "CREATE TABLE \"instance_ai_observation_cursors\" (\"observationScopeId\" varchar PRIMARY KEY NOT NULL, \"lastObservedMessageId\" varchar(36) NOT NULL, \"lastObservedAt\" datetime(3) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_5b6319b2e9a37c1064a72428f9a\" FOREIGN KEY (\"observationScopeId\") REFERENCES \"instance_ai_threads\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "instance_ai_observation_locks", + "type": "table", + "columns": [ + { + "name": "observationScopeId", + "type": "varchar", + "nullable": false + }, + { + "name": "taskKind", + "type": "varchar(20)", + "nullable": false + }, + { + "name": "holderId", + "type": "varchar(64)", + "nullable": false + }, + { + "name": "heldUntil", + "type": "datetime(3)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_instance_ai_observation_locks_1", + "def": "PRIMARY KEY (observationScopeId, taskKind)", + "table": "instance_ai_observation_locks", + "columns": [ + "observationScopeId", + "taskKind" + ] + } + ], + "constraints": [ + { + "name": "observationScopeId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (observationScopeId)", + "table": "instance_ai_observation_locks", + "columns": [ + "observationScopeId" + ] + }, + { + "name": "taskKind", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (taskKind)", + "table": "instance_ai_observation_locks", + "columns": [ + "taskKind" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "instance_ai_observation_locks", + "referenced_table": "instance_ai_threads", + "columns": [ + "observationScopeId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_observation_locks_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (observationScopeId, taskKind)", + "table": "instance_ai_observation_locks", + "columns": [ + "observationScopeId", + "taskKind" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK (\"taskKind\" IN ('observer', 'reflector'))", + "table": "instance_ai_observation_locks", + "columns": [ + "taskKind" + ] + } + ], + "def": "CREATE TABLE \"instance_ai_observation_locks\" (\"observationScopeId\" varchar NOT NULL, \"taskKind\" varchar(20) NOT NULL, \"holderId\" varchar(64) NOT NULL, \"heldUntil\" datetime(3) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"CHK_instance_ai_observation_locks_taskKind\" CHECK (\"taskKind\" IN ('observer', 'reflector')), CONSTRAINT \"FK_103e2e5f454860b28ea05a82c74\" FOREIGN KEY (\"observationScopeId\") REFERENCES \"instance_ai_threads\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"observationScopeId\", \"taskKind\"))" + }, + { + "name": "instance_ai_checkpoints", + "type": "table", + "columns": [ + { + "name": "key", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "runId", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "threadId", + "type": "varchar", + "nullable": false + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "state", + "type": "TEXT", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "expiredAt", + "type": "datetime(3)", + "nullable": true + } + ], + "indexes": [ + { + "name": "IDX_be9d0eca0b19fb93d4eb74b327", + "def": "CREATE INDEX \"IDX_be9d0eca0b19fb93d4eb74b327\" ON \"instance_ai_checkpoints\" (\"resourceId\") ", + "table": "instance_ai_checkpoints", + "columns": [ + "resourceId" + ] + }, + { + "name": "IDX_2b23f3f24a70bebb990203b011", + "def": "CREATE INDEX \"IDX_2b23f3f24a70bebb990203b011\" ON \"instance_ai_checkpoints\" (\"threadId\") ", + "table": "instance_ai_checkpoints", + "columns": [ + "threadId" + ] + }, + { + "name": "IDX_768189b506cc26c4fe878b87cb", + "def": "CREATE INDEX \"IDX_768189b506cc26c4fe878b87cb\" ON \"instance_ai_checkpoints\" (\"runId\") ", + "table": "instance_ai_checkpoints", + "columns": [ + "runId" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_checkpoints_1", + "def": "PRIMARY KEY (key)", + "table": "instance_ai_checkpoints", + "columns": [ + "key" + ] + } + ], + "constraints": [ + { + "name": "key", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (key)", + "table": "instance_ai_checkpoints", + "columns": [ + "key" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "instance_ai_checkpoints", + "referenced_table": "instance_ai_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_checkpoints_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (key)", + "table": "instance_ai_checkpoints", + "columns": [ + "key" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK ((\"expiredAt\" IS NOT NULL AND \"state\" IS NULL) OR \"expiredAt\" IS NULL)", + "table": "instance_ai_checkpoints", + "columns": [ + "state", + "expiredAt" + ] + } + ], + "def": "CREATE TABLE \"instance_ai_checkpoints\" (\"key\" varchar(255) PRIMARY KEY NOT NULL, \"runId\" varchar(255), \"threadId\" varchar NOT NULL, \"resourceId\" varchar(255), \"state\" text, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"expiredAt\" datetime(3), CONSTRAINT \"instance_ai_checkpoints_state_tombstone_check\" CHECK ((\"expiredAt\" IS NOT NULL AND \"state\" IS NULL) OR \"expiredAt\" IS NULL), CONSTRAINT \"FK_2b23f3f24a70bebb990203b011e\" FOREIGN KEY (\"threadId\") REFERENCES \"instance_ai_threads\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION)" + }, + { + "name": "instance_ai_pending_confirmations", + "type": "table", + "columns": [ + { + "name": "requestId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "threadId", + "type": "varchar", + "nullable": false + }, + { + "name": "userId", + "type": "varchar", + "nullable": false + }, + { + "name": "kind", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "runId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "toolCallId", + "type": "varchar(64)", + "nullable": true + }, + { + "name": "messageGroupId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "checkpointKey", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "checkpointTaskId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "expiresAt", + "type": "datetime(3)", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_d7a4aba7440449865e2b924377", + "def": "CREATE INDEX \"IDX_d7a4aba7440449865e2b924377\" ON \"instance_ai_pending_confirmations\" (\"expiresAt\") ", + "table": "instance_ai_pending_confirmations", + "columns": [ + "expiresAt" + ] + }, + { + "name": "IDX_0babdf6e3b897a86fe4678355e", + "def": "CREATE INDEX \"IDX_0babdf6e3b897a86fe4678355e\" ON \"instance_ai_pending_confirmations\" (\"checkpointKey\") ", + "table": "instance_ai_pending_confirmations", + "columns": [ + "checkpointKey" + ] + }, + { + "name": "IDX_df5fd25c8bbfd2b042602600d8", + "def": "CREATE INDEX \"IDX_df5fd25c8bbfd2b042602600d8\" ON \"instance_ai_pending_confirmations\" (\"userId\") ", + "table": "instance_ai_pending_confirmations", + "columns": [ + "userId" + ] + }, + { + "name": "IDX_ba67ee8dc311830a2eea89b6e9", + "def": "CREATE INDEX \"IDX_ba67ee8dc311830a2eea89b6e9\" ON \"instance_ai_pending_confirmations\" (\"threadId\") ", + "table": "instance_ai_pending_confirmations", + "columns": [ + "threadId" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_pending_confirmations_1", + "def": "PRIMARY KEY (requestId)", + "table": "instance_ai_pending_confirmations", + "columns": [ + "requestId" + ] + } + ], + "constraints": [ + { + "name": "requestId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (requestId)", + "table": "instance_ai_pending_confirmations", + "columns": [ + "requestId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (checkpointKey) REFERENCES instance_ai_checkpoints (key) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "instance_ai_pending_confirmations", + "referenced_table": "instance_ai_checkpoints", + "columns": [ + "checkpointKey" + ], + "referenced_columns": [ + "key" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "instance_ai_pending_confirmations", + "referenced_table": "user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 2)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "instance_ai_pending_confirmations", + "referenced_table": "instance_ai_threads", + "columns": [ + "threadId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_pending_confirmations_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (requestId)", + "table": "instance_ai_pending_confirmations", + "columns": [ + "requestId" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK (\"kind\" IN ('suspended', 'inline'))", + "table": "instance_ai_pending_confirmations", + "columns": [ + "kind" + ] + } + ], + "def": "CREATE TABLE \"instance_ai_pending_confirmations\" (\"requestId\" varchar(36) PRIMARY KEY NOT NULL, \"threadId\" varchar NOT NULL, \"userId\" varchar NOT NULL, \"kind\" varchar(16) NOT NULL, \"runId\" varchar(36) NOT NULL, \"toolCallId\" varchar(64), \"messageGroupId\" varchar(36), \"checkpointKey\" varchar(255), \"checkpointTaskId\" varchar(36), \"expiresAt\" datetime(3), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"CHK_instance_ai_pending_confirmations_kind\" CHECK (\"kind\" IN ('suspended', 'inline')), CONSTRAINT \"FK_ba67ee8dc311830a2eea89b6e96\" FOREIGN KEY (\"threadId\") REFERENCES \"instance_ai_threads\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_df5fd25c8bbfd2b042602600d8e\" FOREIGN KEY (\"userId\") REFERENCES \"user\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_0babdf6e3b897a86fe4678355eb\" FOREIGN KEY (\"checkpointKey\") REFERENCES \"instance_ai_checkpoints\" (\"key\") ON DELETE CASCADE)" + }, + { + "name": "workflow_entity", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "active", + "type": "boolean", + "nullable": false + }, + { + "name": "nodes", + "type": "TEXT", + "nullable": true + }, + { + "name": "connections", + "type": "TEXT", + "nullable": true + }, + { + "name": "settings", + "type": "TEXT", + "nullable": true + }, + { + "name": "staticData", + "type": "TEXT", + "nullable": true + }, + { + "name": "pinData", + "type": "TEXT", + "nullable": true + }, + { + "name": "versionId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "triggerCount", + "type": "INTEGER", + "nullable": true, + "default": "0" + }, + { + "name": "meta", + "type": "TEXT", + "nullable": true + }, + { + "name": "parentFolderId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "isArchived", + "type": "boolean", + "nullable": false, + "default": "FALSE" + }, + { + "name": "versionCounter", + "type": "INTEGER", + "nullable": false, + "default": "1" + }, + { + "name": "description", + "type": "TEXT", + "nullable": true + }, + { + "name": "activeVersionId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "nodeGroups", + "type": "TEXT", + "nullable": false, + "default": "'[]'" + }, + { + "name": "sourceWorkflowId", + "type": "varchar", + "nullable": true + } + ], + "indexes": [ + { + "name": "IDX_workflow_entity_sourceWorkflowId", + "def": "CREATE INDEX \"IDX_workflow_entity_sourceWorkflowId\" ON \"workflow_entity\" (\"sourceWorkflowId\") WHERE \"sourceWorkflowId\" IS NOT NULL", + "table": "workflow_entity", + "columns": [ + "sourceWorkflowId" + ] + }, + { + "name": "IDX_e10425f6ab9964c4c1623a4a03", + "def": "CREATE INDEX \"IDX_e10425f6ab9964c4c1623a4a03\" ON \"workflow_entity\" (\"name\") ", + "table": "workflow_entity", + "columns": [ + "name" + ] + }, + { + "name": "sqlite_autoindex_workflow_entity_1", + "def": "PRIMARY KEY (id)", + "table": "workflow_entity", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "workflow_entity", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (activeVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE", + "table": "workflow_entity", + "referenced_table": "workflow_history", + "columns": [ + "activeVersionId" + ], + "referenced_columns": [ + "versionId" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (parentFolderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "workflow_entity", + "referenced_table": "folder", + "columns": [ + "parentFolderId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_workflow_entity_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "workflow_entity", + "columns": [ + "id" + ] + } + ], + "triggers": [ + { + "name": "workflow_version_increment", + "def": "CREATE TRIGGER \"workflow_version_increment\"\n\t\t\tAFTER UPDATE ON \"workflow_entity\"\n\t\t\tFOR EACH ROW\n\t\t\tWHEN OLD.\"versionCounter\" = NEW.\"versionCounter\"\n\t\t\t\tAND (OLD.\"nodes\" IS NOT NEW.\"nodes\" OR OLD.\"settings\" IS NOT NEW.\"settings\")\n\t\t\tBEGIN\n\t\t\t\tUPDATE \"workflow_entity\"\n\t\t\t\tSET \"versionCounter\" = \"versionCounter\" + 1\n\t\t\t\tWHERE \"id\" = NEW.\"id\";\n\t\t\tEND" + } + ], + "def": "CREATE TABLE \"workflow_entity\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"name\" varchar(128) NOT NULL, \"active\" boolean NOT NULL, \"nodes\" text, \"connections\" text, \"settings\" text, \"staticData\" text, \"pinData\" text, \"versionId\" varchar(36) NOT NULL, \"triggerCount\" integer DEFAULT (0), \"meta\" text, \"parentFolderId\" varchar(36), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"isArchived\" boolean NOT NULL DEFAULT (FALSE), \"versionCounter\" integer NOT NULL DEFAULT (1), \"description\" text, \"activeVersionId\" varchar(36), \"nodeGroups\" text NOT NULL DEFAULT ('[]'), \"sourceWorkflowId\" varchar, CONSTRAINT \"FK_04a4db5906fbc5606c71448d912\" FOREIGN KEY (\"parentFolderId\") REFERENCES \"folder\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_08d6c67b7f722b0039d9d5ed620\" FOREIGN KEY (\"activeVersionId\") REFERENCES \"workflow_history\" (\"versionId\") ON DELETE RESTRICT ON UPDATE NO ACTION)" + }, + { + "name": "mcp_registry_server", + "type": "table", + "columns": [ + { + "name": "slug", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "status", + "type": "varchar(50)", + "nullable": false + }, + { + "name": "version", + "type": "varchar(50)", + "nullable": false + }, + { + "name": "registryUpdatedAt", + "type": "datetime(3)", + "nullable": false + }, + { + "name": "data", + "type": "TEXT", + "nullable": false, + "default": "'{}'" + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_mcp_registry_server_1", + "def": "PRIMARY KEY (slug)", + "table": "mcp_registry_server", + "columns": [ + "slug" + ] + } + ], + "constraints": [ + { + "name": "slug", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (slug)", + "table": "mcp_registry_server", + "columns": [ + "slug" + ] + }, + { + "name": "sqlite_autoindex_mcp_registry_server_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (slug)", + "table": "mcp_registry_server", + "columns": [ + "slug" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK (\"status\" IN ('active', 'deprecated'))", + "table": "mcp_registry_server", + "columns": [ + "status" + ] + } + ], + "def": "CREATE TABLE \"mcp_registry_server\" (\"slug\" varchar(255) PRIMARY KEY NOT NULL, \"status\" varchar(50) NOT NULL, \"version\" varchar(50) NOT NULL, \"registryUpdatedAt\" datetime(3) NOT NULL, \"data\" text NOT NULL DEFAULT ('{}'), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"CHK_tmp_mcp_registry_server_status\" CHECK (\"status\" IN ('active', 'deprecated')))" + }, + { + "name": "user_api_keys", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "userId", + "type": "varchar", + "nullable": false + }, + { + "name": "label", + "type": "varchar(100)", + "nullable": false + }, + { + "name": "apiKey", + "type": "varchar", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "scopes", + "type": "TEXT", + "nullable": true + }, + { + "name": "audience", + "type": "varchar", + "nullable": false, + "default": "'public-api'" + }, + { + "name": "lastUsedAt", + "type": "datetime(3)", + "nullable": true + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_user_api_keys_3", + "def": "UNIQUE (userId, label)", + "table": "user_api_keys", + "columns": [ + "userId", + "label" + ] + }, + { + "name": "sqlite_autoindex_user_api_keys_2", + "def": "UNIQUE (apiKey)", + "table": "user_api_keys", + "columns": [ + "apiKey" + ] + }, + { + "name": "sqlite_autoindex_user_api_keys_1", + "def": "PRIMARY KEY (id)", + "table": "user_api_keys", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "user_api_keys", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "user_api_keys", + "referenced_table": "user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_user_api_keys_3", + "type": "UNIQUE", + "def": "UNIQUE (userId, label)", + "table": "user_api_keys", + "columns": [ + "userId", + "label" + ] + }, + { + "name": "sqlite_autoindex_user_api_keys_2", + "type": "UNIQUE", + "def": "UNIQUE (apiKey)", + "table": "user_api_keys", + "columns": [ + "apiKey" + ] + }, + { + "name": "sqlite_autoindex_user_api_keys_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "user_api_keys", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"user_api_keys\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"userId\" varchar NOT NULL, \"label\" varchar(100) NOT NULL, \"apiKey\" varchar NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"scopes\" text, \"audience\" varchar NOT NULL DEFAULT ('public-api'), \"lastUsedAt\" datetime(3), CONSTRAINT \"UQ_1ef35bac35d20bdae979d917a36\" UNIQUE (\"apiKey\"), CONSTRAINT \"UQ_63d7bbae72c767cf162d459fccd\" UNIQUE (\"userId\", \"label\"), CONSTRAINT \"FK_e131705cbbc8fb589889b02d457\" FOREIGN KEY (\"userId\") REFERENCES \"user\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION)" + }, + { + "name": "agent_files", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(16)", + "nullable": false + }, + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "binaryDataId", + "type": "TEXT", + "nullable": false + }, + { + "name": "fileName", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "mimeType", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "fileSizeBytes", + "type": "INTEGER", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_45dafc48fe2ce95eac30fc8ffd", + "def": "CREATE INDEX \"IDX_45dafc48fe2ce95eac30fc8ffd\" ON \"agent_files\" (\"agentId\", \"createdAt\") ", + "table": "agent_files", + "columns": [ + "agentId", + "createdAt" + ] + }, + { + "name": "sqlite_autoindex_agent_files_1", + "def": "PRIMARY KEY (id)", + "table": "agent_files", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agent_files", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agent_files", + "referenced_table": "agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agent_files_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agent_files", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"agent_files\" (\"id\" varchar(16) PRIMARY KEY NOT NULL, \"agentId\" varchar(36) NOT NULL, \"binaryDataId\" text NOT NULL, \"fileName\" varchar(255) NOT NULL, \"mimeType\" varchar(255) NOT NULL, \"fileSizeBytes\" integer NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_aca4514cb500494b64356c2e164\" FOREIGN KEY (\"agentId\") REFERENCES \"agents\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "binary_data", + "type": "table", + "columns": [ + { + "name": "fileId", + "type": "varchar", + "nullable": false + }, + { + "name": "sourceType", + "type": "varchar(50)", + "nullable": false + }, + { + "name": "sourceId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "data", + "type": "BLOB", + "nullable": false + }, + { + "name": "mimeType", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "fileName", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "fileSize", + "type": "INTEGER", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_56900edc3cfd16612e2ef2c6a8", + "def": "CREATE INDEX \"IDX_56900edc3cfd16612e2ef2c6a8\" ON \"binary_data\" (\"sourceType\", \"sourceId\") ", + "table": "binary_data", + "columns": [ + "sourceType", + "sourceId" + ] + }, + { + "name": "sqlite_autoindex_binary_data_1", + "def": "PRIMARY KEY (fileId)", + "table": "binary_data", + "columns": [ + "fileId" + ] + } + ], + "constraints": [ + { + "name": "fileId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (fileId)", + "table": "binary_data", + "columns": [ + "fileId" + ] + }, + { + "name": "sqlite_autoindex_binary_data_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (fileId)", + "table": "binary_data", + "columns": [ + "fileId" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK (\"sourceType\" IN ('execution', 'chat_message_attachment', 'agent_file'))", + "table": "binary_data", + "columns": [ + "sourceType" + ] + } + ], + "def": "CREATE TABLE \"binary_data\" (\"fileId\" varchar PRIMARY KEY NOT NULL, \"sourceType\" varchar(50) NOT NULL, \"sourceId\" varchar(255) NOT NULL, \"data\" blob NOT NULL, \"mimeType\" varchar(255), \"fileName\" varchar(255), \"fileSize\" integer NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"CHK_binary_data_sourceType\" CHECK (\"sourceType\" IN ('execution', 'chat_message_attachment', 'agent_file')))" + }, + { + "name": "project", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "type", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "icon", + "type": "TEXT", + "nullable": true + }, + { + "name": "description", + "type": "varchar(512)", + "nullable": true + }, + { + "name": "creatorId", + "type": "varchar", + "nullable": true + }, + { + "name": "customTelemetryTags", + "type": "TEXT", + "nullable": false, + "default": "'[]'" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_project_1", + "def": "PRIMARY KEY (id)", + "table": "project", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "project", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (creatorId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "project", + "referenced_table": "user", + "columns": [ + "creatorId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_project_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "project", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"project\" (\"id\" varchar(36) PRIMARY KEY NOT NULL, \"name\" varchar(255) NOT NULL, \"type\" varchar(36) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"icon\" text, \"description\" varchar(512), \"creatorId\" varchar, \"customTelemetryTags\" text NOT NULL DEFAULT ('[]'), CONSTRAINT \"projects_creatorId_foreign\" FOREIGN KEY (\"creatorId\") REFERENCES \"user\" (\"id\") ON DELETE SET NULL ON UPDATE NO ACTION)" + }, + { + "name": "agent_task_definition", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(32)", + "nullable": false + }, + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "objective", + "type": "TEXT", + "nullable": false + }, + { + "name": "cronExpression", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_f45d0535a2ed59b6c2dd6da98a", + "def": "CREATE INDEX \"IDX_f45d0535a2ed59b6c2dd6da98a\" ON \"agent_task_definition\" (\"agentId\") ", + "table": "agent_task_definition", + "columns": [ + "agentId" + ] + }, + { + "name": "sqlite_autoindex_agent_task_definition_1", + "def": "PRIMARY KEY (id)", + "table": "agent_task_definition", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agent_task_definition", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agent_task_definition", + "referenced_table": "agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agent_task_definition_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agent_task_definition", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"agent_task_definition\" (\"id\" varchar(32) PRIMARY KEY NOT NULL, \"agentId\" varchar(36) NOT NULL, \"name\" varchar(128) NOT NULL, \"objective\" text NOT NULL, \"cronExpression\" varchar(128) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_f45d0535a2ed59b6c2dd6da98a0\" FOREIGN KEY (\"agentId\") REFERENCES \"agents\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "agent_task_snapshot", + "type": "table", + "columns": [ + { + "name": "versionId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "taskId", + "type": "varchar(32)", + "nullable": false + }, + { + "name": "enabled", + "type": "boolean", + "nullable": false + }, + { + "name": "name", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "objective", + "type": "TEXT", + "nullable": false + }, + { + "name": "cronExpression", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_agent_task_snapshot_1", + "def": "PRIMARY KEY (versionId, taskId)", + "table": "agent_task_snapshot", + "columns": [ + "versionId", + "taskId" + ] + } + ], + "constraints": [ + { + "name": "versionId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (versionId)", + "table": "agent_task_snapshot", + "columns": [ + "versionId" + ] + }, + { + "name": "taskId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (taskId)", + "table": "agent_task_snapshot", + "columns": [ + "taskId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (versionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agent_task_snapshot", + "referenced_table": "agent_history", + "columns": [ + "versionId" + ], + "referenced_columns": [ + "versionId" + ] + }, + { + "name": "sqlite_autoindex_agent_task_snapshot_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (versionId, taskId)", + "table": "agent_task_snapshot", + "columns": [ + "versionId", + "taskId" + ] + } + ], + "def": "CREATE TABLE \"agent_task_snapshot\" (\"versionId\" varchar(36) NOT NULL, \"taskId\" varchar(32) NOT NULL, \"enabled\" boolean NOT NULL, \"name\" varchar(128) NOT NULL, \"objective\" text NOT NULL, \"cronExpression\" varchar(128) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_1acedce6690392ef1611cca8b88\" FOREIGN KEY (\"versionId\") REFERENCES \"agent_history\" (\"versionId\") ON DELETE CASCADE, PRIMARY KEY (\"versionId\", \"taskId\"))" + }, + { + "name": "agent_task_run_lock", + "type": "table", + "columns": [ + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "taskId", + "type": "varchar(32)", + "nullable": false + }, + { + "name": "holderId", + "type": "varchar", + "nullable": false + }, + { + "name": "heldUntil", + "type": "datetime(3)", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_agent_task_run_lock_1", + "def": "PRIMARY KEY (agentId, taskId)", + "table": "agent_task_run_lock", + "columns": [ + "agentId", + "taskId" + ] + } + ], + "constraints": [ + { + "name": "agentId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (agentId)", + "table": "agent_task_run_lock", + "columns": [ + "agentId" + ] + }, + { + "name": "taskId", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (taskId)", + "table": "agent_task_run_lock", + "columns": [ + "taskId" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agent_task_run_lock", + "referenced_table": "agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agent_task_run_lock_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (agentId, taskId)", + "table": "agent_task_run_lock", + "columns": [ + "agentId", + "taskId" + ] + } + ], + "def": "CREATE TABLE \"agent_task_run_lock\" (\"agentId\" varchar(36) NOT NULL, \"taskId\" varchar(32) NOT NULL, \"holderId\" varchar NOT NULL, \"heldUntil\" datetime(3) NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_b57a2862ae869aab24e54cefd48\" FOREIGN KEY (\"agentId\") REFERENCES \"agents\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"agentId\", \"taskId\"))" + }, + { + "name": "agent_execution_threads", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar(128)", + "nullable": false + }, + { + "name": "agentId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "agentName", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "projectId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "sessionNumber", + "type": "INTEGER", + "nullable": false, + "default": "0" + }, + { + "name": "totalPromptTokens", + "type": "INTEGER", + "nullable": false, + "default": "0" + }, + { + "name": "totalCompletionTokens", + "type": "INTEGER", + "nullable": false, + "default": "0" + }, + { + "name": "totalCost", + "type": "REAL", + "nullable": false, + "default": "0" + }, + { + "name": "totalDuration", + "type": "INTEGER", + "nullable": false, + "default": "0" + }, + { + "name": "title", + "type": "varchar(255)", + "nullable": true + }, + { + "name": "emoji", + "type": "varchar(8)", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "taskId", + "type": "varchar(32)", + "nullable": true + }, + { + "name": "taskVersionId", + "type": "varchar(36)", + "nullable": true + }, + { + "name": "parentThreadId", + "type": "varchar(128)", + "nullable": true + }, + { + "name": "parentAgentId", + "type": "varchar(36)", + "nullable": true + } + ], + "indexes": [ + { + "name": "IDX_agent_execution_threads_taskVersionId", + "def": "CREATE INDEX \"IDX_agent_execution_threads_taskVersionId\" ON \"agent_execution_threads\" (\"taskVersionId\") ", + "table": "agent_execution_threads", + "columns": [ + "taskVersionId" + ] + }, + { + "name": "IDX_0468a9dc35597314e641d4722a", + "def": "CREATE INDEX \"IDX_0468a9dc35597314e641d4722a\" ON \"agent_execution_threads\" (\"agentId\") ", + "table": "agent_execution_threads", + "columns": [ + "agentId" + ] + }, + { + "name": "IDX_0e2f8bf92a7a9c88b89670f701", + "def": "CREATE INDEX \"IDX_0e2f8bf92a7a9c88b89670f701\" ON \"agent_execution_threads\" (\"projectId\") ", + "table": "agent_execution_threads", + "columns": [ + "projectId" + ] + }, + { + "name": "sqlite_autoindex_agent_execution_threads_1", + "def": "PRIMARY KEY (id)", + "table": "agent_execution_threads", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agent_execution_threads", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (taskVersionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE", + "table": "agent_execution_threads", + "referenced_table": "agent_history", + "columns": [ + "taskVersionId" + ], + "referenced_columns": [ + "versionId" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agent_execution_threads", + "referenced_table": "agents", + "columns": [ + "agentId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 2)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "agent_execution_threads", + "referenced_table": "project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_agent_execution_threads_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "agent_execution_threads", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"agent_execution_threads\" (\"id\" varchar(128) PRIMARY KEY NOT NULL, \"agentId\" varchar(36) NOT NULL, \"agentName\" varchar(255) NOT NULL, \"projectId\" varchar(255) NOT NULL, \"sessionNumber\" integer NOT NULL DEFAULT (0), \"totalPromptTokens\" integer NOT NULL DEFAULT (0), \"totalCompletionTokens\" integer NOT NULL DEFAULT (0), \"totalCost\" real NOT NULL DEFAULT (0), \"totalDuration\" integer NOT NULL DEFAULT (0), \"title\" varchar(255), \"emoji\" varchar(8), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"taskId\" varchar(32), \"taskVersionId\" varchar(36), \"parentThreadId\" varchar(128), \"parentAgentId\" varchar(36), CONSTRAINT \"FK_0e2f8bf92a7a9c88b89670f701c\" FOREIGN KEY (\"projectId\") REFERENCES \"project\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_0468a9dc35597314e641d4722aa\" FOREIGN KEY (\"agentId\") REFERENCES \"agents\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_f00b52d74fe11838e1fe086deea\" FOREIGN KEY (\"taskVersionId\") REFERENCES \"agent_history\" (\"versionId\") ON DELETE SET NULL)" + }, + { + "name": "instance_ai_mcp_registry_connections", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar", + "nullable": false + }, + { + "name": "credentialId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "serverSlug", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "toolFilter", + "type": "TEXT", + "nullable": true + }, + { + "name": "userId", + "type": "varchar", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_16db3adb7b19df1ee55ff06b27", + "def": "CREATE UNIQUE INDEX \"IDX_16db3adb7b19df1ee55ff06b27\" ON \"instance_ai_mcp_registry_connections\" (\"userId\", \"serverSlug\", \"credentialId\") ", + "table": "instance_ai_mcp_registry_connections", + "columns": [ + "userId", + "serverSlug", + "credentialId" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_mcp_registry_connections_1", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_mcp_registry_connections", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_mcp_registry_connections", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "instance_ai_mcp_registry_connections", + "referenced_table": "user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (serverSlug) REFERENCES mcp_registry_server (slug) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "instance_ai_mcp_registry_connections", + "referenced_table": "mcp_registry_server", + "columns": [ + "serverSlug" + ], + "referenced_columns": [ + "slug" + ] + }, + { + "name": "- (Foreign key ID: 2)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "instance_ai_mcp_registry_connections", + "referenced_table": "credentials_entity", + "columns": [ + "credentialId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_mcp_registry_connections_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_mcp_registry_connections", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"instance_ai_mcp_registry_connections\" (\"id\" varchar PRIMARY KEY NOT NULL, \"credentialId\" varchar(36) NOT NULL, \"serverSlug\" varchar(255) NOT NULL, \"toolFilter\" text, \"userId\" varchar NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_1e826120e7e53ebc4681f026de8\" FOREIGN KEY (\"credentialId\") REFERENCES \"credentials_entity\" (\"id\") ON DELETE CASCADE, CONSTRAINT \"FK_1d25707354d2012da256eb2ec0a\" FOREIGN KEY (\"serverSlug\") REFERENCES \"mcp_registry_server\" (\"slug\") ON DELETE CASCADE, CONSTRAINT \"FK_8b42c08a531d76410980c639a5b\" FOREIGN KEY (\"userId\") REFERENCES \"user\" (\"id\") ON DELETE CASCADE)" + }, + { + "name": "oauth_authorization_codes", + "type": "table", + "columns": [ + { + "name": "code", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "clientId", + "type": "varchar", + "nullable": false + }, + { + "name": "userId", + "type": "varchar", + "nullable": false + }, + { + "name": "redirectUri", + "type": "varchar", + "nullable": false + }, + { + "name": "codeChallenge", + "type": "varchar", + "nullable": false + }, + { + "name": "codeChallengeMethod", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "expiresAt", + "type": "bigint", + "nullable": false + }, + { + "name": "state", + "type": "varchar", + "nullable": true + }, + { + "name": "used", + "type": "boolean", + "nullable": false, + "default": "false" + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "resource", + "type": "varchar", + "nullable": true + }, + { + "name": "scope", + "type": "TEXT", + "nullable": false, + "default": "'[\"tool:listWorkflows\",\"tool:getWorkflowDetails\"]'" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_oauth_authorization_codes_1", + "def": "PRIMARY KEY (code)", + "table": "oauth_authorization_codes", + "columns": [ + "code" + ] + } + ], + "constraints": [ + { + "name": "code", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (code)", + "table": "oauth_authorization_codes", + "columns": [ + "code" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "oauth_authorization_codes", + "referenced_table": "oauth_clients", + "columns": [ + "clientId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "oauth_authorization_codes", + "referenced_table": "user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_oauth_authorization_codes_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (code)", + "table": "oauth_authorization_codes", + "columns": [ + "code" + ] + } + ], + "def": "CREATE TABLE \"oauth_authorization_codes\" (\"code\" varchar(255) PRIMARY KEY NOT NULL, \"clientId\" varchar NOT NULL, \"userId\" varchar NOT NULL, \"redirectUri\" varchar NOT NULL, \"codeChallenge\" varchar NOT NULL, \"codeChallengeMethod\" varchar(255) NOT NULL, \"expiresAt\" bigint NOT NULL, \"state\" varchar, \"used\" boolean NOT NULL DEFAULT (false), \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"resource\" varchar, \"scope\" text NOT NULL DEFAULT ('[\"tool:listWorkflows\",\"tool:getWorkflowDetails\"]'), CONSTRAINT \"FK_e829ca1240b877f73fd5fab14a2\" FOREIGN KEY (\"userId\") REFERENCES \"user\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_81de58036895ccabf2214c6d99e\" FOREIGN KEY (\"clientId\") REFERENCES \"oauth_clients\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION)" + }, + { + "name": "oauth_refresh_tokens", + "type": "table", + "columns": [ + { + "name": "token", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "clientId", + "type": "varchar", + "nullable": false + }, + { + "name": "userId", + "type": "varchar", + "nullable": false + }, + { + "name": "expiresAt", + "type": "bigint", + "nullable": false + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "scope", + "type": "TEXT", + "nullable": false, + "default": "'[\"tool:listWorkflows\",\"tool:getWorkflowDetails\"]'" + } + ], + "indexes": [ + { + "name": "sqlite_autoindex_oauth_refresh_tokens_1", + "def": "PRIMARY KEY (token)", + "table": "oauth_refresh_tokens", + "columns": [ + "token" + ] + } + ], + "constraints": [ + { + "name": "token", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (token)", + "table": "oauth_refresh_tokens", + "columns": [ + "token" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "oauth_refresh_tokens", + "referenced_table": "oauth_clients", + "columns": [ + "clientId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 1)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "oauth_refresh_tokens", + "referenced_table": "user", + "columns": [ + "userId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_oauth_refresh_tokens_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (token)", + "table": "oauth_refresh_tokens", + "columns": [ + "token" + ] + } + ], + "def": "CREATE TABLE \"oauth_refresh_tokens\" (\"token\" varchar(255) PRIMARY KEY NOT NULL, \"clientId\" varchar NOT NULL, \"userId\" varchar NOT NULL, \"expiresAt\" bigint NOT NULL, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"scope\" text NOT NULL DEFAULT ('[\"tool:listWorkflows\",\"tool:getWorkflowDetails\"]'), CONSTRAINT \"FK_a699f3ed9fd0c1b19bc2608ac53\" FOREIGN KEY (\"userId\") REFERENCES \"user\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT \"FK_b388696ce4d8be7ffbe8d3e4b69\" FOREIGN KEY (\"clientId\") REFERENCES \"oauth_clients\" (\"id\") ON DELETE CASCADE ON UPDATE NO ACTION)" + }, + { + "name": "workflow_publication_outbox", + "type": "table", + "columns": [ + { + "name": "id", + "type": "INTEGER", + "nullable": false + }, + { + "name": "workflowId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "publishedVersionId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "status", + "type": "varchar(20)", + "nullable": false + }, + { + "name": "errorMessage", + "type": "TEXT", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_workflow_publication_outbox_active_workflow_status", + "def": "CREATE UNIQUE INDEX \"IDX_workflow_publication_outbox_active_workflow_status\" ON \"workflow_publication_outbox\" (\"workflowId\", \"status\") WHERE status IN ('pending', 'in_progress')", + "table": "workflow_publication_outbox", + "columns": [ + "workflowId", + "status" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "workflow_publication_outbox", + "columns": [ + "id" + ] + }, + { + "name": "-", + "type": "CHECK", + "def": "CHECK (\"status\" IN ('pending', 'in_progress', 'completed', 'partial_success', 'failed'))", + "table": "workflow_publication_outbox", + "columns": [ + "status" + ] + } + ], + "def": "CREATE TABLE \"workflow_publication_outbox\" (\"id\" integer PRIMARY KEY NOT NULL, \"workflowId\" varchar(36) NOT NULL, \"publishedVersionId\" varchar(36) NOT NULL, \"status\" varchar(20) NOT NULL, \"errorMessage\" text, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"CHK_workflow_publication_outbox_status\" CHECK (\"status\" IN ('pending', 'in_progress', 'completed', 'partial_success', 'failed')))" + }, + { + "name": "instance_ai_threads", + "type": "table", + "columns": [ + { + "name": "id", + "type": "varchar", + "nullable": false + }, + { + "name": "resourceId", + "type": "varchar(255)", + "nullable": false + }, + { + "name": "projectId", + "type": "varchar(36)", + "nullable": false + }, + { + "name": "title", + "type": "TEXT", + "nullable": false, + "default": "''" + }, + { + "name": "metadata", + "type": "TEXT", + "nullable": true + }, + { + "name": "createdAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + }, + { + "name": "updatedAt", + "type": "datetime(3)", + "nullable": false, + "default": "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" + } + ], + "indexes": [ + { + "name": "IDX_instance_ai_threads_projectId", + "def": "CREATE INDEX \"IDX_instance_ai_threads_projectId\" ON \"instance_ai_threads\" (\"projectId\") ", + "table": "instance_ai_threads", + "columns": [ + "projectId" + ] + }, + { + "name": "IDX_instance_ai_threads_resourceId", + "def": "CREATE INDEX \"IDX_instance_ai_threads_resourceId\" ON \"instance_ai_threads\" (\"resourceId\") ", + "table": "instance_ai_threads", + "columns": [ + "resourceId" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_threads_1", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_threads", + "columns": [ + "id" + ] + } + ], + "constraints": [ + { + "name": "id", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_threads", + "columns": [ + "id" + ] + }, + { + "name": "- (Foreign key ID: 0)", + "type": "FOREIGN KEY", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE", + "table": "instance_ai_threads", + "referenced_table": "project", + "columns": [ + "projectId" + ], + "referenced_columns": [ + "id" + ] + }, + { + "name": "sqlite_autoindex_instance_ai_threads_1", + "type": "PRIMARY KEY", + "def": "PRIMARY KEY (id)", + "table": "instance_ai_threads", + "columns": [ + "id" + ] + } + ], + "def": "CREATE TABLE \"instance_ai_threads\" (\"id\" varchar PRIMARY KEY NOT NULL, \"resourceId\" varchar(255) NOT NULL, \"projectId\" varchar(36) NOT NULL, \"title\" text NOT NULL DEFAULT (''), \"metadata\" text, \"createdAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), \"updatedAt\" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT \"FK_instance_ai_threads_projectId\" FOREIGN KEY (\"projectId\") REFERENCES \"project\" (\"id\") ON DELETE CASCADE)" + } + ], + "relations": [ + { + "table": "installed_nodes", + "columns": [ + "package" + ], + "cardinality": "zero_or_more", + "parent_table": "installed_packages", + "parent_columns": [ + "packageName" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (package) REFERENCES installed_packages (packageName) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE" + }, + { + "table": "auth_identity", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" + }, + { + "table": "workflows_tags", + "columns": [ + "tagId" + ], + "cardinality": "zero_or_one", + "parent_table": "tag_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (tagId) REFERENCES tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "workflows_tags", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_one", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "execution_data", + "columns": [ + "executionId" + ], + "cardinality": "zero_or_one", + "parent_table": "execution_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "shared_credentials", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_one", + "parent_table": "project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "shared_credentials", + "columns": [ + "credentialsId" + ], + "cardinality": "zero_or_one", + "parent_table": "credentials_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (credentialsId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "shared_workflow", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_one", + "parent_table": "project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "shared_workflow", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_one", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "execution_metadata", + "columns": [ + "executionId" + ], + "cardinality": "zero_or_more", + "parent_table": "execution_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "execution_annotations", + "columns": [ + "executionId" + ], + "cardinality": "zero_or_more", + "parent_table": "execution_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "execution_annotation_tags", + "columns": [ + "tagId" + ], + "cardinality": "zero_or_one", + "parent_table": "annotation_tag_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (tagId) REFERENCES annotation_tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "execution_annotation_tags", + "columns": [ + "annotationId" + ], + "cardinality": "zero_or_one", + "parent_table": "execution_annotations", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (annotationId) REFERENCES execution_annotations (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "processed_data", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_one", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "folder", + "columns": [ + "parentFolderId" + ], + "cardinality": "zero_or_more", + "parent_table": "folder", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (parentFolderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "folder", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "folder_tag", + "columns": [ + "tagId" + ], + "cardinality": "zero_or_one", + "parent_table": "tag_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (tagId) REFERENCES tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "folder_tag", + "columns": [ + "folderId" + ], + "cardinality": "zero_or_one", + "parent_table": "folder", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (folderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "insights_metadata", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "insights_metadata", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "role_scope", + "columns": [ + "scopeSlug" + ], + "cardinality": "zero_or_one", + "parent_table": "scope", + "parent_columns": [ + "slug" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (scopeSlug) REFERENCES scope (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE" + }, + { + "table": "role_scope", + "columns": [ + "roleSlug" + ], + "cardinality": "zero_or_one", + "parent_table": "role", + "parent_columns": [ + "slug" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (roleSlug) REFERENCES role (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE" + }, + { + "table": "user", + "columns": [ + "roleSlug" + ], + "cardinality": "zero_or_more", + "parent_table": "role", + "parent_columns": [ + "slug" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (roleSlug) REFERENCES role (slug) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" + }, + { + "table": "test_case_execution", + "columns": [ + "testRunId" + ], + "cardinality": "zero_or_more", + "parent_table": "test_run", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (testRunId) REFERENCES test_run (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "test_case_execution", + "columns": [ + "pastExecutionId" + ], + "cardinality": "zero_or_more", + "parent_table": "execution_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (pastExecutionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "test_case_execution", + "columns": [ + "executionId" + ], + "cardinality": "zero_or_more", + "parent_table": "execution_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "test_case_execution", + "columns": [ + "evaluationExecutionId" + ], + "cardinality": "zero_or_more", + "parent_table": "execution_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (evaluationExecutionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "project_relation", + "columns": [ + "role" + ], + "cardinality": "zero_or_more", + "parent_table": "role", + "parent_columns": [ + "slug" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (role) REFERENCES role (slug) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" + }, + { + "table": "project_relation", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_one", + "parent_table": "project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "project_relation", + "columns": [ + "userId" + ], + "cardinality": "zero_or_one", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "data_table", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "data_table_column", + "columns": [ + "dataTableId" + ], + "cardinality": "zero_or_more", + "parent_table": "data_table", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (dataTableId) REFERENCES data_table (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "variables", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "insights_raw", + "columns": [ + "metaId" + ], + "cardinality": "zero_or_more", + "parent_table": "insights_metadata", + "parent_columns": [ + "metaId" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (metaId) REFERENCES insights_metadata (metaId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "insights_by_period", + "columns": [ + "metaId" + ], + "cardinality": "zero_or_more", + "parent_table": "insights_metadata", + "parent_columns": [ + "metaId" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (metaId) REFERENCES insights_metadata (metaId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "oauth_access_tokens", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "oauth_access_tokens", + "columns": [ + "clientId" + ], + "cardinality": "zero_or_more", + "parent_table": "oauth_clients", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "oauth_user_consents", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "oauth_user_consents", + "columns": [ + "clientId" + ], + "cardinality": "zero_or_more", + "parent_table": "oauth_clients", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "credentials_entity", + "columns": [ + "resolverId" + ], + "cardinality": "zero_or_more", + "parent_table": "dynamic_credential_resolver", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (resolverId) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "chat_hub_messages", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "chat_hub_agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "chat_hub_messages", + "columns": [ + "executionId" + ], + "cardinality": "zero_or_more", + "parent_table": "execution_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "chat_hub_messages", + "columns": [ + "revisionOfMessageId" + ], + "cardinality": "zero_or_more", + "parent_table": "chat_hub_messages", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (revisionOfMessageId) REFERENCES chat_hub_messages (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "chat_hub_messages", + "columns": [ + "retryOfMessageId" + ], + "cardinality": "zero_or_more", + "parent_table": "chat_hub_messages", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (retryOfMessageId) REFERENCES chat_hub_messages (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "chat_hub_messages", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "chat_hub_messages", + "columns": [ + "previousMessageId" + ], + "cardinality": "zero_or_more", + "parent_table": "chat_hub_messages", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (previousMessageId) REFERENCES chat_hub_messages (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "chat_hub_messages", + "columns": [ + "sessionId" + ], + "cardinality": "zero_or_more", + "parent_table": "chat_hub_sessions", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (sessionId) REFERENCES chat_hub_sessions (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "dynamic_credential_user_entry", + "columns": [ + "userId" + ], + "cardinality": "zero_or_one", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "dynamic_credential_user_entry", + "columns": [ + "resolverId" + ], + "cardinality": "zero_or_one", + "parent_table": "dynamic_credential_resolver", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (resolverId) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "dynamic_credential_user_entry", + "columns": [ + "credentialId" + ], + "cardinality": "zero_or_one", + "parent_table": "credentials_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "workflow_dependency", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "dynamic_credential_entry", + "columns": [ + "resolver_id" + ], + "cardinality": "zero_or_one", + "parent_table": "dynamic_credential_resolver", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (resolver_id) REFERENCES dynamic_credential_resolver (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "dynamic_credential_entry", + "columns": [ + "credential_id" + ], + "cardinality": "zero_or_one", + "parent_table": "credentials_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (credential_id) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "chat_hub_tools", + "columns": [ + "ownerId" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "chat_hub_session_tools", + "columns": [ + "toolId" + ], + "cardinality": "zero_or_one", + "parent_table": "chat_hub_tools", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (toolId) REFERENCES chat_hub_tools (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "chat_hub_session_tools", + "columns": [ + "sessionId" + ], + "cardinality": "zero_or_one", + "parent_table": "chat_hub_sessions", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (sessionId) REFERENCES chat_hub_sessions (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "chat_hub_agent_tools", + "columns": [ + "toolId" + ], + "cardinality": "zero_or_one", + "parent_table": "chat_hub_tools", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (toolId) REFERENCES chat_hub_tools (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "chat_hub_agent_tools", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_one", + "parent_table": "chat_hub_agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "chat_hub_agents", + "columns": [ + "ownerId" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "chat_hub_agents", + "columns": [ + "credentialId" + ], + "cardinality": "zero_or_more", + "parent_table": "credentials_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "project_secrets_provider_access", + "columns": [ + "secretsProviderConnectionId" + ], + "cardinality": "zero_or_one", + "parent_table": "secrets_provider_connection", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (secretsProviderConnectionId) REFERENCES secrets_provider_connection (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "project_secrets_provider_access", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_one", + "parent_table": "project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "workflow_published_version", + "columns": [ + "publishedVersionId" + ], + "cardinality": "zero_or_more", + "parent_table": "workflow_history", + "parent_columns": [ + "versionId" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (publishedVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE" + }, + { + "table": "workflow_published_version", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_one", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE" + }, + { + "table": "workflow_published_version", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_one", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "workflow_published_version", + "columns": [ + "publishedVersionId" + ], + "cardinality": "zero_or_more", + "parent_table": "workflow_history", + "parent_columns": [ + "versionId" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (publishedVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "chat_hub_sessions", + "columns": [ + "ownerId" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "chat_hub_sessions", + "columns": [ + "credentialId" + ], + "cardinality": "zero_or_more", + "parent_table": "credentials_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "chat_hub_sessions", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "chat_hub_sessions", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "chat_hub_agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (agentId) REFERENCES chat_hub_agents (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "role_mapping_rule", + "columns": [ + "role" + ], + "cardinality": "zero_or_more", + "parent_table": "role", + "parent_columns": [ + "slug" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (role) REFERENCES role (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE" + }, + { + "table": "role_mapping_rule_project", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_one", + "parent_table": "project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "role_mapping_rule_project", + "columns": [ + "roleMappingRuleId" + ], + "cardinality": "zero_or_one", + "parent_table": "role_mapping_rule", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (roleMappingRuleId) REFERENCES role_mapping_rule (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "credential_dependency", + "columns": [ + "credentialId" + ], + "cardinality": "zero_or_more", + "parent_table": "credentials_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "workflow_builder_session", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "workflow_builder_session", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "instance_ai_messages", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "instance_ai_observational_memory", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "instance_ai_iteration_logs", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "workflow_publish_history", + "columns": [ + "versionId" + ], + "cardinality": "zero_or_more", + "parent_table": "workflow_history", + "parent_columns": [ + "versionId" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (versionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "workflow_publish_history", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "workflow_publish_history", + "columns": [ + "versionId" + ], + "cardinality": "zero_or_more", + "parent_table": "workflow_history", + "parent_columns": [ + "versionId" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (versionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "workflow_publish_history", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "trusted_key", + "columns": [ + "sourceId" + ], + "cardinality": "zero_or_one", + "parent_table": "trusted_key_source", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (sourceId) REFERENCES trusted_key_source (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "user_favorites", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "ai_builder_temporary_workflow", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "ai_builder_temporary_workflow", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_one", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "execution_entity", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "evaluation_config", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "evaluation_collection", + "columns": [ + "createdById" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (createdById) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "evaluation_collection", + "columns": [ + "evaluationConfigId" + ], + "cardinality": "zero_or_more", + "parent_table": "evaluation_config", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (evaluationConfigId) REFERENCES evaluation_config (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "evaluation_collection", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "test_run", + "columns": [ + "collectionId" + ], + "cardinality": "zero_or_more", + "parent_table": "evaluation_collection", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (collectionId) REFERENCES evaluation_collection (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "test_run", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "test_run", + "columns": [ + "evaluationConfigId" + ], + "cardinality": "zero_or_more", + "parent_table": "evaluation_config", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (evaluationConfigId) REFERENCES evaluation_config (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "agent_checkpoints", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_messages", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "agents_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (threadId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agent_execution", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "agent_execution_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (threadId) REFERENCES agent_execution_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "workflow_history", + "columns": [ + "workflowId" + ], + "cardinality": "zero_or_more", + "parent_table": "workflow_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "instance_ai_run_snapshots", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_one", + "parent_table": "instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_observations", + "columns": [ + "supersededBy" + ], + "cardinality": "zero_or_more", + "parent_table": "agents_observations", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (supersededBy) REFERENCES agents_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" + }, + { + "table": "agents_observations", + "columns": [ + "parentId" + ], + "cardinality": "zero_or_more", + "parent_table": "agents_observations", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (parentId) REFERENCES agents_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" + }, + { + "table": "agents_observations", + "columns": [ + "observationScopeId" + ], + "cardinality": "zero_or_more", + "parent_table": "agents_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_observations", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_observation_cursors", + "columns": [ + "observationScopeId" + ], + "cardinality": "zero_or_one", + "parent_table": "agents_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_observation_cursors", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_one", + "parent_table": "agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_observation_locks", + "columns": [ + "observationScopeId" + ], + "cardinality": "zero_or_one", + "parent_table": "agents_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_observation_locks", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_one", + "parent_table": "agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_memory_entries", + "columns": [ + "supersededBy" + ], + "cardinality": "zero_or_more", + "parent_table": "agents_memory_entries", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (supersededBy) REFERENCES agents_memory_entries (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" + }, + { + "table": "agents_memory_entries", + "columns": [ + "resourceId" + ], + "cardinality": "zero_or_more", + "parent_table": "agents_resources", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (resourceId) REFERENCES agents_resources (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_memory_entries", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_memory_entry_locks", + "columns": [ + "resourceId" + ], + "cardinality": "zero_or_one", + "parent_table": "agents_resources", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (resourceId) REFERENCES agents_resources (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_memory_entry_locks", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_one", + "parent_table": "agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_memory_entry_sources", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "agents_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (threadId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_memory_entry_sources", + "columns": [ + "observationId" + ], + "cardinality": "zero_or_more", + "parent_table": "agents_observations", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (observationId) REFERENCES agents_observations (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_memory_entry_sources", + "columns": [ + "memoryEntryId" + ], + "cardinality": "zero_or_more", + "parent_table": "agents_memory_entries", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (memoryEntryId) REFERENCES agents_memory_entries (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_memory_entry_sources", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_memory_entry_cursors", + "columns": [ + "observationScopeId" + ], + "cardinality": "zero_or_one", + "parent_table": "agents_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (observationScopeId) REFERENCES agents_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents_memory_entry_cursors", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_one", + "parent_table": "agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agent_history", + "columns": [ + "publishedById" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (publishedById) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "agent_history", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agents", + "columns": [ + "activeVersionId" + ], + "cardinality": "zero_or_more", + "parent_table": "agent_history", + "parent_columns": [ + "versionId" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (activeVersionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "agents", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "instance_ai_observations", + "columns": [ + "supersededBy" + ], + "cardinality": "zero_or_more", + "parent_table": "instance_ai_observations", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (supersededBy) REFERENCES instance_ai_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" + }, + { + "table": "instance_ai_observations", + "columns": [ + "parentId" + ], + "cardinality": "zero_or_more", + "parent_table": "instance_ai_observations", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (parentId) REFERENCES instance_ai_observations (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" + }, + { + "table": "instance_ai_observations", + "columns": [ + "observationScopeId" + ], + "cardinality": "zero_or_more", + "parent_table": "instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "instance_ai_observation_cursors", + "columns": [ + "observationScopeId" + ], + "cardinality": "zero_or_one", + "parent_table": "instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "instance_ai_observation_locks", + "columns": [ + "observationScopeId" + ], + "cardinality": "zero_or_one", + "parent_table": "instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (observationScopeId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "instance_ai_checkpoints", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "instance_ai_pending_confirmations", + "columns": [ + "checkpointKey" + ], + "cardinality": "zero_or_more", + "parent_table": "instance_ai_checkpoints", + "parent_columns": [ + "key" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (checkpointKey) REFERENCES instance_ai_checkpoints (key) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "instance_ai_pending_confirmations", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "instance_ai_pending_confirmations", + "columns": [ + "threadId" + ], + "cardinality": "zero_or_more", + "parent_table": "instance_ai_threads", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (threadId) REFERENCES instance_ai_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "workflow_entity", + "columns": [ + "activeVersionId" + ], + "cardinality": "zero_or_more", + "parent_table": "workflow_history", + "parent_columns": [ + "versionId" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (activeVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE" + }, + { + "table": "workflow_entity", + "columns": [ + "parentFolderId" + ], + "cardinality": "zero_or_more", + "parent_table": "folder", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (parentFolderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "user_api_keys", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agent_files", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "project", + "columns": [ + "creatorId" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (creatorId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "agent_task_definition", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agent_task_snapshot", + "columns": [ + "versionId" + ], + "cardinality": "zero_or_one", + "parent_table": "agent_history", + "parent_columns": [ + "versionId" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (versionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agent_task_run_lock", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_one", + "parent_table": "agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agent_execution_threads", + "columns": [ + "taskVersionId" + ], + "cardinality": "zero_or_more", + "parent_table": "agent_history", + "parent_columns": [ + "versionId" + ], + "parent_cardinality": "zero_or_one", + "def": "FOREIGN KEY (taskVersionId) REFERENCES agent_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + }, + { + "table": "agent_execution_threads", + "columns": [ + "agentId" + ], + "cardinality": "zero_or_more", + "parent_table": "agents", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (agentId) REFERENCES agents (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "agent_execution_threads", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "instance_ai_mcp_registry_connections", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "instance_ai_mcp_registry_connections", + "columns": [ + "serverSlug" + ], + "cardinality": "zero_or_more", + "parent_table": "mcp_registry_server", + "parent_columns": [ + "slug" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (serverSlug) REFERENCES mcp_registry_server (slug) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "instance_ai_mcp_registry_connections", + "columns": [ + "credentialId" + ], + "cardinality": "zero_or_more", + "parent_table": "credentials_entity", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (credentialId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "oauth_authorization_codes", + "columns": [ + "clientId" + ], + "cardinality": "zero_or_more", + "parent_table": "oauth_clients", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "oauth_authorization_codes", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "oauth_refresh_tokens", + "columns": [ + "clientId" + ], + "cardinality": "zero_or_more", + "parent_table": "oauth_clients", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (clientId) REFERENCES oauth_clients (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "oauth_refresh_tokens", + "columns": [ + "userId" + ], + "cardinality": "zero_or_more", + "parent_table": "user", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + }, + { + "table": "instance_ai_threads", + "columns": [ + "projectId" + ], + "cardinality": "zero_or_more", + "parent_table": "project", + "parent_columns": [ + "id" + ], + "parent_cardinality": "exactly_one", + "def": "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + } + ], + "driver": { + "name": "sqlite", + "database_version": "3.51.3" + } +} diff --git a/docs/generated/sqlite-schema/scope.md b/docs/generated/sqlite-schema/scope.md new file mode 100644 index 00000000000..9030bd1f6f2 --- /dev/null +++ b/docs/generated/sqlite-schema/scope.md @@ -0,0 +1,55 @@ +# scope + +## Description + +
+Table Definition + +```sql +CREATE TABLE "scope" ("slug" varchar(128) PRIMARY KEY NOT NULL, "displayName" text, "description" text) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| slug | varchar(128) | | false | [role_scope](role_scope.md) | | | +| displayName | TEXT | | true | | | | +| description | TEXT | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| slug | PRIMARY KEY | PRIMARY KEY (slug) | +| sqlite_autoindex_scope_1 | PRIMARY KEY | PRIMARY KEY (slug) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_scope_1 | PRIMARY KEY (slug) | + +## Relations + +```mermaid +erDiagram + +"role_scope" |o--|| "scope" : "FOREIGN KEY (scopeSlug) REFERENCES scope (slug) ON UPDATE CASCADE ON DELETE CASCADE MATCH NONE" + +"scope" { + varchar_128_ slug PK + TEXT displayName + TEXT description +} +"role_scope" { + VARCHAR_128_ roleSlug PK + VARCHAR_128_ scopeSlug PK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/secrets_provider_connection.md b/docs/generated/sqlite-schema/secrets_provider_connection.md new file mode 100644 index 00000000000..cdb569b9d2f --- /dev/null +++ b/docs/generated/sqlite-schema/secrets_provider_connection.md @@ -0,0 +1,65 @@ +# secrets_provider_connection + +## Description + +
+Table Definition + +```sql +CREATE TABLE "secrets_provider_connection" ("id" integer PRIMARY KEY NOT NULL, "providerKey" varchar(128) NOT NULL, "type" varchar(36) NOT NULL, "encryptedSettings" text NOT NULL, "isEnabled" boolean NOT NULL DEFAULT (false), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW'))) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | INTEGER | | false | [project_secrets_provider_access](project_secrets_provider_access.md) | | | +| providerKey | varchar(128) | | false | | | | +| type | varchar(36) | | false | | | | +| encryptedSettings | TEXT | | false | | | | +| isEnabled | boolean | false | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_secrets_provider_connection_providerKey | CREATE UNIQUE INDEX "IDX_secrets_provider_connection_providerKey" ON "secrets_provider_connection" ("providerKey") | + +## Relations + +```mermaid +erDiagram + +"project_secrets_provider_access" |o--|| "secrets_provider_connection" : "FOREIGN KEY (secretsProviderConnectionId) REFERENCES secrets_provider_connection (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"secrets_provider_connection" { + INTEGER id + varchar_128_ providerKey + varchar_36_ type + TEXT encryptedSettings + boolean isEnabled + datetime_3_ createdAt + datetime_3_ updatedAt +} +"project_secrets_provider_access" { + INTEGER secretsProviderConnectionId PK + varchar_36_ projectId PK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_128_ role +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/settings.md b/docs/generated/sqlite-schema/settings.md new file mode 100644 index 00000000000..b2110d4689e --- /dev/null +++ b/docs/generated/sqlite-schema/settings.md @@ -0,0 +1,50 @@ +# settings + +## Description + +
+Table Definition + +```sql +CREATE TABLE "settings" ("key" TEXT NOT NULL,"value" TEXT NOT NULL DEFAULT '',"loadOnStartup" boolean NOT NULL default false,PRIMARY KEY("key")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| key | TEXT | | false | | | | +| value | TEXT | '' | false | | | | +| loadOnStartup | boolean | false | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| key | PRIMARY KEY | PRIMARY KEY (key) | +| sqlite_autoindex_settings_1 | PRIMARY KEY | PRIMARY KEY (key) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_settings_1 | PRIMARY KEY (key) | + +## Relations + +```mermaid +erDiagram + + +"settings" { + TEXT key PK + TEXT value + boolean loadOnStartup +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/shared_credentials.md b/docs/generated/sqlite-schema/shared_credentials.md new file mode 100644 index 00000000000..554a4b6ba06 --- /dev/null +++ b/docs/generated/sqlite-schema/shared_credentials.md @@ -0,0 +1,83 @@ +# shared_credentials + +## Description + +
+Table Definition + +```sql +CREATE TABLE "shared_credentials" ("credentialsId" varchar(36) NOT NULL, "projectId" varchar(36) NOT NULL, "role" text NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_416f66fc846c7c442970c094ccf" FOREIGN KEY ("credentialsId") REFERENCES "credentials_entity" ("id") ON DELETE CASCADE, CONSTRAINT "FK_812c2852270da1247756e77f5a4" FOREIGN KEY ("projectId") REFERENCES "project" ("id") ON DELETE CASCADE, PRIMARY KEY ("credentialsId", "projectId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| credentialsId | varchar(36) | | false | | [credentials_entity](credentials_entity.md) | | +| projectId | varchar(36) | | false | | [project](project.md) | | +| role | TEXT | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| credentialsId | PRIMARY KEY | PRIMARY KEY (credentialsId) | +| projectId | PRIMARY KEY | PRIMARY KEY (projectId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (credentialsId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_shared_credentials_1 | PRIMARY KEY | PRIMARY KEY (credentialsId, projectId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_shared_credentials_1 | PRIMARY KEY (credentialsId, projectId) | + +## Relations + +```mermaid +erDiagram + +"shared_credentials" |o--|| "credentials_entity" : "FOREIGN KEY (credentialsId) REFERENCES credentials_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"shared_credentials" |o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"shared_credentials" { + varchar_36_ credentialsId PK + varchar_36_ projectId PK + TEXT role + datetime_3_ createdAt + datetime_3_ updatedAt +} +"credentials_entity" { + varchar_36_ id PK + varchar_128_ name + TEXT data + varchar_32_ type + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isManaged + boolean isGlobal + boolean isResolvable + boolean resolvableAllowFallback + varchar_16_ resolverId FK +} +"project" { + varchar_36_ id PK + varchar_255_ name + varchar_36_ type + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + varchar_512_ description + varchar creatorId FK + TEXT customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/shared_workflow.md b/docs/generated/sqlite-schema/shared_workflow.md new file mode 100644 index 00000000000..d9d2e52c671 --- /dev/null +++ b/docs/generated/sqlite-schema/shared_workflow.md @@ -0,0 +1,93 @@ +# shared_workflow + +## Description + +
+Table Definition + +```sql +CREATE TABLE "shared_workflow" ("workflowId" varchar(36) NOT NULL, "projectId" varchar(36) NOT NULL, "role" text NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_daa206a04983d47d0a9c34649ce" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE CASCADE, CONSTRAINT "FK_a45ea5f27bcfdc21af9b4188560" FOREIGN KEY ("projectId") REFERENCES "project" ("id") ON DELETE CASCADE, PRIMARY KEY ("workflowId", "projectId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| workflowId | varchar(36) | | false | | [workflow_entity](workflow_entity.md) | | +| projectId | varchar(36) | | false | | [project](project.md) | | +| role | TEXT | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| workflowId | PRIMARY KEY | PRIMARY KEY (workflowId) | +| projectId | PRIMARY KEY | PRIMARY KEY (projectId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_shared_workflow_1 | PRIMARY KEY | PRIMARY KEY (workflowId, projectId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_shared_workflow_projectId | CREATE INDEX "IDX_shared_workflow_projectId" ON "shared_workflow" ("projectId") | +| sqlite_autoindex_shared_workflow_1 | PRIMARY KEY (workflowId, projectId) | + +## Relations + +```mermaid +erDiagram + +"shared_workflow" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"shared_workflow" |o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"shared_workflow" { + varchar_36_ workflowId PK + varchar_36_ projectId PK + TEXT role + datetime_3_ createdAt + datetime_3_ updatedAt +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +"project" { + varchar_36_ id PK + varchar_255_ name + varchar_36_ type + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + varchar_512_ description + varchar creatorId FK + TEXT customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/tag_entity.md b/docs/generated/sqlite-schema/tag_entity.md new file mode 100644 index 00000000000..f9332156c88 --- /dev/null +++ b/docs/generated/sqlite-schema/tag_entity.md @@ -0,0 +1,63 @@ +# tag_entity + +## Description + +
+Table Definition + +```sql +CREATE TABLE "tag_entity" ("id" varchar(36) PRIMARY KEY NOT NULL, "name" varchar(24) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW'))) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [workflows_tags](workflows_tags.md) [folder_tag](folder_tag.md) | | | +| name | varchar(24) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| sqlite_autoindex_tag_entity_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_8f949d7a3a984759044054e89b | CREATE UNIQUE INDEX "IDX_8f949d7a3a984759044054e89b" ON "tag_entity" ("name") | +| sqlite_autoindex_tag_entity_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"workflows_tags" |o--|| "tag_entity" : "FOREIGN KEY (tagId) REFERENCES tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"folder_tag" |o--|| "tag_entity" : "FOREIGN KEY (tagId) REFERENCES tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"tag_entity" { + varchar_36_ id PK + varchar_24_ name + datetime_3_ createdAt + datetime_3_ updatedAt +} +"workflows_tags" { + varchar_36_ workflowId PK + INTEGER tagId PK +} +"folder_tag" { + varchar_36_ folderId PK + varchar_36_ tagId PK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/test_case_execution.md b/docs/generated/sqlite-schema/test_case_execution.md new file mode 100644 index 00000000000..87707d0ccd7 --- /dev/null +++ b/docs/generated/sqlite-schema/test_case_execution.md @@ -0,0 +1,120 @@ +# test_case_execution + +## Description + +
+Table Definition + +```sql +CREATE TABLE "test_case_execution" ("id" varchar(36) PRIMARY KEY NOT NULL, "testRunId" varchar(36) NOT NULL, "pastExecutionId" integer, "executionId" integer, "evaluationExecutionId" integer, "status" varchar NOT NULL, "runAt" datetime(3), "completedAt" datetime(3), "errorCode" varchar, "errorDetails" text, "metrics" text, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "inputs" text, "outputs" text, "runIndex" INTEGER DEFAULT NULL, CONSTRAINT "FK_dfbe194e3ebdfe49a87bc4692ca" FOREIGN KEY ("evaluationExecutionId") REFERENCES "execution_entity" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_e48965fac35d0f5b9e7f51d8c44" FOREIGN KEY ("executionId") REFERENCES "execution_entity" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_258d954733841d51edd826a562b" FOREIGN KEY ("pastExecutionId") REFERENCES "execution_entity" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_8e4b4774db42f1e6dda3452b2af" FOREIGN KEY ("testRunId") REFERENCES "test_run" ("id") ON DELETE CASCADE ON UPDATE NO ACTION) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| testRunId | varchar(36) | | false | | [test_run](test_run.md) | | +| pastExecutionId | INTEGER | | true | | [execution_entity](execution_entity.md) | | +| executionId | INTEGER | | true | | [execution_entity](execution_entity.md) | | +| evaluationExecutionId | INTEGER | | true | | [execution_entity](execution_entity.md) | | +| status | varchar | | false | | | | +| runAt | datetime(3) | | true | | | | +| completedAt | datetime(3) | | true | | | | +| errorCode | varchar | | true | | | | +| errorDetails | TEXT | | true | | | | +| metrics | TEXT | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| inputs | TEXT | | true | | | | +| outputs | TEXT | | true | | | | +| runIndex | INTEGER | NULL | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (testRunId) REFERENCES test_run (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (pastExecutionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| - (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| - (Foreign key ID: 3) | FOREIGN KEY | FOREIGN KEY (evaluationExecutionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| sqlite_autoindex_test_case_execution_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_8e4b4774db42f1e6dda3452b2a | CREATE INDEX "IDX_8e4b4774db42f1e6dda3452b2a" ON "test_case_execution" ("testRunId") | +| sqlite_autoindex_test_case_execution_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"test_case_execution" }o--|| "test_run" : "FOREIGN KEY (testRunId) REFERENCES test_run (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"test_case_execution" }o--o| "execution_entity" : "FOREIGN KEY (pastExecutionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"test_case_execution" }o--o| "execution_entity" : "FOREIGN KEY (executionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"test_case_execution" }o--o| "execution_entity" : "FOREIGN KEY (evaluationExecutionId) REFERENCES execution_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + +"test_case_execution" { + varchar_36_ id PK + varchar_36_ testRunId FK + INTEGER pastExecutionId FK + INTEGER executionId FK + INTEGER evaluationExecutionId FK + varchar status + datetime_3_ runAt + datetime_3_ completedAt + varchar errorCode + TEXT errorDetails + TEXT metrics + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT inputs + TEXT outputs + INTEGER runIndex +} +"test_run" { + varchar_36_ id PK + varchar_36_ workflowId FK + varchar status + varchar errorCode + TEXT errorDetails + datetime_3_ runAt + datetime_3_ completedAt + TEXT metrics + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_255_ runningInstanceId + boolean cancelRequested + varchar_36_ workflowVersionId + varchar_36_ evaluationConfigId FK + TEXT evaluationConfigSnapshot + varchar_36_ collectionId FK +} +"execution_entity" { + INTEGER id + varchar_36_ workflowId FK + boolean finished + varchar mode + varchar retryOf + varchar retrySuccessId + datetime startedAt + datetime stoppedAt + datetime waitTill + varchar status + datetime_3_ deletedAt + datetime_3_ createdAt + varchar_2_ storedAt + TEXT tracingContext + varchar_255_ deduplicationKey +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/test_run.md b/docs/generated/sqlite-schema/test_run.md new file mode 100644 index 00000000000..16820cd090f --- /dev/null +++ b/docs/generated/sqlite-schema/test_run.md @@ -0,0 +1,151 @@ +# test_run + +## Description + +
+Table Definition + +```sql +CREATE TABLE "test_run" ("id" varchar(36) PRIMARY KEY NOT NULL, "workflowId" varchar(36) NOT NULL, "status" varchar NOT NULL, "errorCode" varchar, "errorDetails" text, "runAt" datetime(3), "completedAt" datetime(3), "metrics" text, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "runningInstanceId" varchar(255), "cancelRequested" boolean NOT NULL DEFAULT (FALSE), "workflowVersionId" varchar(36), "evaluationConfigId" varchar(36), "evaluationConfigSnapshot" text, "collectionId" varchar(36), CONSTRAINT "FK_test_run_evaluation_config_id" FOREIGN KEY ("evaluationConfigId") REFERENCES "evaluation_config" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_d6870d3b6e4c185d33926f423c8" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_test_run_collection_id" FOREIGN KEY ("collectionId") REFERENCES "evaluation_collection" ("id") ON DELETE SET NULL) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [test_case_execution](test_case_execution.md) | | | +| workflowId | varchar(36) | | false | | [workflow_entity](workflow_entity.md) | | +| status | varchar | | false | | | | +| errorCode | varchar | | true | | | | +| errorDetails | TEXT | | true | | | | +| runAt | datetime(3) | | true | | | | +| completedAt | datetime(3) | | true | | | | +| metrics | TEXT | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| runningInstanceId | varchar(255) | | true | | | | +| cancelRequested | boolean | FALSE | false | | | | +| workflowVersionId | varchar(36) | | true | | | | +| evaluationConfigId | varchar(36) | | true | | [evaluation_config](evaluation_config.md) | | +| evaluationConfigSnapshot | TEXT | | true | | | | +| collectionId | varchar(36) | | true | | [evaluation_collection](evaluation_collection.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (collectionId) REFERENCES evaluation_collection (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (evaluationConfigId) REFERENCES evaluation_config (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| sqlite_autoindex_test_run_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_test_run_collectionId | CREATE INDEX "IDX_test_run_collectionId" ON "test_run" ("collectionId") | +| IDX_d6870d3b6e4c185d33926f423c | CREATE INDEX "IDX_d6870d3b6e4c185d33926f423c" ON "test_run" ("workflowId") | +| IDX_test_run_evaluationConfigId | CREATE INDEX "IDX_test_run_evaluationConfigId" ON "test_run" ("evaluationConfigId") | +| sqlite_autoindex_test_run_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"test_case_execution" }o--|| "test_run" : "FOREIGN KEY (testRunId) REFERENCES test_run (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"test_run" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"test_run" }o--o| "evaluation_config" : "FOREIGN KEY (evaluationConfigId) REFERENCES evaluation_config (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"test_run" }o--o| "evaluation_collection" : "FOREIGN KEY (collectionId) REFERENCES evaluation_collection (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + +"test_run" { + varchar_36_ id PK + varchar_36_ workflowId FK + varchar status + varchar errorCode + TEXT errorDetails + datetime_3_ runAt + datetime_3_ completedAt + TEXT metrics + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_255_ runningInstanceId + boolean cancelRequested + varchar_36_ workflowVersionId + varchar_36_ evaluationConfigId FK + TEXT evaluationConfigSnapshot + varchar_36_ collectionId FK +} +"test_case_execution" { + varchar_36_ id PK + varchar_36_ testRunId FK + INTEGER pastExecutionId FK + INTEGER executionId FK + INTEGER evaluationExecutionId FK + varchar status + datetime_3_ runAt + datetime_3_ completedAt + varchar errorCode + TEXT errorDetails + TEXT metrics + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT inputs + TEXT outputs + INTEGER runIndex +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +"evaluation_config" { + varchar_36_ id PK + varchar_36_ workflowId FK + varchar_128_ name + varchar_16_ status + varchar_64_ invalidReason + varchar_32_ datasetSource + TEXT datasetRef + varchar_255_ startNodeName + varchar_255_ endNodeName + TEXT metrics + datetime_3_ createdAt + datetime_3_ updatedAt +} +"evaluation_collection" { + varchar_36_ id PK + varchar_128_ name + TEXT description + varchar_36_ workflowId FK + varchar_36_ evaluationConfigId FK + varchar createdById FK + TEXT insightsCache + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/token_exchange_jti.md b/docs/generated/sqlite-schema/token_exchange_jti.md new file mode 100644 index 00000000000..b2dc0b6a877 --- /dev/null +++ b/docs/generated/sqlite-schema/token_exchange_jti.md @@ -0,0 +1,50 @@ +# token_exchange_jti + +## Description + +
+Table Definition + +```sql +CREATE TABLE "token_exchange_jti" ("jti" varchar(255) PRIMARY KEY NOT NULL, "expiresAt" datetime(3) NOT NULL, "createdAt" datetime(3) NOT NULL) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| jti | varchar(255) | | false | | | | +| expiresAt | datetime(3) | | false | | | | +| createdAt | datetime(3) | | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| jti | PRIMARY KEY | PRIMARY KEY (jti) | +| sqlite_autoindex_token_exchange_jti_1 | PRIMARY KEY | PRIMARY KEY (jti) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_token_exchange_jti_1 | PRIMARY KEY (jti) | + +## Relations + +```mermaid +erDiagram + + +"token_exchange_jti" { + varchar_255_ jti PK + datetime_3_ expiresAt + datetime_3_ createdAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/trusted_key.md b/docs/generated/sqlite-schema/trusted_key.md new file mode 100644 index 00000000000..d4d2d6d7993 --- /dev/null +++ b/docs/generated/sqlite-schema/trusted_key.md @@ -0,0 +1,65 @@ +# trusted_key + +## Description + +
+Table Definition + +```sql +CREATE TABLE "trusted_key" ("sourceId" varchar(36) NOT NULL, "kid" varchar(255) NOT NULL, "data" text NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_8c2938d746943dd8f608d23c891" FOREIGN KEY ("sourceId") REFERENCES "trusted_key_source" ("id") ON DELETE CASCADE, PRIMARY KEY ("sourceId", "kid")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| sourceId | varchar(36) | | false | | [trusted_key_source](trusted_key_source.md) | | +| kid | varchar(255) | | false | | | | +| data | TEXT | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| sourceId | PRIMARY KEY | PRIMARY KEY (sourceId) | +| kid | PRIMARY KEY | PRIMARY KEY (kid) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (sourceId) REFERENCES trusted_key_source (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_trusted_key_1 | PRIMARY KEY | PRIMARY KEY (sourceId, kid) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_trusted_key_1 | PRIMARY KEY (sourceId, kid) | + +## Relations + +```mermaid +erDiagram + +"trusted_key" |o--|| "trusted_key_source" : "FOREIGN KEY (sourceId) REFERENCES trusted_key_source (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"trusted_key" { + varchar_36_ sourceId PK + varchar_255_ kid PK + TEXT data + datetime_3_ createdAt +} +"trusted_key_source" { + varchar_36_ id PK + varchar_32_ type + TEXT config + varchar_32_ status + TEXT lastError + datetime_3_ lastRefreshedAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/trusted_key_source.md b/docs/generated/sqlite-schema/trusted_key_source.md new file mode 100644 index 00000000000..f978af89139 --- /dev/null +++ b/docs/generated/sqlite-schema/trusted_key_source.md @@ -0,0 +1,67 @@ +# trusted_key_source + +## Description + +
+Table Definition + +```sql +CREATE TABLE "trusted_key_source" ("id" varchar(36) PRIMARY KEY NOT NULL, "type" varchar(32) NOT NULL, "config" text NOT NULL, "status" varchar(32) NOT NULL DEFAULT ('pending'), "lastError" text, "lastRefreshedAt" datetime(3), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW'))) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [trusted_key](trusted_key.md) | | | +| type | varchar(32) | | false | | | | +| config | TEXT | | false | | | | +| status | varchar(32) | 'pending' | false | | | | +| lastError | TEXT | | true | | | | +| lastRefreshedAt | datetime(3) | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| sqlite_autoindex_trusted_key_source_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_trusted_key_source_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"trusted_key" |o--|| "trusted_key_source" : "FOREIGN KEY (sourceId) REFERENCES trusted_key_source (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"trusted_key_source" { + varchar_36_ id PK + varchar_32_ type + TEXT config + varchar_32_ status + TEXT lastError + datetime_3_ lastRefreshedAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"trusted_key" { + varchar_36_ sourceId PK + varchar_255_ kid PK + TEXT data + datetime_3_ createdAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/user.md b/docs/generated/sqlite-schema/user.md new file mode 100644 index 00000000000..ad0183b9e6f --- /dev/null +++ b/docs/generated/sqlite-schema/user.md @@ -0,0 +1,297 @@ +# user + +## Description + +
+Table Definition + +```sql +CREATE TABLE "user" ("id" varchar PRIMARY KEY, "email" varchar(255), "firstName" varchar(32), "lastName" varchar(32), "password" varchar, "personalizationAnswers" text, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "settings" text, "disabled" boolean NOT NULL DEFAULT (FALSE), "mfaEnabled" boolean NOT NULL DEFAULT (FALSE), "mfaSecret" text, "mfaRecoveryCodes" text, "lastActiveAt" date, "roleSlug" varchar(128) NOT NULL DEFAULT ('global:member'), CONSTRAINT "UQ_e12875dfb3b1d92d7d7c5377e22" UNIQUE ("email"), CONSTRAINT "FK_eaea92ee7bfb9c1b6cd01505d56" FOREIGN KEY ("roleSlug") REFERENCES "role" ("slug")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar | | true | [auth_identity](auth_identity.md) [project_relation](project_relation.md) [oauth_access_tokens](oauth_access_tokens.md) [oauth_user_consents](oauth_user_consents.md) [dynamic_credential_user_entry](dynamic_credential_user_entry.md) [chat_hub_tools](chat_hub_tools.md) [chat_hub_agents](chat_hub_agents.md) [chat_hub_sessions](chat_hub_sessions.md) [workflow_builder_session](workflow_builder_session.md) [workflow_publish_history](workflow_publish_history.md) [user_favorites](user_favorites.md) [evaluation_collection](evaluation_collection.md) [agent_history](agent_history.md) [instance_ai_pending_confirmations](instance_ai_pending_confirmations.md) [user_api_keys](user_api_keys.md) [project](project.md) [instance_ai_mcp_registry_connections](instance_ai_mcp_registry_connections.md) [oauth_authorization_codes](oauth_authorization_codes.md) [oauth_refresh_tokens](oauth_refresh_tokens.md) | | | +| email | varchar(255) | | true | | | | +| firstName | varchar(32) | | true | | | | +| lastName | varchar(32) | | true | | | | +| password | varchar | | true | | | | +| personalizationAnswers | TEXT | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| settings | TEXT | | true | | | | +| disabled | boolean | FALSE | false | | | | +| mfaEnabled | boolean | FALSE | false | | | | +| mfaSecret | TEXT | | true | | | | +| mfaRecoveryCodes | TEXT | | true | | | | +| lastActiveAt | date | | true | | | | +| roleSlug | varchar(128) | 'global:member' | false | | [role](role.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (roleSlug) REFERENCES role (slug) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE | +| sqlite_autoindex_user_2 | UNIQUE | UNIQUE (email) | +| sqlite_autoindex_user_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| user_role_idx | CREATE INDEX "user_role_idx" ON "user" ("roleSlug") | +| sqlite_autoindex_user_2 | UNIQUE (email) | +| sqlite_autoindex_user_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"auth_identity" }o--o| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" +"project_relation" |o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_access_tokens" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_user_consents" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"dynamic_credential_user_entry" |o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_tools" }o--|| "user" : "FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_agents" }o--|| "user" : "FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_sessions" }o--|| "user" : "FOREIGN KEY (ownerId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_builder_session" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_publish_history" }o--o| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"user_favorites" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"evaluation_collection" }o--o| "user" : "FOREIGN KEY (createdById) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"agent_history" }o--o| "user" : "FOREIGN KEY (publishedById) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"instance_ai_pending_confirmations" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"user_api_keys" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"project" }o--o| "user" : "FOREIGN KEY (creatorId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"instance_ai_mcp_registry_connections" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_authorization_codes" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"oauth_refresh_tokens" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"user" }o--|| "role" : "FOREIGN KEY (roleSlug) REFERENCES role (slug) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE" + +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +"auth_identity" { + VARCHAR_36_ userId FK + VARCHAR_64_ providerId PK + VARCHAR_32_ providerType PK + timestamp createdAt + timestamp updatedAt +} +"project_relation" { + varchar_36_ projectId PK + varchar userId PK + varchar role FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"oauth_access_tokens" { + varchar token PK + varchar clientId FK + varchar userId FK +} +"oauth_user_consents" { + INTEGER id + varchar userId FK + varchar clientId FK + bigint grantedAt +} +"dynamic_credential_user_entry" { + varchar_16_ credentialId PK + varchar userId PK + varchar_16_ resolverId PK + TEXT data + datetime_3_ createdAt + datetime_3_ updatedAt +} +"chat_hub_tools" { + varchar id PK + varchar_255_ name + varchar_255_ type + REAL typeVersion + varchar ownerId FK + TEXT definition + boolean enabled + datetime_3_ createdAt + datetime_3_ updatedAt +} +"chat_hub_agents" { + varchar id PK + varchar_256_ name + varchar_512_ description + TEXT systemPrompt + varchar ownerId FK + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + TEXT files + TEXT suggestedPrompts +} +"chat_hub_sessions" { + varchar id PK + varchar_256_ title + varchar ownerId FK + datetime_3_ lastMessageAt + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + varchar_36_ workflowId FK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ agentId FK + varchar_128_ agentName + varchar_16_ type +} +"workflow_builder_session" { + varchar id PK + varchar_36_ workflowId FK + varchar userId FK + TEXT messages + TEXT previousSummary + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_255_ activeVersionCardId + varchar_255_ resumeAfterRestoreMessageId +} +"workflow_publish_history" { + INTEGER id + varchar_36_ workflowId FK + varchar_36_ versionId FK + varchar_36_ event + varchar userId FK + datetime_3_ createdAt +} +"user_favorites" { + INTEGER id + varchar userId FK + varchar_255_ resourceId + varchar_64_ resourceType +} +"evaluation_collection" { + varchar_36_ id PK + varchar_128_ name + TEXT description + varchar_36_ workflowId FK + varchar_36_ evaluationConfigId FK + varchar createdById FK + TEXT insightsCache + datetime_3_ createdAt + datetime_3_ updatedAt +} +"agent_history" { + varchar_36_ versionId PK + varchar_36_ agentId FK + TEXT schema + TEXT tools + TEXT skills + varchar publishedById FK + varchar_255_ author + datetime_3_ createdAt + datetime_3_ updatedAt +} +"instance_ai_pending_confirmations" { + varchar_36_ requestId PK + varchar threadId FK + varchar userId FK + varchar_16_ kind + varchar_36_ runId + varchar_64_ toolCallId + varchar_36_ messageGroupId + varchar_255_ checkpointKey FK + varchar_36_ checkpointTaskId + datetime_3_ expiresAt + datetime_3_ createdAt + datetime_3_ updatedAt +} +"user_api_keys" { + varchar_36_ id PK + varchar userId FK + varchar_100_ label + varchar apiKey + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT scopes + varchar audience + datetime_3_ lastUsedAt +} +"project" { + varchar_36_ id PK + varchar_255_ name + varchar_36_ type + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + varchar_512_ description + varchar creatorId FK + TEXT customTelemetryTags +} +"instance_ai_mcp_registry_connections" { + varchar id PK + varchar_36_ credentialId FK + varchar_255_ serverSlug FK + TEXT toolFilter + varchar userId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"oauth_authorization_codes" { + varchar_255_ code PK + varchar clientId FK + varchar userId FK + varchar redirectUri + varchar codeChallenge + varchar_255_ codeChallengeMethod + bigint expiresAt + varchar state + boolean used + datetime_3_ createdAt + datetime_3_ updatedAt + varchar resource + TEXT scope +} +"oauth_refresh_tokens" { + varchar_255_ token PK + varchar clientId FK + varchar userId FK + bigint expiresAt + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT scope +} +"role" { + varchar_128_ slug PK + TEXT displayName + TEXT description + TEXT roleType + boolean systemRole + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/user_api_keys.md b/docs/generated/sqlite-schema/user_api_keys.md new file mode 100644 index 00000000000..300bc3e2f5c --- /dev/null +++ b/docs/generated/sqlite-schema/user_api_keys.md @@ -0,0 +1,85 @@ +# user_api_keys + +## Description + +
+Table Definition + +```sql +CREATE TABLE "user_api_keys" ("id" varchar(36) PRIMARY KEY NOT NULL, "userId" varchar NOT NULL, "label" varchar(100) NOT NULL, "apiKey" varchar NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "scopes" text, "audience" varchar NOT NULL DEFAULT ('public-api'), "lastUsedAt" datetime(3), CONSTRAINT "UQ_1ef35bac35d20bdae979d917a36" UNIQUE ("apiKey"), CONSTRAINT "UQ_63d7bbae72c767cf162d459fccd" UNIQUE ("userId", "label"), CONSTRAINT "FK_e131705cbbc8fb589889b02d457" FOREIGN KEY ("userId") REFERENCES "user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| userId | varchar | | false | | [user](user.md) | | +| label | varchar(100) | | false | | | | +| apiKey | varchar | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| scopes | TEXT | | true | | | | +| audience | varchar | 'public-api' | false | | | | +| lastUsedAt | datetime(3) | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_user_api_keys_3 | UNIQUE | UNIQUE (userId, label) | +| sqlite_autoindex_user_api_keys_2 | UNIQUE | UNIQUE (apiKey) | +| sqlite_autoindex_user_api_keys_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_user_api_keys_3 | UNIQUE (userId, label) | +| sqlite_autoindex_user_api_keys_2 | UNIQUE (apiKey) | +| sqlite_autoindex_user_api_keys_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"user_api_keys" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"user_api_keys" { + varchar_36_ id PK + varchar userId FK + varchar_100_ label + varchar apiKey + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT scopes + varchar audience + datetime_3_ lastUsedAt +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/user_favorites.md b/docs/generated/sqlite-schema/user_favorites.md new file mode 100644 index 00000000000..63178656e0e --- /dev/null +++ b/docs/generated/sqlite-schema/user_favorites.md @@ -0,0 +1,73 @@ +# user_favorites + +## Description + +
+Table Definition + +```sql +CREATE TABLE "user_favorites" ("id" integer PRIMARY KEY NOT NULL, "userId" varchar NOT NULL, "resourceId" varchar(255) NOT NULL, "resourceType" varchar(64) NOT NULL, CONSTRAINT "UQ_cf6ae658ead9ffc124723413c65" UNIQUE ("userId", "resourceId", "resourceType"), CONSTRAINT "FK_1dd5c393ad0517be3c31a7af836" FOREIGN KEY ("userId") REFERENCES "user" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | INTEGER | | false | | | | +| userId | varchar | | false | | [user](user.md) | | +| resourceId | varchar(255) | | false | | | | +| resourceType | varchar(64) | | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_user_favorites_1 | UNIQUE | UNIQUE (userId, resourceId, resourceType) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_1d11050a381548c42c32cc25c4 | CREATE INDEX "IDX_1d11050a381548c42c32cc25c4" ON "user_favorites" ("resourceType", "resourceId") | +| IDX_1dd5c393ad0517be3c31a7af83 | CREATE INDEX "IDX_1dd5c393ad0517be3c31a7af83" ON "user_favorites" ("userId") | +| sqlite_autoindex_user_favorites_1 | UNIQUE (userId, resourceId, resourceType) | + +## Relations + +```mermaid +erDiagram + +"user_favorites" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"user_favorites" { + INTEGER id + varchar userId FK + varchar_255_ resourceId + varchar_64_ resourceType +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/variables.md b/docs/generated/sqlite-schema/variables.md new file mode 100644 index 00000000000..0b8863b9f0b --- /dev/null +++ b/docs/generated/sqlite-schema/variables.md @@ -0,0 +1,69 @@ +# variables + +## Description + +
+Table Definition + +```sql +CREATE TABLE "variables" ("id" varchar(36) PRIMARY KEY NOT NULL, "key" text NOT NULL, "type" text NOT NULL DEFAULT ('string'), "value" text, "projectId" varchar(36), CONSTRAINT "FK_a0f13eaa709a21b77a3a9721319" FOREIGN KEY ("projectId") REFERENCES "project" ("id") ON DELETE CASCADE) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | | | | +| key | TEXT | | false | | | | +| type | TEXT | 'string' | false | | | | +| value | TEXT | | true | | | | +| projectId | varchar(36) | | true | | [project](project.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_variables_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| variables_global_key_unique | CREATE UNIQUE INDEX "variables_global_key_unique"
ON "variables" ("key")
WHERE projectId IS NULL | +| variables_project_key_unique | CREATE UNIQUE INDEX "variables_project_key_unique" ON "variables" ("projectId", "key") | +| sqlite_autoindex_variables_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"variables" }o--o| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"variables" { + varchar_36_ id PK + TEXT key + TEXT type + TEXT value + varchar_36_ projectId FK +} +"project" { + varchar_36_ id PK + varchar_255_ name + varchar_36_ type + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT icon + varchar_512_ description + varchar creatorId FK + TEXT customTelemetryTags +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/webhook_entity.md b/docs/generated/sqlite-schema/webhook_entity.md new file mode 100644 index 00000000000..b1c4ac80b16 --- /dev/null +++ b/docs/generated/sqlite-schema/webhook_entity.md @@ -0,0 +1,58 @@ +# webhook_entity + +## Description + +
+Table Definition + +```sql +CREATE TABLE "webhook_entity" ("workflowId" varchar(36) NOT NULL, "webhookPath" varchar NOT NULL, "method" varchar NOT NULL, "node" varchar NOT NULL, "webhookId" varchar, "pathLength" integer, PRIMARY KEY ("webhookPath", "method")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| workflowId | varchar(36) | | false | | | | +| webhookPath | varchar | | false | | | | +| method | varchar | | false | | | | +| node | varchar | | false | | | | +| webhookId | varchar | | true | | | | +| pathLength | INTEGER | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| webhookPath | PRIMARY KEY | PRIMARY KEY (webhookPath) | +| method | PRIMARY KEY | PRIMARY KEY (method) | +| sqlite_autoindex_webhook_entity_1 | PRIMARY KEY | PRIMARY KEY (webhookPath, method) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| idx_webhook_entity_webhook_path_method | CREATE INDEX "idx_webhook_entity_webhook_path_method" ON "webhook_entity" ("webhookId","method","pathLength") | +| sqlite_autoindex_webhook_entity_1 | PRIMARY KEY (webhookPath, method) | + +## Relations + +```mermaid +erDiagram + + +"webhook_entity" { + varchar_36_ workflowId + varchar webhookPath PK + varchar method PK + varchar node + varchar webhookId + INTEGER pathLength +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/workflow_builder_session.md b/docs/generated/sqlite-schema/workflow_builder_session.md new file mode 100644 index 00000000000..750572bd511 --- /dev/null +++ b/docs/generated/sqlite-schema/workflow_builder_session.md @@ -0,0 +1,107 @@ +# workflow_builder_session + +## Description + +
+Table Definition + +```sql +CREATE TABLE "workflow_builder_session" ("id" varchar PRIMARY KEY NOT NULL, "workflowId" varchar(36) NOT NULL, "userId" varchar NOT NULL, "messages" text NOT NULL DEFAULT ('[]'), "previousSummary" text, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "activeVersionCardId" varchar(255), "resumeAfterRestoreMessageId" varchar(255), CONSTRAINT "UQ_ec2aa73632932d485a1d5192ce1" UNIQUE ("workflowId", "userId"), CONSTRAINT "FK_00290cdeee4d4d7db84709be936" FOREIGN KEY ("userId") REFERENCES "user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_7983c618db48f47bf5a4cc1e1e4" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar | | false | | | | +| workflowId | varchar(36) | | false | | [workflow_entity](workflow_entity.md) | | +| userId | varchar | | false | | [user](user.md) | | +| messages | TEXT | '[]' | false | | | | +| previousSummary | TEXT | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| activeVersionCardId | varchar(255) | | true | | | | +| resumeAfterRestoreMessageId | varchar(255) | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_workflow_builder_session_2 | UNIQUE | UNIQUE (workflowId, userId) | +| sqlite_autoindex_workflow_builder_session_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_workflow_builder_session_2 | UNIQUE (workflowId, userId) | +| sqlite_autoindex_workflow_builder_session_1 | PRIMARY KEY (id) | + +## Relations + +```mermaid +erDiagram + +"workflow_builder_session" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_builder_session" }o--|| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"workflow_builder_session" { + varchar id PK + varchar_36_ workflowId FK + varchar userId FK + TEXT messages + TEXT previousSummary + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_255_ activeVersionCardId + varchar_255_ resumeAfterRestoreMessageId +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/workflow_dependency.md b/docs/generated/sqlite-schema/workflow_dependency.md new file mode 100644 index 00000000000..c38cb7775a4 --- /dev/null +++ b/docs/generated/sqlite-schema/workflow_dependency.md @@ -0,0 +1,88 @@ +# workflow_dependency + +## Description + +
+Table Definition + +```sql +CREATE TABLE "workflow_dependency" ("id" integer PRIMARY KEY NOT NULL, "workflowId" varchar(36) NOT NULL, "workflowVersionId" integer NOT NULL, "dependencyType" varchar(32) NOT NULL, "dependencyKey" varchar(255) NOT NULL, "indexVersionId" smallint NOT NULL DEFAULT (1), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "dependencyInfo" text, "publishedVersionId" varchar(36), CONSTRAINT "FK_a4ff2d9b9628ea988fa9e7d0bf8" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | INTEGER | | false | | | | +| workflowId | varchar(36) | | false | | [workflow_entity](workflow_entity.md) | | +| workflowVersionId | INTEGER | | false | | | | +| dependencyType | varchar(32) | | false | | | | +| dependencyKey | varchar(255) | | false | | | | +| indexVersionId | smallint | 1 | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| dependencyInfo | TEXT | | true | | | | +| publishedVersionId | varchar(36) | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_workflow_dependency_publishedVersionId | CREATE INDEX "IDX_workflow_dependency_publishedVersionId" ON "workflow_dependency" ("publishedVersionId") | +| IDX_a4ff2d9b9628ea988fa9e7d0bf | CREATE INDEX "IDX_a4ff2d9b9628ea988fa9e7d0bf" ON "workflow_dependency" ("workflowId") | +| IDX_e7fe1cfda990c14a445937d0b9 | CREATE INDEX "IDX_e7fe1cfda990c14a445937d0b9" ON "workflow_dependency" ("dependencyType") | +| IDX_e48a201071ab85d9d09119d640 | CREATE INDEX "IDX_e48a201071ab85d9d09119d640" ON "workflow_dependency" ("dependencyKey") | + +## Relations + +```mermaid +erDiagram + +"workflow_dependency" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"workflow_dependency" { + INTEGER id + varchar_36_ workflowId FK + INTEGER workflowVersionId + varchar_32_ dependencyType + varchar_255_ dependencyKey + smallint indexVersionId + datetime_3_ createdAt + TEXT dependencyInfo + varchar_36_ publishedVersionId +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/workflow_entity.md b/docs/generated/sqlite-schema/workflow_entity.md new file mode 100644 index 00000000000..d39d965a7cb --- /dev/null +++ b/docs/generated/sqlite-schema/workflow_entity.md @@ -0,0 +1,295 @@ +# workflow_entity + +## Description + +
+Table Definition + +```sql +CREATE TABLE "workflow_entity" ("id" varchar(36) PRIMARY KEY NOT NULL, "name" varchar(128) NOT NULL, "active" boolean NOT NULL, "nodes" text, "connections" text, "settings" text, "staticData" text, "pinData" text, "versionId" varchar(36) NOT NULL, "triggerCount" integer DEFAULT (0), "meta" text, "parentFolderId" varchar(36), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "isArchived" boolean NOT NULL DEFAULT (FALSE), "versionCounter" integer NOT NULL DEFAULT (1), "description" text, "activeVersionId" varchar(36), "nodeGroups" text NOT NULL DEFAULT ('[]'), "sourceWorkflowId" varchar, CONSTRAINT "FK_04a4db5906fbc5606c71448d912" FOREIGN KEY ("parentFolderId") REFERENCES "folder" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_08d6c67b7f722b0039d9d5ed620" FOREIGN KEY ("activeVersionId") REFERENCES "workflow_history" ("versionId") ON DELETE RESTRICT ON UPDATE NO ACTION) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | varchar(36) | | false | [workflows_tags](workflows_tags.md) [shared_workflow](shared_workflow.md) [processed_data](processed_data.md) [insights_metadata](insights_metadata.md) [chat_hub_messages](chat_hub_messages.md) [workflow_dependency](workflow_dependency.md) [workflow_published_version](workflow_published_version.md) [chat_hub_sessions](chat_hub_sessions.md) [workflow_builder_session](workflow_builder_session.md) [workflow_publish_history](workflow_publish_history.md) [ai_builder_temporary_workflow](ai_builder_temporary_workflow.md) [execution_entity](execution_entity.md) [evaluation_config](evaluation_config.md) [evaluation_collection](evaluation_collection.md) [test_run](test_run.md) [workflow_history](workflow_history.md) | | | +| name | varchar(128) | | false | | | | +| active | boolean | | false | | | | +| nodes | TEXT | | true | | | | +| connections | TEXT | | true | | | | +| settings | TEXT | | true | | | | +| staticData | TEXT | | true | | | | +| pinData | TEXT | | true | | | | +| versionId | varchar(36) | | false | | | | +| triggerCount | INTEGER | 0 | true | | | | +| meta | TEXT | | true | | | | +| parentFolderId | varchar(36) | | true | | [folder](folder.md) | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| isArchived | boolean | FALSE | false | | | | +| versionCounter | INTEGER | 1 | false | | | | +| description | TEXT | | true | | | | +| activeVersionId | varchar(36) | | true | | [workflow_history](workflow_history.md) | | +| nodeGroups | TEXT | '[]' | false | | | | +| sourceWorkflowId | varchar | | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (activeVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (parentFolderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_workflow_entity_1 | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_workflow_entity_sourceWorkflowId | CREATE INDEX "IDX_workflow_entity_sourceWorkflowId" ON "workflow_entity" ("sourceWorkflowId") WHERE "sourceWorkflowId" IS NOT NULL | +| IDX_e10425f6ab9964c4c1623a4a03 | CREATE INDEX "IDX_e10425f6ab9964c4c1623a4a03" ON "workflow_entity" ("name") | +| sqlite_autoindex_workflow_entity_1 | PRIMARY KEY (id) | + +## Triggers + +| Name | Definition | +| ---- | ---------- | +| workflow_version_increment | CREATE TRIGGER "workflow_version_increment"
AFTER UPDATE ON "workflow_entity"
FOR EACH ROW
WHEN OLD."versionCounter" = NEW."versionCounter"
AND (OLD."nodes" IS NOT NEW."nodes" OR OLD."settings" IS NOT NEW."settings")
BEGIN
UPDATE "workflow_entity"
SET "versionCounter" = "versionCounter" + 1
WHERE "id" = NEW."id";
END | + +## Relations + +```mermaid +erDiagram + +"workflows_tags" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"shared_workflow" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"processed_data" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"insights_metadata" }o--o| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"chat_hub_messages" }o--o| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"workflow_dependency" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_published_version" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE" +"workflow_published_version" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"chat_hub_sessions" }o--o| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"workflow_builder_session" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_publish_history" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"ai_builder_temporary_workflow" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"execution_entity" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"evaluation_config" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"evaluation_collection" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"test_run" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_history" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_entity" }o--o| "folder" : "FOREIGN KEY (parentFolderId) REFERENCES folder (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_entity" }o--o| "workflow_history" : "FOREIGN KEY (activeVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE" + +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +"workflows_tags" { + varchar_36_ workflowId PK + INTEGER tagId PK +} +"shared_workflow" { + varchar_36_ workflowId PK + varchar_36_ projectId PK + TEXT role + datetime_3_ createdAt + datetime_3_ updatedAt +} +"processed_data" { + varchar_36_ workflowId PK + varchar_255_ context PK + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT value +} +"insights_metadata" { + INTEGER metaId + varchar_16_ workflowId FK + varchar_36_ projectId FK + varchar_128_ workflowName + varchar_255_ projectName +} +"chat_hub_messages" { + varchar id PK + varchar sessionId FK + varchar previousMessageId FK + varchar revisionOfMessageId FK + varchar retryOfMessageId FK + varchar_16_ type + varchar_128_ name + TEXT content + varchar_16_ provider + varchar_36_ workflowId FK + INTEGER executionId FK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ agentId FK + varchar_16_ status + TEXT attachments + VARCHAR_256_ model +} +"workflow_dependency" { + INTEGER id + varchar_36_ workflowId FK + INTEGER workflowVersionId + varchar_32_ dependencyType + varchar_255_ dependencyKey + smallint indexVersionId + datetime_3_ createdAt + TEXT dependencyInfo + varchar_36_ publishedVersionId +} +"workflow_published_version" { + varchar_36_ workflowId PK + varchar_36_ publishedVersionId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"chat_hub_sessions" { + varchar id PK + varchar_256_ title + varchar ownerId FK + datetime_3_ lastMessageAt + varchar_36_ credentialId FK + varchar_16_ provider + varchar_64_ model + varchar_36_ workflowId FK + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_36_ agentId FK + varchar_128_ agentName + varchar_16_ type +} +"workflow_builder_session" { + varchar id PK + varchar_36_ workflowId FK + varchar userId FK + TEXT messages + TEXT previousSummary + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_255_ activeVersionCardId + varchar_255_ resumeAfterRestoreMessageId +} +"workflow_publish_history" { + INTEGER id + varchar_36_ workflowId FK + varchar_36_ versionId FK + varchar_36_ event + varchar userId FK + datetime_3_ createdAt +} +"ai_builder_temporary_workflow" { + varchar_36_ workflowId PK + varchar threadId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"execution_entity" { + INTEGER id + varchar_36_ workflowId FK + boolean finished + varchar mode + varchar retryOf + varchar retrySuccessId + datetime startedAt + datetime stoppedAt + datetime waitTill + varchar status + datetime_3_ deletedAt + datetime_3_ createdAt + varchar_2_ storedAt + TEXT tracingContext + varchar_255_ deduplicationKey +} +"evaluation_config" { + varchar_36_ id PK + varchar_36_ workflowId FK + varchar_128_ name + varchar_16_ status + varchar_64_ invalidReason + varchar_32_ datasetSource + TEXT datasetRef + varchar_255_ startNodeName + varchar_255_ endNodeName + TEXT metrics + datetime_3_ createdAt + datetime_3_ updatedAt +} +"evaluation_collection" { + varchar_36_ id PK + varchar_128_ name + TEXT description + varchar_36_ workflowId FK + varchar_36_ evaluationConfigId FK + varchar createdById FK + TEXT insightsCache + datetime_3_ createdAt + datetime_3_ updatedAt +} +"test_run" { + varchar_36_ id PK + varchar_36_ workflowId FK + varchar status + varchar errorCode + TEXT errorDetails + datetime_3_ runAt + datetime_3_ completedAt + TEXT metrics + datetime_3_ createdAt + datetime_3_ updatedAt + varchar_255_ runningInstanceId + boolean cancelRequested + varchar_36_ workflowVersionId + varchar_36_ evaluationConfigId FK + TEXT evaluationConfigSnapshot + varchar_36_ collectionId FK +} +"workflow_history" { + varchar_36_ versionId PK + varchar_36_ workflowId FK + varchar_255_ authors + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT nodes + TEXT connections + varchar_128_ name + boolean autosaved + TEXT description + TEXT nodeGroups +} +"folder" { + varchar_36_ id PK + varchar_128_ name + varchar_36_ parentFolderId FK + varchar_36_ projectId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/workflow_history.md b/docs/generated/sqlite-schema/workflow_history.md new file mode 100644 index 00000000000..c83df7adf9a --- /dev/null +++ b/docs/generated/sqlite-schema/workflow_history.md @@ -0,0 +1,110 @@ +# workflow_history + +## Description + +
+Table Definition + +```sql +CREATE TABLE "workflow_history" ("versionId" varchar(36) PRIMARY KEY NOT NULL, "workflowId" varchar(36) NOT NULL, "authors" varchar(255) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "nodes" text NOT NULL, "connections" text NOT NULL, "name" varchar(128), "autosaved" boolean NOT NULL DEFAULT (false), "description" text, "nodeGroups" text NOT NULL DEFAULT ('[]'), CONSTRAINT "FK_1e31657f5fe46816c34be7c1b4b" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| versionId | varchar(36) | | false | [workflow_published_version](workflow_published_version.md) [workflow_publish_history](workflow_publish_history.md) [workflow_entity](workflow_entity.md) | | | +| workflowId | varchar(36) | | false | | [workflow_entity](workflow_entity.md) | | +| authors | varchar(255) | | false | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| nodes | TEXT | | false | | | | +| connections | TEXT | | false | | | | +| name | varchar(128) | | true | | | | +| autosaved | boolean | false | false | | | | +| description | TEXT | | true | | | | +| nodeGroups | TEXT | '[]' | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| versionId | PRIMARY KEY | PRIMARY KEY (versionId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_workflow_history_1 | PRIMARY KEY | PRIMARY KEY (versionId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_1e31657f5fe46816c34be7c1b4 | CREATE INDEX "IDX_1e31657f5fe46816c34be7c1b4" ON "workflow_history" ("workflowId") | +| sqlite_autoindex_workflow_history_1 | PRIMARY KEY (versionId) | + +## Relations + +```mermaid +erDiagram + +"workflow_published_version" }o--|| "workflow_history" : "FOREIGN KEY (publishedVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE" +"workflow_published_version" }o--|| "workflow_history" : "FOREIGN KEY (publishedVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_publish_history" }o--o| "workflow_history" : "FOREIGN KEY (versionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"workflow_publish_history" }o--o| "workflow_history" : "FOREIGN KEY (versionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_entity" }o--o| "workflow_history" : "FOREIGN KEY (activeVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE" +"workflow_history" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"workflow_history" { + varchar_36_ versionId PK + varchar_36_ workflowId FK + varchar_255_ authors + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT nodes + TEXT connections + varchar_128_ name + boolean autosaved + TEXT description + TEXT nodeGroups +} +"workflow_published_version" { + varchar_36_ workflowId PK + varchar_36_ publishedVersionId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"workflow_publish_history" { + INTEGER id + varchar_36_ workflowId FK + varchar_36_ versionId FK + varchar_36_ event + varchar userId FK + datetime_3_ createdAt +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/workflow_publication_outbox.md b/docs/generated/sqlite-schema/workflow_publication_outbox.md new file mode 100644 index 00000000000..66c79919d27 --- /dev/null +++ b/docs/generated/sqlite-schema/workflow_publication_outbox.md @@ -0,0 +1,58 @@ +# workflow_publication_outbox + +## Description + +
+Table Definition + +```sql +CREATE TABLE "workflow_publication_outbox" ("id" integer PRIMARY KEY NOT NULL, "workflowId" varchar(36) NOT NULL, "publishedVersionId" varchar(36) NOT NULL, "status" varchar(20) NOT NULL, "errorMessage" text, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "CHK_workflow_publication_outbox_status" CHECK ("status" IN ('pending', 'in_progress', 'completed', 'partial_success', 'failed'))) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | INTEGER | | false | | | | +| workflowId | varchar(36) | | false | | | | +| publishedVersionId | varchar(36) | | false | | | | +| status | varchar(20) | | false | | | | +| errorMessage | TEXT | | true | | | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - | CHECK | CHECK ("status" IN ('pending', 'in_progress', 'completed', 'partial_success', 'failed')) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_workflow_publication_outbox_active_workflow_status | CREATE UNIQUE INDEX "IDX_workflow_publication_outbox_active_workflow_status" ON "workflow_publication_outbox" ("workflowId", "status") WHERE status IN ('pending', 'in_progress') | + +## Relations + +```mermaid +erDiagram + + +"workflow_publication_outbox" { + INTEGER id + varchar_36_ workflowId + varchar_36_ publishedVersionId + varchar_20_ status + TEXT errorMessage + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/workflow_publish_history.md b/docs/generated/sqlite-schema/workflow_publish_history.md new file mode 100644 index 00000000000..ffe6e523f1f --- /dev/null +++ b/docs/generated/sqlite-schema/workflow_publish_history.md @@ -0,0 +1,116 @@ +# workflow_publish_history + +## Description + +
+Table Definition + +```sql +CREATE TABLE "workflow_publish_history" ("id" integer PRIMARY KEY NOT NULL, "workflowId" varchar(36) NOT NULL, "versionId" varchar(36), "event" varchar(36) NOT NULL, "userId" varchar, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "CHK_workflow_publish_history_event" CHECK ((("event" IN ('activated', 'deactivated')))), CONSTRAINT "FK_c01316f8c2d7101ec4fa9809267" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_b4cfbc7556d07f36ca177f5e473" FOREIGN KEY ("versionId") REFERENCES "workflow_history" ("versionId") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_6eab5bd9eedabe9c54bd879fc40" FOREIGN KEY ("userId") REFERENCES "user" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_b4cfbc7556d07f36ca177f5e473" FOREIGN KEY ("versionId") REFERENCES "workflow_history" ("versionId") ON DELETE SET NULL) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | INTEGER | | false | | | | +| workflowId | varchar(36) | | false | | [workflow_entity](workflow_entity.md) | | +| versionId | varchar(36) | | true | | [workflow_history](workflow_history.md) | | +| event | varchar(36) | | false | | | | +| userId | varchar | | true | | [user](user.md) | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (versionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE | +| - (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (versionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 3) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - | CHECK | CHECK ((("event" IN ('activated', 'deactivated')))) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_070b5de842ece9ccdda0d9738b | CREATE INDEX "IDX_070b5de842ece9ccdda0d9738b" ON "workflow_publish_history" ("workflowId", "versionId") | + +## Relations + +```mermaid +erDiagram + +"workflow_publish_history" }o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_publish_history" }o--o| "workflow_history" : "FOREIGN KEY (versionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" +"workflow_publish_history" }o--o| "workflow_history" : "FOREIGN KEY (versionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_publish_history" }o--o| "user" : "FOREIGN KEY (userId) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE SET NULL MATCH NONE" + +"workflow_publish_history" { + INTEGER id + varchar_36_ workflowId FK + varchar_36_ versionId FK + varchar_36_ event + varchar userId FK + datetime_3_ createdAt +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +"workflow_history" { + varchar_36_ versionId PK + varchar_36_ workflowId FK + varchar_255_ authors + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT nodes + TEXT connections + varchar_128_ name + boolean autosaved + TEXT description + TEXT nodeGroups +} +"user" { + varchar id PK + varchar_255_ email + varchar_32_ firstName + varchar_32_ lastName + varchar password + TEXT personalizationAnswers + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT settings + boolean disabled + boolean mfaEnabled + TEXT mfaSecret + TEXT mfaRecoveryCodes + date lastActiveAt + varchar_128_ roleSlug FK +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/workflow_published_version.md b/docs/generated/sqlite-schema/workflow_published_version.md new file mode 100644 index 00000000000..1b32fc7723c --- /dev/null +++ b/docs/generated/sqlite-schema/workflow_published_version.md @@ -0,0 +1,95 @@ +# workflow_published_version + +## Description + +
+Table Definition + +```sql +CREATE TABLE "workflow_published_version" ("workflowId" varchar(36) PRIMARY KEY NOT NULL, "publishedVersionId" varchar(36) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_df3428a541b802d6a63ac56e330" FOREIGN KEY ("publishedVersionId") REFERENCES "workflow_history" ("versionId") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_5c76fb7ee939fe2530374d3f75a" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_5c76fb7ee939fe2530374d3f75a" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE RESTRICT, CONSTRAINT "FK_df3428a541b802d6a63ac56e330" FOREIGN KEY ("publishedVersionId") REFERENCES "workflow_history" ("versionId") ON DELETE RESTRICT) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| workflowId | varchar(36) | | false | | [workflow_entity](workflow_entity.md) | | +| publishedVersionId | varchar(36) | | false | | [workflow_history](workflow_history.md) | | +| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | +| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| workflowId | PRIMARY KEY | PRIMARY KEY (workflowId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (publishedVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE | +| - (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 3) | FOREIGN KEY | FOREIGN KEY (publishedVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_workflow_published_version_1 | PRIMARY KEY | PRIMARY KEY (workflowId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| sqlite_autoindex_workflow_published_version_1 | PRIMARY KEY (workflowId) | + +## Relations + +```mermaid +erDiagram + +"workflow_published_version" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE" +"workflow_published_version" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflow_published_version" }o--|| "workflow_history" : "FOREIGN KEY (publishedVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE RESTRICT MATCH NONE" +"workflow_published_version" }o--|| "workflow_history" : "FOREIGN KEY (publishedVersionId) REFERENCES workflow_history (versionId) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"workflow_published_version" { + varchar_36_ workflowId PK + varchar_36_ publishedVersionId FK + datetime_3_ createdAt + datetime_3_ updatedAt +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +"workflow_history" { + varchar_36_ versionId PK + varchar_36_ workflowId FK + varchar_255_ authors + datetime_3_ createdAt + datetime_3_ updatedAt + TEXT nodes + TEXT connections + varchar_128_ name + boolean autosaved + TEXT description + TEXT nodeGroups +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/workflow_statistics.md b/docs/generated/sqlite-schema/workflow_statistics.md new file mode 100644 index 00000000000..dc62e5d1d94 --- /dev/null +++ b/docs/generated/sqlite-schema/workflow_statistics.md @@ -0,0 +1,65 @@ +# workflow_statistics + +## Description + +
+Table Definition + +```sql +CREATE TABLE "workflow_statistics" ( + "id" INTEGER PRIMARY KEY AUTOINCREMENT, + "count" INTEGER DEFAULT 0, + "latestEvent" DATETIME, + "name" VARCHAR(128) NOT NULL, + "workflowId" VARCHAR(36) NOT NULL, + "workflowName" VARCHAR(128), + "rootCount" INTEGER DEFAULT 0 + ) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| id | INTEGER | | true | | | | +| count | INTEGER | 0 | true | | | | +| latestEvent | DATETIME | | true | | | | +| name | VARCHAR(128) | | false | | | | +| workflowId | VARCHAR(36) | | false | | | | +| workflowName | VARCHAR(128) | | true | | | | +| rootCount | INTEGER | 0 | true | | | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| id | PRIMARY KEY | PRIMARY KEY (id) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| IDX_workflow_statistics_workflow_name | CREATE UNIQUE INDEX "IDX_workflow_statistics_workflow_name" ON "workflow_statistics" ("workflowId", "name") | + +## Relations + +```mermaid +erDiagram + + +"workflow_statistics" { + INTEGER id + INTEGER count + DATETIME latestEvent + VARCHAR_128_ name + VARCHAR_36_ workflowId + VARCHAR_128_ workflowName + INTEGER rootCount +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/docs/generated/sqlite-schema/workflows_tags.md b/docs/generated/sqlite-schema/workflows_tags.md new file mode 100644 index 00000000000..1cf517d528f --- /dev/null +++ b/docs/generated/sqlite-schema/workflows_tags.md @@ -0,0 +1,83 @@ +# workflows_tags + +## Description + +
+Table Definition + +```sql +CREATE TABLE "workflows_tags" ("workflowId" varchar(36) NOT NULL, "tagId" integer NOT NULL, CONSTRAINT "FK_workflows_tags_workflow_entity" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_workflows_tags_tag_entity" FOREIGN KEY ("tagId") REFERENCES "tag_entity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, PRIMARY KEY ("workflowId", "tagId")) +``` + +
+ +## Columns + +| Name | Type | Default | Nullable | Children | Parents | Comment | +| ---- | ---- | ------- | -------- | -------- | ------- | ------- | +| workflowId | varchar(36) | | false | | [workflow_entity](workflow_entity.md) | | +| tagId | INTEGER | | false | | [tag_entity](tag_entity.md) | | + +## Constraints + +| Name | Type | Definition | +| ---- | ---- | ---------- | +| workflowId | PRIMARY KEY | PRIMARY KEY (workflowId) | +| tagId | PRIMARY KEY | PRIMARY KEY (tagId) | +| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (tagId) REFERENCES tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| - (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | +| sqlite_autoindex_workflows_tags_1 | PRIMARY KEY | PRIMARY KEY (workflowId, tagId) | + +## Indexes + +| Name | Definition | +| ---- | ---------- | +| idx_workflows_tags_workflow_id | CREATE INDEX "idx_workflows_tags_workflow_id" ON "workflows_tags" ("workflowId") | +| idx_workflows_tags_tag_id | CREATE INDEX "idx_workflows_tags_tag_id" ON "workflows_tags" ("tagId") | +| sqlite_autoindex_workflows_tags_1 | PRIMARY KEY (workflowId, tagId) | + +## Relations + +```mermaid +erDiagram + +"workflows_tags" |o--|| "workflow_entity" : "FOREIGN KEY (workflowId) REFERENCES workflow_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" +"workflows_tags" |o--|| "tag_entity" : "FOREIGN KEY (tagId) REFERENCES tag_entity (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" + +"workflows_tags" { + varchar_36_ workflowId PK + INTEGER tagId PK +} +"workflow_entity" { + varchar_36_ id PK + varchar_128_ name + boolean active + TEXT nodes + TEXT connections + TEXT settings + TEXT staticData + TEXT pinData + varchar_36_ versionId + INTEGER triggerCount + TEXT meta + varchar_36_ parentFolderId FK + datetime_3_ createdAt + datetime_3_ updatedAt + boolean isArchived + INTEGER versionCounter + TEXT description + varchar_36_ activeVersionId FK + TEXT nodeGroups + varchar sourceWorkflowId +} +"tag_entity" { + varchar_36_ id PK + varchar_24_ name + datetime_3_ createdAt + datetime_3_ updatedAt +} +``` + +--- + +> Generated by [tbls](https://github.com/k1LoW/tbls) diff --git a/package.json b/package.json index 2ab0ce28316..291d588dfc4 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,8 @@ "test:ci:backend:integration": "turbo run test:integration --continue --concurrency=1 --filter='!./packages/frontend/**'", "test:ci:backend:integration:changed": "turbo run test:integration:changed --continue --concurrency=1 --filter='!./packages/frontend/**'", "test:affected": "turbo run test --affected --concurrency=1", + "db:schema:docs": "turbo run build --filter=@n8n/db && pnpm --filter=@n8n/db schema:docs", + "db:schema:check": "turbo run build --filter=@n8n/db && pnpm --filter=@n8n/db schema:check", "test:with:docker": "pnpm --filter=n8n-playwright test:container:standard", "test:show:report": "pnpm --filter=n8n-playwright exec playwright show-report", "watch": "turbo run watch --concurrency=64", diff --git a/packages/@n8n/db/package.json b/packages/@n8n/db/package.json index 11aca3533b4..561206d2a16 100644 --- a/packages/@n8n/db/package.json +++ b/packages/@n8n/db/package.json @@ -2,7 +2,7 @@ "name": "@n8n/db", "version": "1.26.0", "scripts": { - "clean": "rimraf dist .turbo", + "clean": "rimraf dist .turbo .tmp-schema-docs", "dev": "pnpm watch", "typecheck": "tsc --noEmit", "build": "tsc -p tsconfig.build.json", @@ -15,7 +15,13 @@ "test": "vitest run", "test:unit": "vitest run", "test:dev": "vitest --silent=false", - "migration:new": "node scripts/new-migration.mjs" + "migration:new": "node scripts/new-migration.mjs", + "schema:docs:sqlite": "node scripts/schema-docs.mjs doc --db=sqlite", + "schema:docs:postgres": "node scripts/schema-docs.mjs doc --db=postgres", + "schema:docs": "pnpm schema:docs:sqlite && pnpm schema:docs:postgres", + "schema:check:sqlite": "node scripts/schema-docs.mjs diff --db=sqlite", + "schema:check:postgres": "node scripts/schema-docs.mjs diff --db=postgres", + "schema:check": "pnpm schema:check:sqlite && pnpm schema:check:postgres" }, "main": "dist/index.js", "module": "src/index.ts", @@ -49,6 +55,7 @@ "@n8n/typescript-config": "workspace:*", "@n8n/vitest-config": "workspace:*", "@types/lodash": "catalog:", + "@testcontainers/postgresql": "catalog:", "@vitest/coverage-v8": "catalog:", "express": "5.1.0", "typescript": "catalog:", diff --git a/packages/@n8n/db/scripts/schema-docs.mjs b/packages/@n8n/db/scripts/schema-docs.mjs new file mode 100644 index 00000000000..acfed1c1f55 --- /dev/null +++ b/packages/@n8n/db/scripts/schema-docs.mjs @@ -0,0 +1,247 @@ +#!/usr/bin/env node +// @ts-check +/** + * Generates (or verifies) the database schema documentation under `docs/generated/`. + * + * The schema is defined by the migrations, not the entities (entities run with + * `synchronize: false`). So we bring an empty database to the fully-migrated + * state by running the `@n8n/db` migration arrays, then point `tbls` at it to + * render Markdown + a Mermaid ER diagram. + * + * One database type per process: `migration-helpers.ts` captures `DB_TYPE` / + * `DB_TABLE_PREFIX` from the DI config at module-load time, so the env must be + * set BEFORE `@n8n/db` is imported and cannot be changed afterwards. + * + * node scripts/schema-docs.mjs --db= [--docker] + * + * `--docker` (auto-enabled when `CI` is set) runs tbls via its image instead of + * a local binary. + */ +import { spawn, spawnSync } from 'node:child_process'; +import { mkdirSync, rmSync } from 'node:fs'; +import { dirname, relative, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); +const PKG_ROOT = resolve(__dirname, '..'); +const REPO_ROOT = resolve(__dirname, '../../../../'); +const TMP_DIR = resolve(PKG_ROOT, '.tmp-schema-docs'); + +// Pinned by tag + digest for reproducible CI runs; bump deliberately. +const TBLS_IMAGE = + 'ghcr.io/k1low/tbls:v1.94.5@sha256:ae8a3bff6d4f8495d13a7982cd71fac3e8a3d1dd394888f2c44ef82216aa14e4'; + +/** Thrown for expected, user-facing failures so `main`'s cleanup still runs. */ +class FailError extends Error {} + +function fail(msg) { + throw new FailError(msg); +} + +/** Turns a spawn failure into an actionable message for missing binaries. */ +function spawnErrorMessage(cmd, err) { + if (err.code === 'ENOENT') { + if (cmd === 'tbls') { + return 'tbls is not installed. Install it with `brew install tbls` (see https://github.com/k1LoW/tbls#install), or re-run with --docker to use the tbls Docker image instead.'; + } + if (cmd === 'docker') { + return 'docker is not installed or not on PATH. Install Docker, or drop --docker to use a local tbls binary.'; + } + } + return `failed to spawn ${cmd}: ${err.message}`; +} + +function parseArgs(argv) { + const args = { command: null, dbType: null, docker: !!process.env.CI }; + for (const arg of argv) { + if (arg === '--docker') args.docker = true; + else if (arg.startsWith('--db=')) args.dbType = arg.slice('--db='.length); + else if (!arg.startsWith('--') && !args.command) args.command = arg; + } + return args; +} + +/** Runs a command, inheriting stdio. Resolves with the exit code. */ +function run(cmd, cmdArgs, env) { + return new Promise((res, rej) => { + const child = spawn(cmd, cmdArgs, { cwd: REPO_ROOT, env, stdio: 'inherit' }); + child.on('error', (err) => rej(new FailError(spawnErrorMessage(cmd, err)))); + child.on('close', (code) => res(code ?? 1)); + }); +} + +/** Runs a command, capturing stdout (used for `tbls diff`). */ +function capture(cmd, cmdArgs, env) { + return new Promise((res, rej) => { + let stdout = ''; + const child = spawn(cmd, cmdArgs, { cwd: REPO_ROOT, env }); + child.on('error', (err) => rej(new FailError(spawnErrorMessage(cmd, err)))); + child.stdout.on('data', (d) => (stdout += d)); + child.stderr.on('data', (d) => process.stderr.write(d)); + child.on('close', (code) => res({ code: code ?? 1, stdout })); + }); +} + +/** Spins up an empty database and returns its connection details + a cleanup fn. */ +async function provision(dbType) { + if (dbType === 'sqlite') { + const file = resolve(TMP_DIR, 'schema.sqlite'); + mkdirSync(TMP_DIR, { recursive: true }); + rmSync(file, { force: true }); + process.env.DB_TYPE = 'sqlite'; + process.env.DB_SQLITE_DATABASE = file; + process.env.DB_TABLE_PREFIX = ''; + return { + dataSourceOptions: { type: 'sqlite', database: file }, + file, + cleanup: () => rmSync(file, { force: true }), + }; + } + + // postgres: spin a throwaway container. Image tag matches the testcontainers + // default in `n8n-containers` (packages/testing/containers/test-containers.ts). + const { PostgreSqlContainer } = await import('@testcontainers/postgresql'); + const container = await new PostgreSqlContainer('postgres:18-alpine').start(); + const conn = { + host: container.getHost(), + port: container.getMappedPort(5432), + username: container.getUsername(), + password: container.getPassword(), + database: container.getDatabase(), + schema: 'public', + }; + process.env.DB_TYPE = 'postgresdb'; + process.env.DB_POSTGRESDB_HOST = conn.host; + process.env.DB_POSTGRESDB_PORT = String(conn.port); + process.env.DB_POSTGRESDB_DATABASE = conn.database; + process.env.DB_POSTGRESDB_USER = conn.username; + process.env.DB_POSTGRESDB_PASSWORD = conn.password; + process.env.DB_POSTGRESDB_SCHEMA = conn.schema; + process.env.DB_TABLE_PREFIX = ''; + return { + dataSourceOptions: { type: 'postgres', ...conn }, + cleanup: () => container.stop(), + }; +} + +/** Builds the tbls DSN for the freshly-migrated database. */ +function buildDsn(dbType, provisioned, docker) { + if (dbType === 'sqlite') { + // tbls reads the file directly; under Docker it lives in the /work mount. + const filePath = docker ? `/work/${relative(REPO_ROOT, provisioned.file)}` : provisioned.file; + return `sqlite://${filePath}`; + } + const conn = provisioned.dataSourceOptions; + // Under Docker, tbls runs in its own container and reaches the host-mapped + // Postgres port via host.docker.internal (added below with --add-host). + const host = docker ? 'host.docker.internal' : conn.host; + return `postgres://${conn.username}:${conn.password}@${host}:${conn.port}/${conn.database}?sslmode=disable&search_path=public`; +} + +/** Invokes tbls (binary locally, Docker image in CI). */ +async function tbls(command, dbType, dsn, docker) { + const config = `.tbls.${dbType}.yml`; + const env = { ...process.env, TBLS_DSN: dsn }; + const args = command === 'diff' ? ['diff'] : ['doc', '--force']; + args.push('-c', config); + + if (docker) { + const dockerArgs = [ + 'run', + '--rm', + '--add-host', + 'host.docker.internal:host-gateway', + '-e', + `TBLS_DSN=${dsn}`, + '-v', + `${REPO_ROOT}:/work`, + '-w', + '/work', + TBLS_IMAGE, + ...args, + ]; + return command === 'diff' + ? capture('docker', dockerArgs, env) + : { code: await run('docker', dockerArgs, env), stdout: '' }; + } + return command === 'diff' + ? capture('tbls', args, env) + : { code: await run('tbls', args, env), stdout: '' }; +} + +async function main() { + const { command, dbType, docker } = parseArgs(process.argv.slice(2)); + if (command !== 'doc' && command !== 'diff') { + fail('usage: schema-docs.mjs --db= [--docker]'); + } + if (dbType !== 'sqlite' && dbType !== 'postgres') { + fail('--db must be sqlite or postgres'); + } + + // Fail fast on a missing binary, before spinning up a DB and running migrations. + const requiredBin = docker ? 'docker' : 'tbls'; + const probe = spawnSync(requiredBin, ['version'], { stdio: 'ignore' }); + if (probe.error) fail(spawnErrorMessage(requiredBin, probe.error)); + + const provisioned = await provision(dbType); + try { + // Imported only now: env above must be set before @n8n/db evaluates its + // migration context from the DI config. + const { DataSource } = await import('@n8n/typeorm'); + // Imported from built dist by path: the package can't resolve its own name. + const { entities, sqliteMigrations, postgresMigrations, wrapMigration } = await import( + new URL('../dist/index.js', import.meta.url).href + ); + const migrations = dbType === 'sqlite' ? sqliteMigrations : postgresMigrations; + + const dataSource = new DataSource({ + ...provisioned.dataSourceOptions, + // Some migrations use the EntityManager, so entity metadata must be registered. + entities: Object.values(entities), + synchronize: false, + migrationsTableName: 'migrations', + migrations, + }); + await dataSource.initialize(); + // Wrap only after initialize(): TypeORM constructs each migration during + // metadata building, and wrapping installs a `transaction` getter that + // would clash with migrations setting `transaction` in their constructor. + migrations.forEach(wrapMigration); + await dataSource.runMigrations({ transaction: 'each' }); + await dataSource.destroy(); + + const dsn = buildDsn(dbType, provisioned, docker); + const { code, stdout } = await tbls(command, dbType, dsn, docker); + + if (command === 'diff') { + // `tbls diff` prints the unified diff to stdout and exits non-zero when + // the docs are stale. An empty stdout with a non-zero exit is a genuine + // tbls error (e.g. cannot connect), so check the diff output first. + if (stdout.trim() !== '') { + process.stdout.write(stdout); + fail( + `schema docs for ${dbType} are out of date. Run \`pnpm db:schema:docs\` and commit the changes.`, + ); + } + if (code !== 0) fail(`tbls diff failed (exit ${code})`); + console.log(`✓ ${dbType} schema docs are up to date`); + } else if (code !== 0) { + fail(`tbls doc failed (exit ${code})`); + } else { + console.log(`✓ generated ${dbType} schema docs in docs/generated/${dbType}-schema`); + } + } finally { + await provisioned.cleanup(); + } +} + +try { + await main(); +} catch (err) { + if (err instanceof FailError) { + console.error(`error: ${err.message}`); + process.exitCode = 1; + } else { + throw err; + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bc82f82f84e..ab8955d926c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1620,6 +1620,9 @@ importers: '@n8n/vitest-config': specifier: workspace:* version: link:../vitest-config + '@testcontainers/postgresql': + specifier: 'catalog:' + version: 11.13.0 '@types/lodash': specifier: 'catalog:' version: 4.17.17