# agent_file_grants ## Description
Table Definition ```sql CREATE TABLE "agent_file_grants" ("attachmentId" varchar(16) NOT NULL, "threadId" 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_10af5c940fc14c3637358924508" FOREIGN KEY ("attachmentId") REFERENCES "agent_chat_attachments" ("id") ON DELETE CASCADE, PRIMARY KEY ("attachmentId", "threadId")) ```
## Columns | Name | Type | Default | Nullable | Children | Parents | Comment | | ---- | ---- | ------- | -------- | -------- | ------- | ------- | | attachmentId | varchar(16) | | false | | [agent_chat_attachments](agent_chat_attachments.md) | | | createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | | threadId | varchar(128) | | false | | | | | updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | | ## Constraints | Name | Type | Definition | | ---- | ---- | ---------- | | - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (attachmentId) REFERENCES agent_chat_attachments (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE | | attachmentId | PRIMARY KEY | PRIMARY KEY (attachmentId) | | sqlite_autoindex_agent_file_grants_1 | PRIMARY KEY | PRIMARY KEY (attachmentId, threadId) | | threadId | PRIMARY KEY | PRIMARY KEY (threadId) | ## Indexes | Name | Definition | | ---- | ---------- | | sqlite_autoindex_agent_file_grants_1 | PRIMARY KEY (attachmentId, threadId) | ## Relations ```mermaid erDiagram "agent_file_grants" |o--|| "agent_chat_attachments" : "FOREIGN KEY (attachmentId) REFERENCES agent_chat_attachments (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE" "agent_file_grants" { varchar_16_ attachmentId PK datetime_3_ createdAt varchar_128_ threadId PK datetime_3_ updatedAt } "agent_chat_attachments" { varchar_36_ agentId FK TEXT binaryDataId datetime_3_ createdAt varchar_128_ createdByThreadId varchar_255_ fileName INTEGER fileSizeBytes varchar_16_ id PK varchar_255_ mimeType varchar_36_ projectId FK varchar_255_ resourceId varchar_32_ source varchar_128_ threadId datetime_3_ updatedAt } ``` --- > Generated by [tbls](https://github.com/k1LoW/tbls)