Multi-Agent Collaboration for Team and Friends
TypeScript agent-automationagent-orchestrationagent-workflowai-agentsai-collaborationai-memoryai-workforceautonomous-agentsclaude-codeclaude-code-skillscodexcoding-agentmulti-agentmultiple-agentone-person-businessone-person-companyone-person-teamopencodesolopreneur
refactor(db): merge calendar migrations 0002-0004 into 0001
Gener381a8fc42198
diff --git a/src/web/migrations/0001_schema.sql b/src/web/migrations/0001_schema.sqlindex b588f2575..0466d43ac 100644--- a/src/web/migrations/0001_schema.sql+++ b/src/web/migrations/0001_schema.sql@@ -137,6 +137,7 @@ CREATE TABLE IF NOT EXISTS conversation (agent_id TEXT NOT NULL,user_id TEXT NOT NULL REFERENCES "user"(id) ON DELETE CASCADE,title TEXT NOT NULL DEFAULT '',+ type TEXT NOT NULL DEFAULT 'user_dm_message',created_at TEXT NOT NULL DEFAULT (datetime('now')),FOREIGN KEY (agent_id, workspace_id) REFERENCES agent(id, workspace_id) ON DELETE CASCADE);@@ -220,6 +221,25 @@ CREATE TABLE IF NOT EXISTS machine_token (CREATE INDEX IF NOT EXISTS idx_machine_token ON machine_token(token);+CREATE TABLE IF NOT EXISTS calendar_event (+ id TEXT PRIMARY KEY,+ agent_id TEXT NOT NULL,+ workspace_id TEXT NOT NULL,+ title TEXT NOT NULL,+ description TEXT,+ scheduled_at TEXT NOT NULL,+ repeat_interval TEXT,+ repeat_stop_at TEXT,+ last_triggered_at TEXT,+ exceptions TEXT NOT NULL DEFAULT '[]',+ created_at TEXT NOT NULL DEFAULT (datetime('now')),+ updated_at TEXT NOT NULL DEFAULT (datetime('now')),+ FOREIGN KEY (agent_id, workspace_id) REFERENCES agent(id, workspace_id) ON DELETE CASCADE+);++CREATE INDEX IF NOT EXISTS idx_calendar_event_agent_ws ON calendar_event (agent_id, workspace_id);+CREATE INDEX IF NOT EXISTS idx_calendar_event_ws_scheduled ON calendar_event (workspace_id, scheduled_at);+-- Better Auth indexesCREATE INDEX IF NOT EXISTS idx_session_user_id ON "session"(userId);CREATE INDEX IF NOT EXISTS idx_session_token ON "session"(token);diff --git a/src/web/migrations/0002_calendar_event.sql b/src/web/migrations/0002_calendar_event.sqldeleted file mode 100644index 391ba34d1..000000000--- a/src/web/migrations/0002_calendar_event.sql+++ /dev/null@@ -1,21 +0,0 @@--- Calendar event table + conversation.type column--- Matches src/shared/src/db/schema.ts--ALTER TABLE conversation ADD COLUMN type TEXT NOT NULL DEFAULT 'user_dm_message';--CREATE TABLE IF NOT EXISTS calendar_event (- id TEXT PRIMARY KEY,- agent_id TEXT NOT NULL,- workspace_id TEXT NOT NULL,- title TEXT NOT NULL,- scheduled_at TEXT NOT NULL,- repeat_interval TEXT,- repeat_stop_at TEXT,- last_triggered_at TEXT,- created_at TEXT NOT NULL DEFAULT (datetime('now')),- updated_at TEXT NOT NULL DEFAULT (datetime('now')),- FOREIGN KEY (agent_id, workspace_id) REFERENCES agent(id, workspace_id) ON DELETE CASCADE-);--CREATE INDEX IF NOT EXISTS idx_calendar_event_agent_ws ON calendar_event (agent_id, workspace_id);-CREATE INDEX IF NOT EXISTS idx_calendar_event_ws_scheduled ON calendar_event (workspace_id, scheduled_at);diff --git a/src/web/migrations/0003_calendar_event_description.sql b/src/web/migrations/0003_calendar_event_description.sqldeleted file mode 100644index 0debe4840..000000000--- a/src/web/migrations/0003_calendar_event_description.sql+++ /dev/null@@ -1,4 +0,0 @@--- Add optional description column to calendar_event.--- Matches src/shared/src/db/schema.ts--ALTER TABLE calendar_event ADD COLUMN description TEXT;diff --git a/src/web/migrations/0004_calendar_event_exceptions.sql b/src/web/migrations/0004_calendar_event_exceptions.sqldeleted file mode 100644index 6713ac8c3..000000000--- a/src/web/migrations/0004_calendar_event_exceptions.sql+++ /dev/null@@ -1,4 +0,0 @@--- Add per-occurrence exceptions list to calendar_event.--- Matches src/shared/src/db/schema.ts--ALTER TABLE calendar_event ADD COLUMN exceptions TEXT NOT NULL DEFAULT '[]';