π¨ The ultimate agentic social media scheduling tool π€
TypeScript nextjsopen-sourceopen-source-social-media-scheduling-toolosspostiz-cloudpostiz-hostedredisscheduling-toolsocial-media-scheduling-tooltypescript
fix(prisma): mirror every Mastra 1.67 table and column in schema.prisma
Nevo Davide9245cad7d6b
diff --git a/libraries/nestjs-libraries/src/database/prisma/schema.prisma b/libraries/nestjs-libraries/src/database/prisma/schema.prismaindex 941e27a8d..706940a11 100644--- a/libraries/nestjs-libraries/src/database/prisma/schema.prisma+++ b/libraries/nestjs-libraries/src/database/prisma/schema.prisma@@ -694,32 +694,67 @@ model Mentions {/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.model mastra_ai_spans {- traceId String- spanId String- parentSpanId String?- name String- scope Json?- spanType String- attributes Json?- metadata Json?- links Json?- input Json?- output Json?- error Json?- startedAt DateTime @db.Timestamp(6)- endedAt DateTime? @db.Timestamp(6)- createdAt DateTime @db.Timestamp(6)- updatedAt DateTime? @db.Timestamp(6)- isEvent Boolean- startedAtZ DateTime? @default(now()) @db.Timestamptz(6)- endedAtZ DateTime? @default(now()) @db.Timestamptz(6)- createdAtZ DateTime? @default(now()) @db.Timestamptz(6)- updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)-+ traceId String+ spanId String+ parentSpanId String?+ name String+ scope Json?+ spanType String+ attributes Json?+ metadata Json?+ links Json?+ input Json?+ output Json?+ error Json?+ startedAt DateTime @db.Timestamp(6)+ endedAt DateTime? @db.Timestamp(6)+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime? @db.Timestamp(6)+ isEvent Boolean+ startedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ endedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ entityType String?+ entityId String?+ entityName String?+ parentEntityType String?+ parentEntityId String?+ parentEntityName String?+ rootEntityType String?+ rootEntityId String?+ rootEntityName String?+ userId String?+ organizationId String?+ resourceId String?+ runId String?+ sessionId String?+ threadId String?+ requestId String?+ environment String?+ serviceName String?+ experimentId String?+ source String?+ tags Json?+ requestContext Json?+ entityVersionId String?+ parentEntityVersionId String?+ rootEntityVersionId String?++ @@id([traceId, spanId], map: "public_mastra_ai_spans_traceid_spanid_pk")@@index([name], map: "public_mastra_ai_spans_name_idx")@@index([parentSpanId, startedAt(sort: Desc)], map: "public_mastra_ai_spans_parentspanid_startedat_idx")@@index([spanType, startedAt(sort: Desc)], map: "public_mastra_ai_spans_spantype_startedat_idx")@@index([traceId, startedAt(sort: Desc)], map: "public_mastra_ai_spans_traceid_startedat_idx")+ @@index([entityType, entityId], map: "mastra_ai_spans_entitytype_entityid_idx")+ @@index([entityType, entityName], map: "mastra_ai_spans_entitytype_entityname_idx")+ @@index([metadata], map: "mastra_ai_spans_metadata_gin_idx", type: Gin)+ @@index([name])+ @@index([organizationId, userId], map: "mastra_ai_spans_orgid_userid_idx")+ @@index([parentSpanId, startedAt(sort: Desc)], map: "mastra_ai_spans_parentspanid_startedat_idx")+ @@index([spanType, startedAt(sort: Desc)], map: "mastra_ai_spans_spantype_startedat_idx")+ @@index([tags], map: "mastra_ai_spans_tags_gin_idx", type: Gin)+ @@index([traceId, startedAt(sort: Desc)], map: "mastra_ai_spans_traceid_startedat_idx")@@ignore}@@ -754,6 +789,7 @@ model mastra_messages {createdAtZ DateTime? @default(now()) @db.Timestamptz(6)@@index([thread_id, createdAt(sort: Desc)], map: "public_mastra_messages_thread_id_createdat_idx")+ @@index([thread_id, createdAt(sort: Desc)], map: "mastra_messages_thread_id_createdat_idx")}model mastra_resources {@@ -799,8 +835,15 @@ model mastra_scorers {createdAtZ DateTime? @default(now()) @db.Timestamptz(6)updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)spanId String?+ requestContext Json?+ organizationId String?+ projectId String?+ batchId String?+ datasetId String?+ datasetItemId String?@@index([traceId, spanId, createdAt(sort: Desc)], map: "public_mastra_scores_trace_id_span_id_created_at_idx")+ @@index([traceId, spanId, createdAt(sort: Desc)], map: "mastra_scores_trace_id_span_id_created_at_idx")}model mastra_threads {@@ -814,6 +857,7 @@ model mastra_threads {updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)@@index([resourceId, createdAt(sort: Desc)], map: "public_mastra_threads_resourceid_createdat_idx")+ @@index([resourceId, createdAt(sort: Desc)], map: "mastra_threads_resourceid_createdat_idx")}model mastra_traces {@@ -847,6 +891,735 @@ model mastra_workflow_snapshot {updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)@@unique([workflow_name, run_id], map: "public_mastra_workflow_snapshot_workflow_name_run_id_key")+ @@index([workflow_name, createdAt(sort: Desc)], map: "mastra_workflow_snapshot_name_createdat_idx")+}++model mastra_agent_versions {+ id String @id+ agentId String+ versionNumber Int+ name String+ description String?+ instructions String+ model Json+ tools Json?+ defaultOptions Json?+ workflows Json?+ agents Json?+ integrationTools Json?+ inputProcessors Json?+ outputProcessors Json?+ memory Json?+ scorers Json?+ mcpClients Json?+ requestContextSchema Json?+ workspace Json?+ skills Json?+ skillsFormat String?+ changedFields Json?+ changeMessage String?+ createdAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ durable Json?+ browser Json?+ toolProviders Json?+}++model mastra_agents {+ id String @id+ status String+ activeVersionId String?+ authorId String?+ metadata Json?+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ visibility String?+ favoriteCount Int?+}++model mastra_background_tasks {+ id String @id+ tool_call_id String+ tool_name String+ agent_id String+ run_id String+ thread_id String?+ resource_id String?+ status String+ args Json+ result Json?+ error Json?+ suspend_payload Json?+ retry_count Int+ max_retries Int+ timeout_ms Int+ createdAt DateTime @db.Timestamp(6)+ startedAt DateTime? @db.Timestamp(6)+ suspendedAt DateTime? @db.Timestamp(6)+ completedAt DateTime? @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ startedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ suspendedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ completedAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@index([agent_id, status], map: "mastra_bg_tasks_agent_status_idx")+ @@index([status, createdAt], map: "mastra_bg_tasks_status_created_at_idx")+ @@index([thread_id, createdAt], map: "mastra_bg_tasks_thread_idx")+ @@index([tool_call_id], map: "mastra_bg_tasks_tool_call_idx")+}++model mastra_channel_config {+ platform String @id+ data Json+ updatedAt DateTime @db.Timestamp(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)+}++model mastra_channel_installations {+ id String @id+ platform String+ agentId String+ status String+ webhookId String? @unique(map: "idx_channel_installations_webhook")+ data Json+ configHash String?+ error String?+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@index([platform, agentId], map: "idx_channel_installations_platform_agent")+}++model mastra_dataset_items {+ id String+ datasetId String+ datasetVersion Int+ validTo Int?+ isDeleted Boolean+ input Json+ groundTruth Json?+ requestContext Json?+ metadata Json?+ source Json?+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ expectedTrajectory Json?+ organizationId String?+ projectId String?+ toolMocks Json?+ unmockedToolPolicy String?+ scorerIds Json?+ externalId String?++ @@id([id, datasetVersion])+ @@index([datasetId, validTo], map: "idx_dataset_items_dataset_validto")+ @@index([datasetId, validTo, isDeleted], map: "idx_dataset_items_dataset_validto_deleted")+ @@index([datasetId, datasetVersion], map: "idx_dataset_items_dataset_version")+ @@index([datasetId, externalId, datasetVersion], map: "idx_dataset_items_external_id_history")+ @@index([organizationId, projectId], map: "idx_dataset_items_org_project")+}++model mastra_dataset_versions {+ id String @id+ datasetId String+ version Int+ createdAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@unique([datasetId, version], map: "idx_dataset_versions_dataset_version_unique")+ @@index([datasetId, version], map: "idx_dataset_versions_dataset_version")+}++model mastra_datasets {+ id String @id+ name String+ description String?+ metadata Json?+ inputSchema Json?+ groundTruthSchema Json?+ requestContextSchema Json?+ tags Json?+ targetType String?+ targetIds Json?+ scorerIds Json?+ version Int+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ organizationId String?+ projectId String?+ candidateKey String?+ candidateId String?++ @@index([candidateKey, candidateId], map: "idx_datasets_candidate")+ @@index([organizationId, projectId], map: "idx_datasets_org_project")+}++model mastra_experiment_results {+ id String @id+ experimentId String+ itemId String+ itemDatasetVersion Int?+ input Json+ output Json?+ groundTruth Json?+ error Json?+ startedAt DateTime @db.Timestamp(6)+ completedAt DateTime @db.Timestamp(6)+ retryCount Int+ traceId String?+ status String?+ tags Json?+ createdAt DateTime @db.Timestamp(6)+ startedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ completedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ comment String?+ toolMockReport Json?+ metadata Json?+ organizationId String?+ projectId String?+ attempt Int?++ @@unique([experimentId, itemId, attempt], map: "idx_experiment_results_exp_item_attempt")+ @@index([experimentId], map: "idx_experiment_results_experimentid")+ @@index([organizationId, projectId], map: "idx_experiment_results_org_project")+ @@index([tags], map: "idx_experiment_results_tags_gin", type: Gin)+}++model mastra_experiments {+ id String @id+ name String?+ description String?+ metadata Json?+ datasetId String?+ datasetVersion Int?+ targetType String+ targetId String+ status String+ totalItems Int+ succeededCount Int+ failedCount Int+ skippedCount Int+ startedAt DateTime? @db.Timestamp(6)+ completedAt DateTime? @db.Timestamp(6)+ agentVersion String?+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ startedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ completedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ organizationId String?+ projectId String?+ provenance Json?+ runnerAttestation Json?+ experimentSetId String?+ comparisonId String?+ variantId String?+ trialIndex Int?+ scorerIds Json?++ @@index([datasetId], map: "idx_experiments_datasetid")+ @@index([experimentSetId, comparisonId, variantId, trialIndex], map: "idx_experiments_grouping")+ @@index([organizationId, projectId], map: "idx_experiments_org_project")+}++model mastra_favorites {+ userId String+ entityType String+ entityId String+ createdAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@id([userId, entityType, entityId])+ @@index([entityType, entityId], map: "idx_favorites_entity")+}++model mastra_knowledge_activity {+ id String @id+ action String+ recordType String+ recordId String+ scope Json+ scopeKey String+ sourceThreadId String?+ createdAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@index([id(sort: Desc)], map: "idx_knowledge_activity_latest")+}++model mastra_knowledge_cursors {+ sourceThreadId String+ agent String+ lastKnowledgeId String+ updatedAt DateTime @db.Timestamp(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@id([sourceThreadId, agent])+}++model mastra_knowledge_mentions {+ sourceType String+ sourceId String+ recordId String++ @@id([sourceType, sourceId, recordId])+ @@index([recordId, sourceType, sourceId], map: "idx_knowledge_mentions_record")+}++model mastra_knowledge_nodes {+ id String @id+ type String+ name String+ canonicalName String+ kind String?+ content String?+ description String?+ scope Json+ scopeKey String+ version Int+ mergedInto String?+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@unique([type, scopeKey, canonicalName], map: "idx_knowledge_nodes_identity")+ @@index([scopeKey, type], map: "idx_knowledge_nodes_scope")+}++model mastra_knowledge_records {+ id String @id+ node String+ text String+ scope Json+ scopeKey String+ sourceThreadId String+ capturedAt DateTime @db.Timestamp(6)+ when DateTime? @db.Timestamp(6)+ maxScope String?+ metadata Json?+ deletedAt DateTime? @db.Timestamp(6)+ deletedBy String?+ capturedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ whenZ DateTime? @default(now()) @db.Timestamptz(6)+ deletedAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@index([node, id(sort: Desc)], map: "idx_knowledge_records_node_latest")+ @@index([sourceThreadId, id(sort: Desc)], map: "idx_knowledge_records_thread_latest")+}++model mastra_knowledge_semantic_outbox {+ id String @id+ idempotencyKey String @unique(map: "idx_knowledge_outbox_idempotency")+ documentId String+ documentType String+ operation String+ scope Json+ scopeKey String+ status String+ attempts Int+ availableAt DateTime @db.Timestamp(6)+ claimedAt DateTime? @db.Timestamp(6)+ claimedBy String?+ createdAt DateTime @db.Timestamp(6)+ completedAt DateTime? @db.Timestamp(6)+ availableAtZ DateTime? @default(now()) @db.Timestamptz(6)+ claimedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ completedAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@index([status, availableAt, createdAt], map: "idx_knowledge_outbox_claim")+}++model mastra_mcp_client_versions {+ id String @id+ mcpClientId String+ versionNumber Int+ name String+ description String?+ servers Json+ changedFields Json?+ changeMessage String?+ createdAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@unique([mcpClientId, versionNumber], map: "idx_mcp_client_versions_client_version")+}++model mastra_mcp_clients {+ id String @id+ status String+ activeVersionId String?+ authorId String?+ metadata Json?+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)+}++model mastra_mcp_server_versions {+ id String @id+ mcpServerId String+ versionNumber Int+ name String+ version String+ description String?+ instructions String?+ repository Json?+ releaseDate String?+ isLatest Boolean?+ packageCanonical String?+ tools Json?+ agents Json?+ workflows Json?+ changedFields Json?+ changeMessage String?+ createdAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@unique([mcpServerId, versionNumber], map: "idx_mcp_server_versions_server_version")+}++model mastra_mcp_servers {+ id String @id+ status String+ activeVersionId String?+ authorId String?+ metadata Json?+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)+}++/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.+model mastra_notifications {+ id String+ threadId String+ source String+ kind String+ priority String+ status String+ summary String+ payload Json?+ resourceId String?+ agentId String?+ sourceId String?+ dedupeKey String?+ coalesceKey String?+ coalescedCount Int+ attributes Json?+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ deliveredAt DateTime? @db.Timestamp(6)+ seenAt DateTime? @db.Timestamp(6)+ dismissedAt DateTime? @db.Timestamp(6)+ archivedAt DateTime? @db.Timestamp(6)+ discardedAt DateTime? @db.Timestamp(6)+ deliverAt DateTime? @db.Timestamp(6)+ summaryAt DateTime? @db.Timestamp(6)+ deliveryReason String?+ deliveryAttempts Int+ lastDeliveryAttemptAt DateTime? @db.Timestamp(6)+ lastDeliveryError String?+ deliveredSignalId String?+ summarySignalId String?+ metadata Json?+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ deliveredAtZ DateTime? @default(now()) @db.Timestamptz(6)+ seenAtZ DateTime? @default(now()) @db.Timestamptz(6)+ dismissedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ archivedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ discardedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ deliverAtZ DateTime? @default(now()) @db.Timestamptz(6)+ summaryAtZ DateTime? @default(now()) @db.Timestamptz(6)+ lastDeliveryAttemptAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@index([threadId, source, kind, status, agentId, resourceId, dedupeKey, coalesceKey], map: "idx_notifications_coalescing")+ @@index([status, deliverAt, summaryAt], map: "idx_notifications_due")+ @@index([threadId, status, updatedAt], map: "idx_notifications_thread_status_updated")+ @@ignore+}++model mastra_observational_memory {+ id String @id+ lookupKey String+ scope String+ resourceId String?+ threadId String?+ activeObservations String+ activeObservationsPendingUpdate String?+ originType String+ config String+ generationCount Int+ lastObservedAt DateTime? @db.Timestamp(6)+ lastReflectionAt DateTime? @db.Timestamp(6)+ pendingMessageTokens Int+ totalTokensObserved Int+ observationTokenCount Int+ isObserving Boolean+ isReflecting Boolean+ observedMessageIds Json?+ observedTimezone String?+ bufferedObservations String?+ bufferedObservationTokens Int?+ bufferedMessageIds Json?+ bufferedReflection String?+ bufferedReflectionTokens Int?+ bufferedReflectionInputTokens Int?+ reflectedObservationLineCount Int?+ bufferedObservationChunks Json?+ isBufferingObservation Boolean+ isBufferingReflection Boolean+ lastBufferedAtTokens Int+ lastBufferedAtTime DateTime? @db.Timestamp(6)+ metadata Json?+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ lastObservedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ lastReflectionAtZ DateTime? @default(now()) @db.Timestamptz(6)+ lastBufferedAtTimeZ DateTime? @default(now()) @db.Timestamptz(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@index([lookupKey], map: "idx_om_lookup_key")+}++model mastra_prompt_block_versions {+ id String @id+ blockId String+ versionNumber Int+ name String+ description String?+ content String+ rules Json?+ requestContextSchema Json?+ changedFields Json?+ changeMessage String?+ createdAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@unique([blockId, versionNumber], map: "idx_prompt_block_versions_block_version")+}++model mastra_prompt_blocks {+ id String @id+ status String+ activeVersionId String?+ authorId String?+ metadata Json?+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)+}++model mastra_schedule_triggers {+ id String @id+ schedule_id String+ run_id String?+ scheduled_fire_at BigInt+ actual_fire_at BigInt+ outcome String+ error String?+ trigger_kind String+ parent_trigger_id String?+ metadata Json?++ @@index([schedule_id, actual_fire_at(sort: Desc)], map: "idx_mastra_schedule_triggers_schedule_fire")+}++model mastra_schedules {+ id String @id+ target Json+ cron String+ timezone String?+ status String+ next_fire_at BigInt+ last_fire_at BigInt?+ last_run_id String?+ created_at BigInt+ updated_at BigInt+ metadata Json?+ owner_type String?+ owner_id String?++ @@index([status, next_fire_at], map: "idx_mastra_schedules_status_next_fire")+}++model mastra_scorer_definition_versions {+ id String @id+ scorerDefinitionId String+ versionNumber Int+ name String+ description String?+ type String+ model Json?+ instructions String?+ scoreRange Json?+ presetConfig Json?+ defaultSampling Json?+ changedFields Json?+ changeMessage String?+ createdAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@unique([scorerDefinitionId, versionNumber], map: "idx_scorer_definition_versions_def_version")+}++model mastra_scorer_definitions {+ id String @id+ status String+ activeVersionId String?+ authorId String?+ metadata Json?+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ organizationId String?+ projectId String?+}++model mastra_skill_blobs {+ hash String @id+ content String+ size Int+ mimeType String?+ createdAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+}++model mastra_skill_versions {+ id String @id+ skillId String+ versionNumber Int+ name String+ description String+ instructions String+ license String?+ compatibility Json?+ source Json?+ references Json?+ scripts Json?+ assets Json?+ metadata Json?+ tree Json?+ changedFields Json?+ changeMessage String?+ createdAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ files Json?++ @@unique([skillId, versionNumber], map: "idx_skill_versions_skill_version")+}++model mastra_skills {+ id String @id+ status String+ activeVersionId String?+ authorId String?+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)+ visibility String?+ favoriteCount Int?+}++model mastra_thread_state {+ threadId String+ type String+ value Json+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@id([threadId, type])+}++model mastra_tool_provider_connections {+ authorId String+ providerId String+ connectionId String+ toolkit String+ label String?+ scope String+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@id([authorId, providerId, connectionId])+ @@index([authorId, providerId, toolkit], map: "idx_tool_provider_connections_author")+}++model mastra_workflow_definitions {+ id String @id+ description String?+ metadata Json?+ inputSchema Json+ outputSchema Json+ stateSchema Json?+ requestContextSchema Json?+ graph Json+ schedule Json?+ status String+ source String+ authorId String?+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@index([status], map: "idx_workflow_definitions_status")+}++model mastra_workspace_versions {+ id String @id+ workspaceId String+ versionNumber Int+ name String+ description String?+ filesystem Json?+ sandbox Json?+ mounts Json?+ search Json?+ skills Json?+ tools Json?+ autoSync Boolean?+ operationTimeout Int?+ changedFields Json?+ changeMessage String?+ createdAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)++ @@unique([workspaceId, versionNumber], map: "idx_workspace_versions_workspace_version")+}++model mastra_workspaces {+ id String @id+ status String+ activeVersionId String?+ authorId String?+ metadata Json?+ createdAt DateTime @db.Timestamp(6)+ updatedAt DateTime @db.Timestamp(6)+ createdAtZ DateTime? @default(now()) @db.Timestamptz(6)+ updatedAtZ DateTime? @default(now()) @db.Timestamptz(6)}model OAuthApp {