mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-06-03 19:25:19 +02:00
housekeeping
This commit is contained in:
parent
580ecc7f98
commit
7458f5f58c
1 changed files with 9 additions and 11 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import { MongoClient } from "mongodb";
|
||||
import { User } from "./types/types";
|
||||
import { Workflow } from "./types/workflow_types";
|
||||
import { TwilioConfig, TwilioInboundCall } from "./types/voice_types";
|
||||
import { z } from 'zod';
|
||||
import { apiV1 } from "rowboat-shared";
|
||||
|
|
@ -8,7 +7,6 @@ import { apiV1 } from "rowboat-shared";
|
|||
const client = new MongoClient(process.env["MONGODB_CONNECTION_STRING"] || "mongodb://localhost:27017");
|
||||
|
||||
export const db = client.db("rowboat");
|
||||
export const agentWorkflowsCollection = db.collection<z.infer<typeof Workflow>>("agent_workflows");
|
||||
export const chatsCollection = db.collection<z.infer<typeof apiV1.Chat>>("chats");
|
||||
export const chatMessagesCollection = db.collection<z.infer<typeof apiV1.ChatMessage>>("chat_messages");
|
||||
export const twilioConfigsCollection = db.collection<z.infer<typeof TwilioConfig>>("twilio_configs");
|
||||
|
|
@ -16,12 +14,12 @@ export const usersCollection = db.collection<z.infer<typeof User>>("users");
|
|||
export const twilioInboundCallsCollection = db.collection<z.infer<typeof TwilioInboundCall>>("twilio_inbound_calls");
|
||||
|
||||
// Create indexes
|
||||
twilioConfigsCollection.createIndexes([
|
||||
{
|
||||
key: { workflow_id: 1, status: 1 },
|
||||
name: "workflow_status_idx",
|
||||
// This ensures only one active config per workflow
|
||||
unique: true,
|
||||
partialFilterExpression: { status: "active" }
|
||||
}
|
||||
]);
|
||||
// twilioConfigsCollection.createIndexes([
|
||||
// {
|
||||
// key: { workflow_id: 1, status: 1 },
|
||||
// name: "workflow_status_idx",
|
||||
// // This ensures only one active config per workflow
|
||||
// unique: true,
|
||||
// partialFilterExpression: { status: "active" }
|
||||
// }
|
||||
// ]);
|
||||
Loading…
Add table
Add a link
Reference in a new issue