n8n/docs/generated/sqlite-schema/schema.json
Michael Drury 86b7234f81
fix(core): Persist agent subscription lists for threads to DB for multi-main configurations (no-changelog) (#31614)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 11:16:20 +00:00

13673 lines
424 KiB
JSON

{
"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
},
{
"name": "jsonSizeBytes",
"type": "BIGINT",
"nullable": false,
"default": "0"
},
{
"name": "workflowVersionId",
"type": "VARCHAR(36)",
"nullable": true,
"default": "NULL"
}
],
"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), \"jsonSizeBytes\" BIGINT NOT NULL DEFAULT 0, \"workflowVersionId\" VARCHAR(36) DEFAULT NULL, 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)"
},
{
"name": "agent_chat_subscriptions",
"type": "table",
"columns": [
{
"name": "agentId",
"type": "varchar(36)",
"nullable": false
},
{
"name": "integrationType",
"type": "varchar(64)",
"nullable": false
},
{
"name": "credentialId",
"type": "varchar(255)",
"nullable": false
},
{
"name": "threadId",
"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": "sqlite_autoindex_agent_chat_subscriptions_1",
"def": "PRIMARY KEY (agentId, integrationType, credentialId, threadId)",
"table": "agent_chat_subscriptions",
"columns": [
"agentId",
"integrationType",
"credentialId",
"threadId"
]
}
],
"constraints": [
{
"name": "agentId",
"type": "PRIMARY KEY",
"def": "PRIMARY KEY (agentId)",
"table": "agent_chat_subscriptions",
"columns": [
"agentId"
]
},
{
"name": "integrationType",
"type": "PRIMARY KEY",
"def": "PRIMARY KEY (integrationType)",
"table": "agent_chat_subscriptions",
"columns": [
"integrationType"
]
},
{
"name": "credentialId",
"type": "PRIMARY KEY",
"def": "PRIMARY KEY (credentialId)",
"table": "agent_chat_subscriptions",
"columns": [
"credentialId"
]
},
{
"name": "threadId",
"type": "PRIMARY KEY",
"def": "PRIMARY KEY (threadId)",
"table": "agent_chat_subscriptions",
"columns": [
"threadId"
]
},
{
"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_chat_subscriptions",
"referenced_table": "agents",
"columns": [
"agentId"
],
"referenced_columns": [
"id"
]
},
{
"name": "sqlite_autoindex_agent_chat_subscriptions_1",
"type": "PRIMARY KEY",
"def": "PRIMARY KEY (agentId, integrationType, credentialId, threadId)",
"table": "agent_chat_subscriptions",
"columns": [
"agentId",
"integrationType",
"credentialId",
"threadId"
]
},
{
"name": "-",
"type": "CHECK",
"def": "CHECK (\"integrationType\" IN ('telegram', 'slack', 'linear'))",
"table": "agent_chat_subscriptions",
"columns": [
"integrationType"
]
}
],
"def": "CREATE TABLE \"agent_chat_subscriptions\" (\"agentId\" varchar(36) NOT NULL, \"integrationType\" varchar(64) NOT NULL, \"credentialId\" varchar(255) NOT NULL, \"threadId\" 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 \"CHK_agent_chat_subscriptions_integrationType\" CHECK (\"integrationType\" IN ('telegram', 'slack', 'linear')), CONSTRAINT \"FK_e79153bd179c011e779d5016796\" FOREIGN KEY (\"agentId\") REFERENCES \"agents\" (\"id\") ON DELETE CASCADE, PRIMARY KEY (\"agentId\", \"integrationType\", \"credentialId\", \"threadId\"))"
}
],
"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"
},
{
"table": "agent_chat_subscriptions",
"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"
}
],
"driver": {
"name": "sqlite",
"database_version": "3.51.3"
}
}