AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
import { Field, Folder, Project, Record, Table, TableWebhook } from '@activepieces/shared'
import { EntitySchema } from 'typeorm'
import { ApIdSchema, BaseColumnSchemaPart } from '../../database/database-common'
type TableSchema = Table & {
project: Project
folder?: Folder
fields: Field[]
records: Record[]
tableWebhooks: TableWebhook[]
}
export const TableEntity = new EntitySchema<TableSchema>({
name: 'table',
columns: {
...BaseColumnSchemaPart,
name: {
type: String,
},
folderId: {
...ApIdSchema,
nullable: true,
},
externalId: {
type: String,
},
trigger: {
type: String,
nullable: true,
},
status: {
type: String,
nullable: true,
},
projectId: {
...ApIdSchema,
nullable: false,
},
},
indices: [
{
name: 'idx_table_project_id_name',
columns: ['projectId', 'name'],
},
{
name: 'idx_table_folder_id',
columns: ['folderId'],
unique: false,
},
],
relations: {
project: {
type: 'many-to-one',
target: 'project',
cascade: true,
onDelete: 'CASCADE',
joinColumn: {
name: 'projectId',
foreignKeyConstraintName: 'fk_table_project_id',
},
},
folder: {
type: 'many-to-one',
target: 'folder',
onDelete: 'SET NULL',
nullable: true,
joinColumn: {
name: 'folderId',
foreignKeyConstraintName: 'fk_table_folder_id',
},
},
fields: {
type: 'one-to-many',
target: 'field',
inverseSide: 'table',
},
records: {
type: 'one-to-many',
target: 'record',
inverseSide: 'table',
},
tableWebhooks: {
type: 'one-to-many',
target: 'table_webhook',
inverseSide: 'table',
},
},
})