{ "version": "5", "dialect": "mysql", "id": "6c86c0af-47b6-4b5c-a100-516cfe260b2e", "prevId": "cbb6d460-f9f1-48c1-963c-ab2ea0e1240f", "tables": { "audit_logs": { "name": "audit_logs", "columns": { "id": { "name": "id", "type": "int", "primaryKey": false, "notNull": true, "autoincrement": true }, "action": { "name": "action", "type": "varchar(64)", "primaryKey": false, "notNull": true, "autoincrement": false }, "actorId": { "name": "actorId", "type": "int", "primaryKey": false, "notNull": true, "autoincrement": false }, "actorName": { "name": "actorName", "type": "varchar(255)", "primaryKey": false, "notNull": false, "autoincrement": false }, "targetId": { "name": "targetId", "type": "int", "primaryKey": false, "notNull": false, "autoincrement": false }, "targetName": { "name": "targetName", "type": "varchar(255)", "primaryKey": false, "notNull": false, "autoincrement": false }, "details": { "name": "details", "type": "json", "primaryKey": false, "notNull": false, "autoincrement": false }, "createdAt": { "name": "createdAt", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(now())" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": { "audit_logs_id": { "name": "audit_logs_id", "columns": [ "id" ] } }, "uniqueConstraints": {}, "checkConstraint": {} }, "conversations": { "name": "conversations", "columns": { "id": { "name": "id", "type": "int", "primaryKey": false, "notNull": true, "autoincrement": true }, "sessionId": { "name": "sessionId", "type": "varchar(64)", "primaryKey": false, "notNull": true, "autoincrement": false }, "visitorName": { "name": "visitorName", "type": "varchar(255)", "primaryKey": false, "notNull": false, "autoincrement": false }, "visitorEmail": { "name": "visitorEmail", "type": "varchar(320)", "primaryKey": false, "notNull": false, "autoincrement": false }, "customerId": { "name": "customerId", "type": "varchar(64)", "primaryKey": false, "notNull": false, "autoincrement": false }, "salesRep": { "name": "salesRep", "type": "varchar(255)", "primaryKey": false, "notNull": false, "autoincrement": false }, "status": { "name": "status", "type": "enum('active','escalated','resolved','closed')", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'active'" }, "assignedAgentId": { "name": "assignedAgentId", "type": "int", "primaryKey": false, "notNull": false, "autoincrement": false }, "metadata": { "name": "metadata", "type": "json", "primaryKey": false, "notNull": false, "autoincrement": false }, "createdAt": { "name": "createdAt", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(now())" }, "updatedAt": { "name": "updatedAt", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false, "onUpdate": true, "default": "(now())" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": { "conversations_id": { "name": "conversations_id", "columns": [ "id" ] } }, "uniqueConstraints": { "conversations_sessionId_unique": { "name": "conversations_sessionId_unique", "columns": [ "sessionId" ] } }, "checkConstraint": {} }, "invitations": { "name": "invitations", "columns": { "id": { "name": "id", "type": "int", "primaryKey": false, "notNull": true, "autoincrement": true }, "email": { "name": "email", "type": "varchar(320)", "primaryKey": false, "notNull": true, "autoincrement": false }, "role": { "name": "role", "type": "enum('user','agent','admin')", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'agent'" }, "token": { "name": "token", "type": "varchar(64)", "primaryKey": false, "notNull": true, "autoincrement": false }, "inviteStatus": { "name": "inviteStatus", "type": "enum('pending','accepted','expired','revoked')", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'pending'" }, "invitedById": { "name": "invitedById", "type": "int", "primaryKey": false, "notNull": true, "autoincrement": false }, "invitedByName": { "name": "invitedByName", "type": "varchar(255)", "primaryKey": false, "notNull": false, "autoincrement": false }, "acceptedByUserId": { "name": "acceptedByUserId", "type": "int", "primaryKey": false, "notNull": false, "autoincrement": false }, "message": { "name": "message", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "expiresAt": { "name": "expiresAt", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false }, "acceptedAt": { "name": "acceptedAt", "type": "timestamp", "primaryKey": false, "notNull": false, "autoincrement": false }, "createdAt": { "name": "createdAt", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(now())" }, "updatedAt": { "name": "updatedAt", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false, "onUpdate": true, "default": "(now())" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": { "invitations_id": { "name": "invitations_id", "columns": [ "id" ] } }, "uniqueConstraints": { "invitations_token_unique": { "name": "invitations_token_unique", "columns": [ "token" ] } }, "checkConstraint": {} }, "messages": { "name": "messages", "columns": { "id": { "name": "id", "type": "int", "primaryKey": false, "notNull": true, "autoincrement": true }, "conversationId": { "name": "conversationId", "type": "int", "primaryKey": false, "notNull": true, "autoincrement": false }, "sender": { "name": "sender", "type": "enum('visitor','bot','agent')", "primaryKey": false, "notNull": true, "autoincrement": false }, "content": { "name": "content", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "metadata": { "name": "metadata", "type": "json", "primaryKey": false, "notNull": false, "autoincrement": false }, "createdAt": { "name": "createdAt", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(now())" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": { "messages_id": { "name": "messages_id", "columns": [ "id" ] } }, "uniqueConstraints": {}, "checkConstraint": {} }, "password_reset_tokens": { "name": "password_reset_tokens", "columns": { "id": { "name": "id", "type": "int", "primaryKey": false, "notNull": true, "autoincrement": true }, "userId": { "name": "userId", "type": "int", "primaryKey": false, "notNull": true, "autoincrement": false }, "token": { "name": "token", "type": "varchar(64)", "primaryKey": false, "notNull": true, "autoincrement": false }, "expiresAt": { "name": "expiresAt", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false }, "usedAt": { "name": "usedAt", "type": "timestamp", "primaryKey": false, "notNull": false, "autoincrement": false }, "createdAt": { "name": "createdAt", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(now())" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": { "password_reset_tokens_id": { "name": "password_reset_tokens_id", "columns": [ "id" ] } }, "uniqueConstraints": { "password_reset_tokens_token_unique": { "name": "password_reset_tokens_token_unique", "columns": [ "token" ] } }, "checkConstraint": {} }, "users": { "name": "users", "columns": { "id": { "name": "id", "type": "int", "primaryKey": false, "notNull": true, "autoincrement": true }, "openId": { "name": "openId", "type": "varchar(64)", "primaryKey": false, "notNull": true, "autoincrement": false }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "email": { "name": "email", "type": "varchar(320)", "primaryKey": false, "notNull": false, "autoincrement": false }, "loginMethod": { "name": "loginMethod", "type": "varchar(64)", "primaryKey": false, "notNull": false, "autoincrement": false }, "role": { "name": "role", "type": "enum('user','agent','admin')", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'user'" }, "createdAt": { "name": "createdAt", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(now())" }, "updatedAt": { "name": "updatedAt", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false, "onUpdate": true, "default": "(now())" }, "lastSignedIn": { "name": "lastSignedIn", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(now())" }, "passwordHash": { "name": "passwordHash", "type": "varchar(255)", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": { "users_id": { "name": "users_id", "columns": [ "id" ] } }, "uniqueConstraints": { "users_openId_unique": { "name": "users_openId_unique", "columns": [ "openId" ] } }, "checkConstraint": {} }, "workflow_edges": { "name": "workflow_edges", "columns": { "id": { "name": "id", "type": "int", "primaryKey": false, "notNull": true, "autoincrement": true }, "workflowId": { "name": "workflowId", "type": "varchar(64)", "primaryKey": false, "notNull": true, "autoincrement": false }, "sourceNodeId": { "name": "sourceNodeId", "type": "varchar(64)", "primaryKey": false, "notNull": true, "autoincrement": false }, "targetNodeId": { "name": "targetNodeId", "type": "varchar(64)", "primaryKey": false, "notNull": true, "autoincrement": false }, "label": { "name": "label", "type": "varchar(255)", "primaryKey": false, "notNull": false, "autoincrement": false }, "condition": { "name": "condition", "type": "json", "primaryKey": false, "notNull": false, "autoincrement": false }, "createdAt": { "name": "createdAt", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(now())" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": { "workflow_edges_id": { "name": "workflow_edges_id", "columns": [ "id" ] } }, "uniqueConstraints": {}, "checkConstraint": {} }, "workflow_nodes": { "name": "workflow_nodes", "columns": { "id": { "name": "id", "type": "int", "primaryKey": false, "notNull": true, "autoincrement": true }, "workflowId": { "name": "workflowId", "type": "varchar(64)", "primaryKey": false, "notNull": true, "autoincrement": false }, "nodeId": { "name": "nodeId", "type": "varchar(64)", "primaryKey": false, "notNull": true, "autoincrement": false }, "type": { "name": "type", "type": "enum('greeting','intent','response','condition','escalation','action','end','customer_data','sales_order','guardrail')", "primaryKey": false, "notNull": true, "autoincrement": false }, "label": { "name": "label", "type": "varchar(255)", "primaryKey": false, "notNull": true, "autoincrement": false }, "config": { "name": "config", "type": "json", "primaryKey": false, "notNull": false, "autoincrement": false }, "positionX": { "name": "positionX", "type": "int", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 0 }, "positionY": { "name": "positionY", "type": "int", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 0 }, "createdAt": { "name": "createdAt", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(now())" }, "updatedAt": { "name": "updatedAt", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false, "onUpdate": true, "default": "(now())" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": { "workflow_nodes_id": { "name": "workflow_nodes_id", "columns": [ "id" ] } }, "uniqueConstraints": {}, "checkConstraint": {} }, "workflow_suggestions": { "name": "workflow_suggestions", "columns": { "id": { "name": "id", "type": "int", "primaryKey": false, "notNull": true, "autoincrement": true }, "workflowId": { "name": "workflowId", "type": "varchar(64)", "primaryKey": false, "notNull": true, "autoincrement": false }, "suggestedNodeType": { "name": "suggestedNodeType", "type": "varchar(64)", "primaryKey": false, "notNull": true, "autoincrement": false }, "label": { "name": "label", "type": "varchar(255)", "primaryKey": false, "notNull": true, "autoincrement": false }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "config": { "name": "config", "type": "json", "primaryKey": false, "notNull": false, "autoincrement": false }, "faqQuestion": { "name": "faqQuestion", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "frequency": { "name": "frequency", "type": "int", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 0 }, "suggestionStatus": { "name": "suggestionStatus", "type": "enum('pending','approved','declined','waiting')", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'pending'" }, "reviewedById": { "name": "reviewedById", "type": "int", "primaryKey": false, "notNull": false, "autoincrement": false }, "reviewedAt": { "name": "reviewedAt", "type": "timestamp", "primaryKey": false, "notNull": false, "autoincrement": false }, "createdAt": { "name": "createdAt", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(now())" }, "updatedAt": { "name": "updatedAt", "type": "timestamp", "primaryKey": false, "notNull": true, "autoincrement": false, "onUpdate": true, "default": "(now())" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": { "workflow_suggestions_id": { "name": "workflow_suggestions_id", "columns": [ "id" ] } }, "uniqueConstraints": {}, "checkConstraint": {} } }, "views": {}, "_meta": { "schemas": {}, "tables": {}, "columns": {} }, "internal": { "tables": {}, "indexes": {} } }